qt子控件焦點的切換

 

設置焦點的順序

[static] void QWidget::setTabOrder(QWidget *first, QWidget *second)
Puts the second widget after the first widget in the focus order.
It effectively removes the second widget from its focus chain and inserts it after the first widget.
Note that since the tab order of the second widget is changed, you should order a chain like this:

 

設置焦點的策略


[slot] void QWidget::setFocus() //可通過信號槽方式設置
This is an overloaded function. 
Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window.

 

發佈了39 篇原創文章 · 獲贊 2 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章