Controls (keys, input parts, display controls, space intervals, layout management, containers, project views)

Source: Internet
Author: User

1. Button Group


Widget (form) Select Base class Qwidget, New Class Mywidget. Here the Gernerate form means "generative form".


Here class Mywidget:public Qwidget refers to Mywidget inherits from the Qwidget class, the inheritance method is public.

Only by joining Q_object can you use the signal and slot mechanisms in QT.

Constructors (with the name of a class as a function, no return type) are used to initialize a member. (called automatically when a class object is created)

Destructors provide an opportunity to release the resources that the object occupies before the object is deleted.
Qwidget *parent = 0 Represents a parent control reference that is used to pass events to or from a parent control signal-slot those. This is not an inheritance relationship, but a logical topological relationship between components on a graphical interface. For example, a textbox placed in the tab will change its size as the tab size changes, and the event is passed through this. The formal parameter is written in Parent=0, which is the default value 0,c++ can "omit" some of the parameters by a pre-assigned value. This means that mywidget is not a child control of any control.
The parent here is a pointer to the class Qwidget


Qpushbutton *quit = new Qpushbutton ("Quit", this), the arguments inside are passed to the constructor of the class Qpushbutton .

Mywidget::mywidget (Qwidget *parent)
: Qwidget (parent)




2. Input Part Group


2.1 Qdatetime Class


2.2 Qtimer Class


3. Display control group


4. Space Interval Group


5. Layout Management Group


6. Container Group


6.1 Creating Windows


6.2 using Layouts



7. Project View Group









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.