Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,我们有一个带有一定数量 lineEdits 的 groupbox。 当用户从一行按 Tab 焦点时,编辑更改为其他。 如何按特定顺序改变焦点? 在我的 Dialog 中,焦点以一种非常奇怪的方式发生了变化。例如光标以这种方式跳转 1 3 2 4 lineEdits。我想让它跳跃 1 2 3 4 lineEdits 我认为顺序是这样的,因为我按这样的顺序添加了这一行编辑......但是重新制作所有 GUI 对我来说不是一个解决方案......
在设计器中,您应该选择 Edit->Edit Tab Order(将出现蓝色数字)。比你按你想要的顺序点击你的小部件(数字会改变)。完成后,您应该选择 Edit->Edit Widgets(或按 F3)。
如果您不使用设计器,请使用:
void QWidget::setTabOrder ( QWidget *first, QWidget *second );
Qt Designer:编辑->编辑标签顺序