PyQt5 can be used to create desktop applications in Python. It lets you build a graphical user interface (GUI) for your Python program.
In a desktop, not all windows are the same. Some windows can not be maximized (like a popup). Some windows only exist in full screen mode (games). A PyQt window can be configured using window flags. After ‘configuration’, it will create another type of window.
Related course: Create PyQt Desktop Appications with Python (GUI)
pyqt window flags
Some windows don’t have a close window button [x], others windows don’t have a title bar and so on. All kind of windows are possible on a desktop operating system.
If you use the Chrome web browser, you may see a different type of title bar, custom from other desktop apps on your computer.
You would set a windows flags using this method:window.setWindowFlags(flags)
flags = Qt.WindowFlags()
PyQt window flags
PyQt has these window flags:
- Qt.MSWindowsFixedSizeDialogHint
- Qt.X11BypassWindowManagerHint
- Qt.FramelessWindowHint
- Qt.WindowTitleHint
- Qt.WindowSystemMenuHint
- Qt.WindowMinimizeButtonHint
- Qt.WindowMaximizeButtonHint
- Qt.WindowCloseButtonHint
- Qt.WindowContextHelpButtonHint
- Qt.WindowShadeButtonHint
- Qt.WindowStaysOnTopHint
- Qt.WindowStaysOnBottomHint
- Qt.CustomizeWindowHint
Windows
These can be applied to windows.
PyQt has not just one, but many types of windows:
- Qt.Window
- Qt.Dialog
- Qt.Sheet
- Qt.Drawer
- Qt.Popup
- Qt.Tool
- Qt.ToolTip
- Qt.SplashScreen
If you are new to Python PyQt, then I highly recommend this book.