treewidget双击item获取item信息出现的问题!大牛请现身!!!!

weixin_38068392 2019-09-19 04:50:19
connect(tree,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(MyitemDouble(QTreeWidgetItem*,int)));void MainWindow::MyitemDouble(QTreeWidgetItem *Tag_N1,int col){     Tag_Action = new QMenu(this);     ettings = new QAction(tr("Reader Settings and Diagnostics"),this);     Register = new QAction(tr("Register Map"),this);     Tag_Action->addAction(Settings);     connect(Settings, SIGNAL(triggered()),this, SLOT(goToSettings()));     Tag_Action->addAction(Register);     Tag_Action->exec(QCursor::pos());     qDebug()<< col << "good "<< Tag_N1->text(0).toAscii();}双击某个item以后会出现这个菜单,但是问题是这个菜单出现以后鼠标只要在任何地方点击一下就会弹出这个菜单!!!求原因!!!!!!!!!
...全文
47 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧