QTableView的获取焦点
来源:互联网 发布:请你列举三个机构域名 编辑:程序博客网 时间:2024/05/16 09:32
想取消qtableview获取焦点的功能,查了qt4.1.0文档,仔细看了下,用setFocusPolicy设置
tableView->setFocusPolicy(Qt::NoFocus)
其中qt4.1.0文档关于enum Qt::FocusPolicy说明如下:
This enum type defines the various policies a widget can have with respect to acquiring keyboard focus.
Constant | Value | Description |
---|---|---|
Qt::TabFocus | 0x1 | the widget accepts focus by tabbing. |
Qt::ClickFocus | 0x2 | the widget accepts focus by clicking. |
Qt::StrongFocus | TabFocus | ClickFocus | 0x8 | the widget accepts focus by both tabbing and clicking. On Mac OS X this will also be indicate that the widget accepts tab focus when in 'Text/List focus mode'. |
Qt::WheelFocus | StrongFocus | 0x4 | like Qt::StrongFocus plus the widget accepts focus by using the mouse wheel. |
Qt::NoFocus | 0 | the widget does not accept focus. |
而关于enum Qt::FocusReason的说明如下:
This enum specifies why the focus changed. It will be passed through QWidget::setFocus and can be retrieved in the QFocusEvent sent to the widget upon focus change.
Constant | Value | Description |
---|---|---|
Qt::MouseFocusReason | 0 | A mouse action occurred. |
Qt::TabFocusReason | 1 | The Tab key was pressed. |
Qt::BacktabFocusReason | 2 | A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. |
Qt::ActiveWindowFocusReason | 3 | The window system made this window either active or inactive. |
Qt::PopupFocusReason | 4 | The application opened/closed a popup that grabbed/released the keyboard focus. |
Qt::ShortcutFocusReason | 5 | The user typed a label's buddy shortcut |
Qt::MenuBarFocusReason | 6 | The menu bar took focus. |
Qt::OtherFocusReason | 7 | Another reason, usually application-specific. No good reason, really. |
原来两者区别挺大的,学习了.
资料参考:Qt 4.1.0文档
- QTableView的获取焦点
- Qt QTableView焦点事件
- QTableView如何获取单元格变化的事件
- 获取焦点的意思
- TV焦点的获取
- 输入框的获取焦点、失去焦点
- QT QTableView 获取单击选中行的内容
- QT QTableView 获取某行的所有信息
- QT QTableView 获取单击选中行的内容
- 使用qstandarditemmodel获取qtableview中复选框的数据
- 获取 拥有焦点的控件
- EidtText获取焦点的方法
- Dialog 获取焦点的监听
- 获取焦点, 失去焦点
- QTableView双击 获取 一行数据
- android获取当前焦点的位置,查找焦点的位置
- jQuery的获取焦点和失去焦点事件
- 兼容ie 谷歌 火狐的获取焦点失去焦点方法
- 如何修改TOMCAT的默认主页为你自己项目的主页 (WEB开发)
- Java调用浏览器
- 对无线数传设备(GPRS/CDMA)的信号测试的简单说明
- s3cmci的 io开关操作分析
- 数据储存的发展
- QTableView的获取焦点
- C# Hashtable 正序和逆序排序
- ASP.NET(C#)经典采集代码
- 常用宏定义一览
- java程序被载入内存后的存储模式
- Display Tag运用小记
- vs.net打包程序时设置自动检测环境并安装.net framwork
- JS设计模式(二)getter setter
- 企业应对危机 业务创新有六得力“武器”