Qt neutron window full-screen display and exit full screen

     

Occasional child window in Qt development and exit full-screen full-screen display of functional requirements, is a more normal situation, first of all, we need to know the sub-window full-screen and exit full-screen main method will be called what, this will be listed the main process method call:

IsFullScreen (); Analyzing the current window is in the full state or a non fullscreen

setWindowFlags (Qt :: WindowFlags type); Setting Window Attributes

showFullScreen (); full-screen display settings window

showNormal (); return to the original setting window display (Restores the widget after it has been maximized or minimized.)

 
Core code

The following types of Qt :: WindowFlags make a general introduction:

enum Qt::windowType

flags  Qt::WindowFlags

       This enumerated type is used to specify various properties for the window system widgets. They are fairly unusual, but in a few cases is necessary. Some of these flags depends on the underlying window manager supports them. The main types are:

Qt :: Widget: This is the default type of QWidget. If they have a parent, this type of sub-member is part, if not the parent control, compared with the independent window.

Qt :: Window: represents the widget is a window, regardless of whether the widget has a parent control system typically has a window frame and title bar. Please note that if no parent component controls, you can not cancel this flag is set (that is, if the parent control exists, you can cancel this mark, otherwise, this tag must be present to identify this control is a separate window).

Qt :: Dialog: indicating member should be a dialog window (i.e., the title bar is usually not maximize or minimize button). This is the default type of QDialog. To use it as if a modal dialog box, it should start from another window, or if the parent window is used with QWidget :: windowModality properties. If it is set to mode, the dialog box will prevent the application of other top-level window to get any input. We will have a parent's top-level window called a secondary window.

Qt :: Sheet: indicates that the window is a Macintosh worksheet. The use of the worksheet means that the window mode, the recommended approach is to use QWidget :: setWindowModality () or QDialog :: open ().

Qt :: Drawer: the widget is represented Macintosh drawer.

Qt :: Popup: widget indicates a pop-up top-level window, i.e. it is modal, but the window frame has a system suitable for pop-up menu.

Qt :: Tool: represents the widget is a tool window. Tool window is usually a small window, its title bar and decoration are usually smaller than the commonly used tools button collection. If you have a parent component, the tool window will remain on it. If no parent component, you might consider using Qt :: WindowStaysOnTopHint it resides in the top. If the window system supports it, you can use the tool window frame decorated lighter. It can also be used in conjunction with Qt :: FramelessWindowHint. On macOS, tool window corresponding floating window class. This means that there is a window on top of normal window; it is not possible to put on top of a normal window. By default, when the application is inactive, the tool window will disappear. This can be controlled by Qt :: WA_MacAlwaysShowToolWindow property.

Qt :: ToolTip: A widget is represented tooltip. This is used internally to implement tooltips, no title bar and window border.

Qt :: SplashScreen: indicates that the window is the splash screen. This is the default type of QSplashScreen.

Qt :: Desktop: indicates that this widget is the desktop. This is the type of QDesktopWidget.

Qt :: SubWindow: Indicates widget is a child window, e.g. QMdiSubWindow widget.

Qt :: ForeignWindow: This indicates the window object is a native platform window created by another process or manually using a handle to native code.

Qt :: CoverWindow: indicates that the window represents a window cover, for example, when an application displayed on the BlackBerry platform minimized.

There are many signs can be used to customize the appearance of top-level window, interested friends can see their own control API. You can see on the screenshot below Qt :: WindowFlags API directly.

 
A drawing API

 

 
API Figure II

 

 
API Figure III

 

 

 
API Figure IV

       If you need to demo a friend, you can scan the following QR code, concerned about micro-channel public number, the menu bar inside the micro-channel public number, click on the author, add friends, whisper author.

 

 
Alternative Life program
 

Guess you like

Origin www.cnblogs.com/wuhanpjf/p/11247770.html