1 Star 1 Fork 4

KK-Loong/qtfilemanager

forked from Lu_jiajun/qtfilemanager 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
treeview.cpp 769 Bytes
一键复制 编辑 原始数据 按行查看 历史
Lu-jiajun 提交于 2022-09-29 01:04 . Myfilesystemmodel
#include "treeview.h"
TreeView::TreeView(QWidget *parent) : QTreeView() //构造函数
{
this->setContextMenuPolicy(Qt::CustomContextMenu);
connect(this,SIGNAL(customContextMenuRequested(const QPoint &)),this, SLOT(slotCustomContextMenu(const QPoint &)));
}
void TreeView::slotCustomContextMenu(const QPoint &point) //槽函数定义
{
QMenu *menu = new QMenu(this);
QAction *a1=new QAction(tr("上传"));
menu->addAction(a1);
QAction *a2=new QAction(tr("移动"));
menu->addAction(a2);
QAction *a3=new QAction(tr("复制"));
menu->addAction(a3);
QAction *a4=new QAction(tr("删除"));
menu->addAction(a4);
QAction *a5=new QAction(tr("粘贴"));
menu->addAction(a5);
menu->exec(this->mapToGlobal(point));
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/kk-loong/qtfilemanager.git
git@gitee.com:kk-loong/qtfilemanager.git
kk-loong
qtfilemanager
qtfilemanager
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385