加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Qt4:调整哪个小部件专注于开始

发布时间:2020-12-14 04:13:39 所属栏目:Windows 来源:网络整理
导读:如果我没有重新实现QMainWindow :: showEvent()(它将包含该窗口小部件的setFocus()方法),是否有任何方法可以让窗口加载时首先关注某些窗口小部件?我使用Qt4的表单编辑器,但未找到配置它的地方. 您可以在Qt Designer中设置 Tab Order或在Qt Creator中设置Des
如果我没有重新实现QMainWindow :: showEvent()(它将包含该窗口小部件的setFocus()方法),是否有任何方法可以让窗口加载时首先关注某些窗口小部件?我使用Qt4的表单编辑器,但未找到配置它的地方.
您可以在Qt Designer中设置 Tab Order或在Qt Creator中设置Designer组件.选项卡顺序中的第一个窗口小部件应该专注于加载.

Many users expect to be able to navigate between widgets and controls
using only the keyboard. Qt lets the user navigate between input
widgets with the Tab and Shift+Tab keyboard shortcuts. The default tab
order is based on the order in which widgets are constructed. Although
this order may be sufficient for many users,it is often better to
explicitly specify the tab order to make your application easier to
use.

Setting the Tab Order

To enter tab order editing mode,open the Edit menu and select Edit
Tab Order
. In this mode,each input widget in the form is shown with a
number indicating its position in the tab order. So,if the user gives
the first input widget the input focus and then presses the tab key,
the focus will move to the second input widget,and so on.

The tab order is defined by clicking on each of the numbers in the
correct order. The first number you click will change to red,
indicating the currently edited position in the tab order chain. The
widget associated with the number will become the first one in the tab
order chain. Clicking on another widget will make it the second in the
tab order,and so on.

Repeat this process until you are satisfied with the tab order in the
form — you do not need to click every input widget if you see that
the remaining widgets are already in the correct order. Numbers,for
which you already set the order,change to green,while those which
are not clicked yet,remain blue.

If you make a mistake,simply double click outside of any number or
choose Restart from the form’s context menu to start again. If you
have many widgets on your form and would like to change the tab order
in the middle or at the end of the tab order chain,you can edit it at
any position. Press Ctrl and click the number from which you want to
start. Alternatively,choose Start from Here in the context menu.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读