yjg30737 / pyqt-frameless-window

PyQt(+PySide) Frameless Window
MIT License
37 stars 5 forks source link
framelesswindow pyqt pyqt5 pyqt5-examples pyqt5-frameless-window pyqt5-tutorial qcursor qt qwidget qwindow

pyqt-frameless-window

PyQt(+PySide) Frameless Window

Feature

Note

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.

Requirements

Setup

New version (using Windows API)

clone

  1. git clone ~
  2. pip install -r requirements.txt

You can skip below, it's just for testing.

  1. python sample_dialog_pyside6.py (Frameless dialog with PySide6)
  2. python sample_mainwindow_pyqt5.py (Frameless main window with PyQt5)
  3. python sample_widget_pyside6.py (Frameless widget with PySide6)

pip

python -m pip install pyqt-frameless-window

Legacy version

python -m pip install pyqt-frameless-window==0.0.61

Class Overview

Recommend to use FramelessWidget, the others have multiple inheritance, so it can cause unexpected problem (haven't found any so far, though)

About 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)

Method Overview

== FramelessWidget, FramelessDialog, FramelessMainWindow ==

For Windows & The Others

Note: Do not use any functions other than the above.

Preview

Title bar

image

No title bar

If you make the title bar not visible with setTitleBarVisible(False)

image

Try to move and resize it.

Note: Result image was tested in Windows 11, PySide6.

See Also

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.

TODO list