qt 中 nofocus tabfocus clickouce strongfocus wheelfocus 的区别

project15 2009-04-03 04:04:44
现在我用到的只是
nofocus 和strongfocus
nofocus是永远都不会获取焦点
strongfocus是激活它的时候就有焦点
其他几个是什么意思?
在什么情况下使用?
...全文
640 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 project15 的回复:]
我就是看了手册之后才迷惑的
我没有发现lickouce 和strongfocus的区别..
[/Quote]

QWidget::ClickFocus - the widget accepts focus by clicking.
QWidget::StrongFocus - the widget accepts focus by both tabbing and clicking.

这个不就是区别吗?tab也会影响StrongFocus 方式啊.而ClickFocus 不受影响啊
HelloDan 2009-04-03
  • 打赏
  • 举报
回复
QWidget::ClickFocus - the widget accepts focus by clicking.
QWidget::StrongFocus - the widget accepts focus by both tabbing and clicking.

多了一个tab键啊。
project15 2009-04-03
  • 打赏
  • 举报
回复
我就是看了手册之后才迷惑的
我没有发现lickouce 和strongfocus的区别..
  • 打赏
  • 举报
回复
这是与焦点策略对应的focus motion


Focus motion
The customs which have evolved for directing keyboard focus to a particular widget are these:
The user presses Tab (or Shift+Tab) (or sometimes Enter).
The user clicks a widget.
The user presses a keyboard shortcut.
The user uses the mouse wheel.
The user moves the focus to a window, and the application must determine which widget within the window should get the focus.
Each of these motion mechanisms is different, and different types of widgets receive focus in only some of them. We'll cover each of them in turn.
  • 打赏
  • 举报
回复
楼主看看mannual,然后自己试验一下,就清楚了,学QT都是这样积累的
  • 打赏
  • 举报
回复
QWidget::FocusPolicy
This enum type defines the various policies a widget can have with respect to acquiring keyboard focus.
QWidget::TabFocus - the widget accepts focus by tabbing.
QWidget::ClickFocus - the widget accepts focus by clicking.
QWidget::StrongFocus - the widget accepts focus by both tabbing and clicking.
QWidget::WheelFocus - like StrongFocus plus the widget accepts focus by using the mouse wheel.
QWidget::NoFocus - the widget does not accept focus.
Paradin 2009-04-03
  • 打赏
  • 举报
回复
有顾名思义的冲动……
帮顶!

65,211

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

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