Login window design Simple test steps

Source: Internet
Author: User
First, refer to: http://bbs.qter.org/forum.php?mod=viewthread&tid=12, after a detailed look at the above tutorial, do not refer to the above tutorial, and follow the steps below to complete the login interface design, so that in the design process and procedures to form their own understanding, enhance the learning effect:
1, new QT GUI application 2, add a button in the main window or other design, if only for testing do not need to make changes to the main window directly into the 3rd Step 3, the project to add new files--designer class, And after the successful creation of the UI design interface dragged into two labels and two lineedit as the user name and password input, two buttons are renamed to login and Exit 4, the right exit button to go to the click () function corresponding to the slot function, set to close (), When you click Exit, you exit the program. 5. Go to the Click () slot function of the login button, use the IF function to determine if the user name and password are correct (lineedit text (), and then accept (), and log in successfully after clicking the login button. The error is to use Qmessagebox's warning function to pop up the warning window, the content is self-determined, the above is the most basic login window design test steps, there are several small details need to refine 6, password should not be displayed: In the UI design interface, Set the Echomode in the properties of the Password input box to password so that the black point is displayed when the password is entered, or in the constructor for the CPP file of the corresponding designer class, using Ui->pwdlineedit->setecho ( Qlineedit::p assword) function to set the password mode) 7, in the judgment function after password input error (else) automatically clears the user name password and repositions the cursor to the input box: Naturally, the use of Lineedit's clear () function and SetFocus () function; 8, remove the user name, the password in the tail and the space: Lineedit trimmed () function

Login window design Simple test steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.