Class 6th window widgets and window types

Source: Internet
Author: User

1. window Components

(1) The graphical user interface is composed of different windows and window components

(2)<QtGui> header file contains window components , corresponding to the GUI module in QT

(3) QT constructs a graphical user interface in the form of component objects

(4) Component type

Container Class (parent component): Used to include other interface components. the top-level component without a parent component in Qt is called a window

feature Class (subcomponent): for specific interactive functions

2. class inheritance diagram for window components

(1) Qwidget succession diagram

①qobject is the base class for all Qt object models that support

The ②qwidget class inherits from the Qobject class and the Qpaintdevice class

③qpaintdevice is the base class for all the components that can be drawn in QT

(2) Qwidget components

①qwidget is able to draw itself and handle user input

②qwidget is the parent class of All Windows component classes in QT (Super Class)

③qwidget is an abstraction of all window components

Each window component in the ④QT is a qwidget

Qwidget class objects are often used as parent components or top-level components

On the qwidget of "programming Experiment"

3. Qlabel Components

(1) Qlabel for displaying a suggestive string

(2) Qlabel is a functional component that typically requires a parent component as a container

(3) Qlabel can exist as a window, but it doesn't make any sense.

Qwidget W;   // generating Qwidget objects, top-level components Qlabel L (&w); // generates a Qlabel object whose parent component is Qwidget // set the display string for the Qlabel component L.settext ("This isa label control");

The use of the "programming experiment" Qlabel component

4. window Style

(1) Window type

①QT::D ialog--dialog box type

②qt::window--main Window type

③qt::splashscreen--Start Screen type

④ ...

(2) Window sign

①qt::windowstaysontophint--pinned

②qt::windowcontexthelpbuttonhint--display Help in the upper right corner of the window

"Programming Experiment" window type and window flags

5. Summary

(1) QT constructs a graphical user interface in the form of component objects

(2) TheQwidget class is the parent class for all user interface components

(3) Qwidget class objects are often used as parent or top-level components

(4) QT can be customized according to the needs of the window design

(5) Qlabel for displaying a suggestive string

Class 6th window widgets and window types

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.