What are the gains of QT4 learning over the past two days?

Source: Internet
Author: User
What are the gains of QT4 over the past two days-Linux general technology-Linux programming and kernel information. The following is a detailed description. After several days of exploration, there are several gains in QT4 programming, including some methods and notes.

1. programming tools
As for the current exploration, I personally think qdevelop is the most suitable for QT4 program development. The current version is 0.25. It is written by QT4. The interface is very uniform. The following functions are supported: a) code prompt; B) automatic indent; c) project management; d) Call QT designer for visual layout. In addition, these functions are well completed.

2. Precautions for Layout
In the last step of the program layout, the main window is selected, rather than all the parts are selected. The former can automatically change the parts with the changes in the main window, and the latter cannot, unless you make up the previous operations. Otherwise, the part size in the main window remains unchanged and does not change with the size of the main window.

3. SLOT function overload (SLOT)
Assume that a system slot function has been connected in designer,
The operations in the Code are as follows:
A) add a slot declaration in the header file (for example, MyDialog. h ).
Private SLOT:
Virtual void accept ();
B) add function definitions in the Function Temperature file (MyDialog. cpp ).
Void MyDialog: accept ()
{
// Your code here;
}

4. Custom SLOT Functions)
The custom slot function cannot complete the connection in the designer, or it is connected in the function program (MyDialog. cpp ).
A) add a slot declaration in the header file (for example, MyDialog. h) (where the function type is no longer virtual.
Private SLOT:
Void hello ();
B) add a function definition in the function file (MyDialog. cpp ).
Void MyDialog: hello ()
{
// Your code here;
}
C)
The connection is directly written in the next line after setUi (this.
Connect (sender, SIGNAL (), explorer, SLOT (hello ()));

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.