2. How to adjust the switching order of the control tab key in Qt Designer? (Partnerships)

        Take the login interface as an example. I want others to press the Tab key to switch the input box when typing, from the account input box to the password input box and then to the confirmation password box. This involves the partnership in Qt.

        How to achieve it? In fact, it is very simple, no need to write code, no need to change controls, just click on the box function item with "123" in the upper left corner. Then let's click to see the effect:

        After clicking, we found that there is a number in the upper left corner of all controls, and this number represents the order of switching. If the user's mouse clicks button 3, then he will jump to button 4 after pressing the Tab key, and continue to press Tab, and will jump to 5, 6, 7, 8, 9 in turn. When staying at 9 After the No. 1 control, if you press the Tab key again, it will jump back to the No. 1 control. This is the logic of the jump, very simple, right?

        Then you will ask, what should I do if I want to jump up from the bottom row of controls? How to adjust the serial number on this control? This is of course possible. We only need to click the serial number on the control and then right-click the mouse, and you will find several optional functions, as shown in the figure below:

         There are 3 functions, right? Generally, we can use the first 2 functions. The first one is "start here", what does it mean? Literal meaning ~ For example, if I click on the serial number 6, and then click "Start from here", then the serial number 6 will not change, what will change is that when you click on the serial number 4 control, the serial number will become 7, and so on , it will become 8,9 later.

        In fact, this is not used much, at most it is used to temporarily adjust the wrong order. I generally use the second function, "Restart".

        When you click "Restart", all the serial numbers will not change. What changes is that when you click one of the controls with the mouse, the first one you click will become serial number 1, and the second one you click will change to serial number 1. It will become serial number 2, and so on...

        Although the adjustment function of this partnership is very simple, I have searched the Internet for a long time but have not found how to use it. I just clicked and tried a few times. After I knew it, I came here to share it immediately. One is afraid I will forget it at that time. If I write an article, I can come back and read it to deepen my impression. The second one, I hope to grow up with everyone, and strive to transform from a Qt novice to a Qt expert!

        A very simple function is very long-winded by me, I hope my friends will be more understanding when watching it! hee hee~

Guess you like

Origin blog.csdn.net/weixin_53989417/article/details/125415275