Qt ContextMenu
来源:互联网 发布:nas网络存储器 编辑:程序博客网 时间:2024/05/21 21:40
QTableWidget中设置右键点击事件:
tableWidget->setContextMenuPolicy(Qt::CustomContextMenu); connect(tableWidget,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(rightMouseClicked()));
contextMenuPolicy:This property holds how the widget shows a context menu.这个属性用来设置widget如何显示一个context menu
enum:
Constant Value DescriptionQt::NoContextMenu 0 the widget does not feature a context menu, context menu handling is deferred to the widget's parent. widget中没有出现context menu,context menu的处理将会顺延 到parent。Qt::PreventContextMenu 4 the widget does not feature a context menu, and in contrast to NoContextMenu, the handling is not deferred to the widget's parent. This means that all right mouse button events are guaranteed to be delivered to the widget itself through QWidget::mousePressEvent(), and QWidget::mouseReleaseEvent(). 部件没有出现context menu。与NoContextMenu相比,处理不会顺延 到parent。意味着所有的鼠标右击事件都将交给QWidget::mousePressEvent(), and QWidget::mouseReleaseEvent()处理Qt::DefaultContextMenu 1 the widget's QWidget::contextMenuEvent() handler is called. (默认)ContextMenuEvent 请求处理相应Qt::ActionsContextMenu 2 the widget displays its QWidget::actions() as context menu. widget显示它的QWidget::actions()作为context menuQt::CustomContextMenu 3 the widget emits the QWidget::customContextMenuRequested() signal. //widget发送QWidget::customContextMenuRequested()信号。
0 0
- Qt ContextMenu
- qt右键菜单的简单实例 ContextMenu
- Qt contextMenu的创建和使用
- Qt contextMenu的创建和使用
- Qt contextMenu的创建和使用
- ContextMenu
- ContextMenu
- ContextMenu
- ContextMenu
- contextmenu
- ContextMenu
- ContextMenu
- ContextMenu
- Contextmenu
- ContextMenu
- ContextMenu
- ContextMenu
- Qt学习笔记(2) QMenu QToolBar ContextMenu QStatusBar
- boost::thread用法
- JSON字符串转javabean,报net.sf.ezmorph.bean.MorphDynaBean cannot be cast to.....
- ACdream 1008 A Very Easy Triangle Counting Game(找规律)
- Android 使用CountDownTimer实现倒计时的功能
- Android apk 签名和多渠道打包
- Qt ContextMenu
- MYSQL 函数分类 以及储存过程使用经验
- Java之——汉字转换拼音(大小写)
- 2017/02/15 文献阅读
- C++常用字符串分割方法
- spring----filed值注入
- jdbcTools
- Java字符串(四)--字符串生成器
- OpenGL编写Minecraft 《my我的世界》 总结及演示程序