逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::
setFocusPolicy(Qt::StrongFocus); // Tab focus order Click focus: 按下Tab键或者鼠标点击获得焦点.
使一个控件始终得到键盘输入, 不管点了什么地方:
void QWidget::grabKeyboard ()

Grabs the keyboard input.

This widget receives all keyboard events until releaseKeyboard() is called; other widgets get no keyboard events at all. Mouse events are not affected. Use grabMouse() if you want to grab that.

The focus widget is not affected, except that it doesn't receive any keyboard events. setFocus() moves the focus as usual, but the new focus widget receives keyboard events only after releaseKeyboard() is called.

If a different widget is currently grabbing keyboard input, that widget's grab is released first.
posted on 2009-05-07 22:00 逛奔的蜗牛 阅读(6248) 评论(0)  编辑 收藏 引用 所属分类: Qt

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理