Use QT to create custom controls

Source: Internet
Author: User

1. Use QT crearot to create a custom control project. During the creation process, specify the created class and the Instance name of the created class. In this way, you can directly use it in the future. The icon file must be specified here to be displayed in the designer.

2. Compile the corresponding processing functions in the created project. You can mainly reload the onpaint function to design the desired custom widget content.

3. Select the version to compile.

4. in the compiled running directory, run the make install command on the console to install the control to the plug-in/designer of the current version by default. so file (in Linux)

5. Assign the generated and installed. So file to the installation directory bin/designer of QT creator so that you can view the custom control in the designer window by opening QT creator again. You can use it like other built-in QT controls.

6. Copy the. H. cpp. PRI file written in the custom control to the directory of the project using the control.

7. Add include (**. prii) to the. Pro file of the project using the control to compile and run the program.

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.