PyQt(+PySide) Frameless Window
I strongly recommend legacy version if your OS is not Windows and that's saying a lot.
If you want to enhance this project, feel free to contribute macOS and Linux feature, since i don't afford to do test of pyqt-frameless-window in those OS.
You can skip below, it's just for testing.
python -m pip install pyqt-frameless-window
python -m pip install pyqt-frameless-window==0.0.61
FramelessWidget
, the others have multiple inheritance, so it can cause unexpected problem (haven't found any so far, though)hint
You can give the list of buttons on the right top of the menu bar with hint
like ['full_screen', 'min', 'max', 'close'].
['min', 'max', 'close'] will set by default if you don't give any arguments.
Available arguments (since v0.0.78)
You can set the list of them with setTitleBarHint(hint: list)
as well. (since v0.0.82)
setResizable(f: bool)
- Set resizable/none-resizable.isResizable() -> bool
- Check if window is resizable or notsetPressToMove(f: bool)
- Set movable/non-movableisPressToMove() -> bool
- Check if window is movable or notsetWindowIcon(filename: str)
- Set the icon to the title bar. This method is overriden.setWindowTitle(title: str)
- Set the title to the title bar. This method is overriden.setFixedSize(width, height)
- Set the fixed width and height. This method is overriden to call setResizable(false)
.setTitleBarVisible(f: bool)
- Set the title bar's visibility. If window is movable, window moving policy will also be decided by this.
getTitleBar()
- Get the title bar.setTitleBarHint(hint: list)
- Set the standard buttons(min, max, close...) of corner widget.
setMargin(margin: int)
- Set the margin which allows cursor to change its shape to resize formsetFrameColor(color)
- Set the background color. color argument type can be both QColor and str.getFrameColor
-> QColor - Get the background color.setVerticalExpandedEnabled(f: bool)
- Make it able to expand vertically when double-clicking the top or bottom edges of the window.
getIcon() -> QLabel
- Get the icon.getTitle() -> QLabel
- Get the title.setTitleBarFont(font: QFont)
- Set the font of the title bar.setIconSize(w, h)
- Set the size of icon on the title bar.Note: Do not use any functions other than the above.
If you make the title bar not visible with setTitleBarVisible(False)
Try to move and resize it.
Note: Result image was tested in Windows 11, PySide6.
Legacy version(0.0.61) README - not using Windows API, qtpy, just good old PyQt5. Enable to resize and move as always. (clunky in Windows though) Only for PyQt5 by the way.