Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to shift the focus of Qt text box to enter downward

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the "Qt text box enter focus down how to achieve" the relevant knowledge, in the actual case of the operation process, many people will encounter such a dilemma, then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

I. Preface

Because this demo is too simple to use too much text description, in fact, it realizes that after typing in one text box, enter automatically jumps into the next text box and the focus moves downwards. This is very common in many social security systems, medical systems and other systems, because where those systems require a lot of input, the quickest way is to enter and jump into the next input box after typing is completed. In this way, users do not need to click with the mouse to switch the focus of the cursor, in the process of using the computer, the mouse + keyboard cooperation, the efficiency is the highest, such as in the process of writing code, the need to format the messy code, looks like the mood is much better, it is very convenient to use shortcuts directly at this time, instead of using the mouse to select the menu.

2. Widget::Widget (QWidget * parent): QWidget (parent), ui (new Ui::Widget) {ui- > setupUi (this); connect (ui- > lineEdit1, SIGNAL (returnPressed ()), this, SLOT (next ()); connect (ui- > lineEdit2, SIGNAL (returnPressed ()), this, SLOT (next ()); connect (ui- > lineEdit3, SIGNAL (returnPressed ()), this, SLOT (next ();} Widget::~Widget () {delete ui () } void Widget::next () {QLineEdit * lineEdit = (QLineEdit *) sender (); if (lineEdit = = ui- > lineEdit1) {ui- > lineEdit2- > setFocus ();} else if (lineEdit = = ui- > lineEdit2) {ui- > lineEdit3- > setFocus ();} else if (lineEdit = ui- > lineEdit3) {ui- > lineEdit1- > setFocus ()

This is the end of the content of "how to shift the focus of the Qt text box down". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report