Qt learning notes-Eclipse integrated designer

Source: Internet
Author: User

The integration of QT and eclipse is very simple. After installing the integration package, set the bin directory and include directory of QT. QT projects will be added to CDT.

After the integration of QT and eclipse, the biggest benefit is that you can use the visual design tool of QT band, which is similar to xui and refreshing.

There are some differences from the conventional Vs and netbean practices. Let's simply record them.

1. Each added UI form or dialog box class will generate the following file
* An object-class CPP file and an object-Class header file
In each object class, a UI class declaration is automatically added, which can be used to reference the contained UI elements.
Ui: adddialogclass UI;
* A header file in the format of "UI _ object name. H" is used to save the added elements in the designer. Do not modify this part manually. This part should be learned from netbean and should be set to read-only.
* An object. UI file form file, which is used to describe the design layout of an object. Double-click to open the designer. Note: The Form file must be saved before the previous UI header file is generated.

2. event processing. You can use macros to directly define an event in a form without using connect for connection.

For example, declare in the header file
Private slots:
Void on_addbutton_clicked ();

The slots automatically corresponds to the clicked event of addbutton, depending on the name specification.

You can find this in the UI header fileCode
Qmetaobject: connectslotsbyname (addressbookclass );
It is easier than simply writing code.
 
3. You can also use the edit signal and slot editors for event processing to achieve visualized event Association.
Drag the guiding arrow of an object to another object and select the signal to be associated.

4. Each project in QT has a. Pro file, which is responsible for summarizing and managing file resources in the project. When adding a source file in eclipse, remember to add the file to pro. It is easy to manage in a visualized manner.

5. Others

* In the editing status, use Ctrl + to drag to copy objects. Select shift or multiple.

* Layout can be nested multiple times, which is different from swing, but it is easier to use. You can select several elements and then right-click to set the layout of these elements. Spacer can be used between elements to control the distance, which is easy to use.

* The Attribute Editor is a bit mentally retarded. You cannot press Ctrl + V or right-click it.


Overall feeling:
* The UI layout design is more flexible and easier to use than netbean and.
* Event processing is a little complicated and cannot be directly visualized. It is a bit uncomfortable to manually add code to the header file and CPP file.
* The system is relatively stable. Compilation is slow.

Related Article

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.