Qt焦点改变顺序 [英] Qt focus changing order

查看:252
本文介绍了Qt焦点改变顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我们有一个groupbox的一些lineEdits的数量。

当用户按下tab焦点从一个lineEdit更改为其他。

如何使焦点更改在特定的顺序?

在我的对话框中,焦点以非常奇怪的方式改变。例如,光标以这种方式跳转1 3 2 4 lineEdits。我想让它跳跃1 2 3 4 lineEdits

我认为顺序是这样的,因为我添加了这样的顺序编辑...但重新制作所有的图形用户界面不是我的解决方案...

解决方案

在设计器中,您应该选择Edit-> Edit Tab Order(会出现蓝色数字)。
比你按你想要的顺序点击你的小部件(数字会改变)。
完成之后,您应该选择Edit-> Edit Widgets(或按下F3)。

如果您不使用设计器,请使用:

  void QWidget :: setTabOrder(QWidget * first,QWidget * second); 


For example we have a groupbox with some amount of lineEdits.
When user press Tab focus from one lineEdit changed to other.
How to make focus change in the specific order?
In my Dialog focus changed in a very strange way.
For example cursor jumps this way 1 3 2 4 lineEdits. I want to make it jumping 1 2 3 4 lineEdits
I think that the order is such because I added this line edits in such order...but remaking all GUI is not a solution for me...

解决方案

In a designer you should select Edit->Edit Tab Order (blue numbers will appear). Than you click on your widgets in the order you want them (numbers will change). After you are done, you should select Edit->Edit Widgets (or press F3).

If you are not using designer, use:

void QWidget::setTabOrder ( QWidget *first, QWidget *second );

这篇关于Qt焦点改变顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆