Record it windowFlags The style and usage of various flag bits ,

code :

<>
1 #include "qtwindowflagstest.h" 2 #include <QtWidgets/QApplication> 3
#include <QStatusBar> 4 #include <QObject> 5 6 int main(int argc, char *argv[])
7 { 8 QApplication a(argc, argv); 9 QtWindowFlagsTest w; 10 w.setGeometry(10,
30, 200, 200); 11 w.statusBar()->showMessage(QObject::tr("Normal")); 12
w.show(); 13 14 // There is only one close button 15 QtWindowFlagsTest w2; 16 w2.setGeometry(225, 30,
200, 200); 17 w2.setWindowFlags(Qt::WindowCloseButtonHint); 18
w2.statusBar()->showMessage("Qt::WindowCloseButtonHint"); 19 w2.show(); 20 21
// It's like a dialog box , There's a question mark and a close button 22 QtWindowFlagsTest w3; 23 w3.setGeometry(440, 30, 200,
200); 24 w3.setWindowFlags(Qt::WindowContextHelpButtonHint); 25
w3.statusBar()->showMessage("Qt::WindowContextHelpButtonHint"); 26 w3.show();
27 28 // There is no title bar There are no buttons If you show up there, you can't get there , It can't be moved or dragged , Right click on the taskbar and nothing , There is no taskbar window name , But it can be turned off from the task manager
29 QtWindowFlagsTest w4; 30 w4.setGeometry(655, 30, 200, 200); 31
w4.setWindowFlags(Qt::CustomizeWindowHint); 32
w4.statusBar()->showMessage("Qt::CustomizeWindowHint"); 33 w4.show(); 34 35
// The window has only one close button 36 QtWindowFlagsTest w5; 37 w5.setGeometry(870, 30, 200, 200); 38
w5.setWindowFlags(Qt::WindowTitleHint); 39
w5.statusBar()->showMessage("Qt::WindowTitleHint"); 40 w5.show(); 41 42
// There is only one close button 43 QtWindowFlagsTest w6; 44 w6.setGeometry(1085, 30, 200, 200); 45
w6.setWindowFlags(Qt::WindowSystemMenuHint); 46
w6.statusBar()->showMessage("Qt::WindowSystemMenuHint"); 47 w6.show(); 48 49
// The minimize button is not available 50 QtWindowFlagsTest w7; 51 w7.setGeometry(1300, 30, 200, 200); 52
w7.setWindowFlags(Qt::WindowMaximizeButtonHint); 53
w7.statusBar()->showMessage("Qt::WindowMaximizeButtonHint"); 54 w7.show(); 55
56 // The restore button is not available 57 QtWindowFlagsTest w8; 58 w8.setGeometry(1515, 30, 200, 200); 59
w8.setWindowFlags(Qt::WindowMinimizeButtonHint); 60
w8.statusBar()->showMessage("Qt::WindowMinimizeButtonHint"); 61 w8.show(); 62
63 // The window has no buttons but a title bar You can't see anything in the mission 64 QtWindowFlagsTest w9; 65 w9.setGeometry(2, 238,
200, 200); 66 w9.setWindowFlags(Qt::SubWindow); 67
w9.statusBar()->showMessage("Qt::SubWindow"); 68 w9.show(); 69 70
// It's not on the desktop, it's not on the task . But there's more in the mission tube 71 QtWindowFlagsTest w10; 72 w10.setGeometry(217,
238, 200, 200); 73 w10.setWindowFlags(Qt::Desktop); 74
w10.statusBar()->showMessage("Qt::Desktop"); 75 w10.show(); 76 77 // There is no title bar
There are no buttons If you show up there, you can't get there , It can't be moved or dragged , Right click on the taskbar and nothing , There is no taskbar window name , But it can be turned off from the task manager 78
QtWindowFlagsTest w11; 79 w11.setGeometry(432, 238, 200, 200); 80
w11.setWindowFlags(Qt::SplashScreen); 81
w11.statusBar()->showMessage("Qt::SplashScreen"); 82 w11.show(); 83 84 // There is no title bar
There are no buttons If you show up there, you can't get there , It can't be moved or dragged , Right click on the taskbar and nothing , There is no taskbar window name , But it can be turned off from the task manager top window Always on top
85 QtWindowFlagsTest w12; 86 w12.setGeometry(647, 238, 200, 200); 87
w12.setWindowFlags(Qt::ToolTip); 88
w12.statusBar()->showMessage("Qt::ToolTip"); 89 w12.show(); 90 91
// There's a little close button , But it doesn't really close 92 QtWindowFlagsTest w13; 93 w13.setGeometry(862, 238,
200, 200); 94 w13.setWindowFlags(Qt::Tool); 95
w13.statusBar()->showMessage("Qt::Tool"); 96 w13.show(); 97 98 return a.exec();
99 }
<>

 

result :

Technology
©2019-2020 Toolsou All rights reserved,
Java Swing JList: List box components Accurate mobile phone number capture , Big data of operators The difference between memory overflow and memory leak , Causes and Solutions Website mobile phone number capture method stay Vue Use in Web Worker3 species Python data structure ,13 Creation methods , This is the conclusion , Great ! What's the difference in server prices ? Basic definition and use of function ‘ To be continued SQL Server Database Glossary Chrome OS, For programmers and Windows What does it mean ? Internet Marketing