Use QT designer to quickly design a form

Source: Internet
Author: User
Tags qt designer

Design the form using QT designer, save it in the % name % folder, and name it % name %. UI

In the % name % folder, create the main function.

When a project is created using qmake (qmake-project; qmake % name %. pro), qmake will automatically detect the user interface file % name %, UI and can generate appropriate makefile rules to call the QT User Interface Compiler (UIC ). UIC converts the % name %. UI file to C ++ and stores the replace result in the UI _ % name %. h file.

The generated UI _ % name %. the H file contains the definition of Class UI: % name %, which is a file with % name %. the UI file is equivalent to a C ++ file. This class declares some member variables, which store the sub-windows in the form and the sub-variables, and the setui () function used to initialize the form.

The generated class does not have any base class. When using this form in the main. cpp file, you can create a qdialog object and pass it to the setui () function.

By writingCodeTo make the dialog box have appropriate functions. The most convenient way is to create a new class that inherits the class from both qdialog and UI: gotocelldialog and implement the missing functions.

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.