Create and compile Qt projects in LINUX

Source: Internet
Author: User
In LINUX, create and compile the Qt project-general Linux technology-Linux programming and kernel information. The following is a detailed description. 1. Use Qt designer to create the BaseClass. ui file and BaseClass. ui. h (if necessary ).

2. Generate the corresponding. h and. cpp files from the. ui file:
Uic-o BaseClass. h BaseClass. ui
Uic-o BaseClass. cpp-I (-impl) BaseClass. h BaseClass. ui

3. Generate the. h and. cpp files of the subclass (if necessary ):
Uic-o SubClass. h-subdecl SubClassBaseClassBaseClass. ui
Uic-o SubClass. cpp-subimpl SubclassSubClass. h BaseClass. ui

4. Generate the moc file:
Moc-o moc_BaseClass.cpp BaseClass. h
Moc-o moc_SubClass.cpp SubClass. h

5. Generate the project file. pro:
Qmake-o Project. pro-project
If no file name is specified, the file name is the name of the current directory by default.

6. Generate Makefile
Qmake

7. Compile link: make

Note: Linux Redhat 9.0, Qt3.3. Green can be changed based on the actual project.

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.