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