Qt--setwindowflags window styles for various flag bits

Source: Internet
Author: User

Record the style and usage of the various flags in Windowflags,

Code:

1#include"qtwindowflagstest.h"2#include <QtWidgets/QApplication>3#include <QStatusBar>4#include <QObject>5 6 intMainintargcChar*argv[])7 {8 qapplication A (argc, argv);9 qtwindowflagstest W;TenW.setgeometry (Ten, -, $, $); OneW.statusbar ()->showmessage (Qobject::tr ("Normal")); A w.show (); -  -     //only one Close button the qtwindowflagstest W2; -W2.setgeometry (225, -, $, $); - w2.setwindowflags (qt::windowclosebuttonhint); -W2.statusbar ()->showmessage ("Qt::windowclosebuttonhint"); + w2.show (); -  +     //like a dialog box, there is a question mark and a close button A qtwindowflagstest W3; atW3.setgeometry ( the, -, $, $); - w3.setwindowflags (qt::windowcontexthelpbuttonhint); -W3.statusbar ()->showmessage ("Qt::windowcontexthelpbuttonhint"); - w3.show (); -  -     //The title bar also has no buttons and does not appear there, standing there, not moving and dragging to the taskbar, right-clicking on nothing, taskbar window name, but can be closed from Task Manager in qtwindowflagstest W4; -W4.setgeometry (655, -, $, $); to w4.setwindowflags (qt::customizewindowhint); +W4.statusbar ()->showmessage ("Qt::customizewindowhint"); - w4.show (); the  *     //window has only one close button $ qtwindowflagstest W5;Panax NotoginsengW5.setgeometry (870, -, $, $); - w5.setwindowflags (qt::windowtitlehint); theW5.statusbar ()->showmessage ("Qt::windowtitlehint"); + w5.show (); A  the     //only one Close button + qtwindowflagstest W6; -W6.setgeometry (1085, -, $, $); $ w6.setwindowflags (qt::windowsystemmenuhint); $W6.statusbar ()->showmessage ("Qt::windowsystemmenuhint"); - w6.show (); -  the     //The Minimize button is not available - qtwindowflagstest W7;WuyiW7.setgeometry (1300, -, $, $); the w7.setwindowflags (qt::windowmaximizebuttonhint); -W7.statusbar ()->showmessage ("Qt::windowmaximizebuttonhint"); Wu w7.show (); -  About     //The Restore button is not available $ qtwindowflagstest W8; -W8.setgeometry (1515, -, $, $); - w8.setwindowflags (qt::windowminimizebuttonhint); -W8.statusbar ()->showmessage ("Qt::windowminimizebuttonhint"); A w8.show (); +  the     //There's no button in the window, but there's nothing in the title bar task. - qtwindowflagstest W9; $W9.setgeometry (2,238, $, $); the w9.setwindowflags (Qt::subwindow); theW9.statusbar ()->showmessage ("Qt::subwindow"); the w9.show (); the  -     //not shown on the desktop also not on the task. But there's something in the Mission tube . in qtwindowflagstest W10; theW10.setgeometry (217,238, $, $); the w10.setwindowflags (Qt::D esktop); AboutW10.statusbar ()->showmessage ("Qt::D esktop"); the w10.show (); the  the     //The title bar also has no buttons and does not appear there, standing there, not moving and dragging to the taskbar, right-clicking on nothing, taskbar window name, but can be closed from Task Manager + qtwindowflagstest W11; -W11.setgeometry (432,238, $, $); the w11.setwindowflags (qt::splashscreen);BayiW11.statusbar ()->showmessage ("Qt::splashscreen"); the w11.show (); the  -     //The title bar also has no buttons and does not appear there just to stand there and not to move and drag to the taskbar, right-click on nothing, taskbar window name, but you can close the top-level window from Task Manager always on top - qtwindowflagstest W12; theW12.setgeometry (647,238, $, $); the w12.setwindowflags (qt::tooltip); theW12.statusbar ()->showmessage ("Qt::tooltip"); the w12.show (); -  the     //There's a little close button, but it doesn't seem to really turn off the qtwindowflagstest W13; theW13.setgeometry (862,238, $, $);94 w13.setwindowflags (qt::tool); theW13.statusbar ()->showmessage ("Qt::tool"); the w13.show (); the 98     returna.exec (); About}

Results:

Qt--setwindowflags window styles for various flag bits

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.