{"id":17603031,"url":"https://github.com/yjg30737/pyqt-frameless-window","last_synced_at":"2025-04-13T09:21:02.084Z","repository":{"id":48160690,"uuid":"452933725","full_name":"yjg30737/pyqt-frameless-window","owner":"yjg30737","description":"PyQt(+PySide) Frameless Window","archived":false,"fork":false,"pushed_at":"2023-07-18T05:40:13.000Z","size":213,"stargazers_count":41,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T10:47:36.779Z","etag":null,"topics":["framelesswindow","pyqt","pyqt5","pyqt5-examples","pyqt5-frameless-window","pyqt5-tutorial","qcursor","qt","qwidget","qwindow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yjg30737.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-28T04:03:32.000Z","updated_at":"2025-01-25T15:29:01.000Z","dependencies_parsed_at":"2023-10-02T00:22:17.237Z","dependency_job_id":null,"html_url":"https://github.com/yjg30737/pyqt-frameless-window","commit_stats":{"total_commits":178,"total_committers":2,"mean_commits":89.0,"dds":"0.016853932584269704","last_synced_commit":"9278be94d3bcc72e924a82d61ee99fcf41eb9d7c"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-frameless-window","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-frameless-window/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-frameless-window/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-frameless-window/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjg30737","download_url":"https://codeload.github.com/yjg30737/pyqt-frameless-window/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248689292,"owners_count":21145904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framelesswindow","pyqt","pyqt5","pyqt5-examples","pyqt5-frameless-window","pyqt5-tutorial","qcursor","qt","qwidget","qwindow"],"created_at":"2024-10-22T13:37:46.681Z","updated_at":"2025-04-13T09:21:02.059Z","avatar_url":"https://github.com/yjg30737.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyqt-frameless-window\r\nPyQt(+PySide) Frameless Window\r\n\r\n## Feature\r\n* Frameless\r\n* Using Windows API (for Windows OS effect - shadow, rounded, animation, etc.) \r\n* Supports PyQt5, PySide2, PySide6\r\n* User can make it enable/disable to move, resize\r\n* Supports QWidget, QDialog, QMainWindow\r\n* Support title bar. You can decide either show or hide it.\r\n\r\n## Note\r\nI \u003cb\u003estrongly recommend\u003c/b\u003e legacy version if your OS is not Windows and that's saying a lot.\r\n\r\n\u003cb\u003eIf 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.\u003c/b\u003e\r\n\r\n## Requirements\r\n* qtpy - To use PyQt5, PySide2(Qt version 5), PySide6(Qt version 6)\r\n* pywin32 - For using Windows API feature\r\n\r\n## Setup\r\n\r\n### New version (using Windows API)\r\n#### clone\r\n1. git clone ~\r\n2. pip install -r requirements.txt\r\n\r\nYou can skip below, it's just for testing. \r\n\r\n3. python sample_dialog_pyside6.py (Frameless dialog with PySide6)\r\n4. python sample_mainwindow_pyqt5.py (Frameless main window with PyQt5)\r\n5. python sample_widget_pyside6.py (Frameless widget with PySide6)\r\n\r\n#### pip\r\n`python -m pip install pyqt-frameless-window`\r\n\r\n### Legacy version\r\n\r\n`python -m pip install pyqt-frameless-window==0.0.61`\r\n\r\n## Class Overview\r\n### Recommend to use `FramelessWidget`, the others have multiple inheritance, so it can cause unexpected problem (haven't found any so far, though)\r\n* FramelessWidget(hint=None) - frameless QWidget\r\n* FramelessDialog(hint=None) - frameless QDialog\r\n* FramelessMainWindow(hint=None) - frameless QMainWindow\r\n\r\n### About `hint`\r\nYou can give the list of buttons on the right top of the menu bar with `hint` like \u003cb\u003e['full_screen', 'min', 'max', 'close']\u003c/b\u003e. \r\n\r\n\u003cb\u003e['min', 'max', 'close']\u003c/b\u003e will set by default if you don't give any arguments.\r\n\r\nAvailable arguments (since v0.0.78)\r\n* full_screen (still buggy, for example you can resize the full-screen window if you put the cusror to the very edge of the window)\r\n* min\r\n* max\r\n* close\r\n\r\nYou can set the list of them with `setTitleBarHint(hint: list)` as well. (since v0.0.82)\r\n\r\n## Method Overview\r\n### == FramelessWidget, FramelessDialog, FramelessMainWindow ==\r\n#### For Windows \u0026 The Others\r\n* `setResizable(f: bool)` - Set resizable/none-resizable.\r\n* `isResizable() -\u003e bool` - Check if window is resizable or not\r\n* `setPressToMove(f: bool)` - Set movable/non-movable\r\n* `isPressToMove() -\u003e bool` - Check if window is movable or not\r\n* ##### New Version Only\r\n   * `setWindowIcon(filename: str)` - Set the icon to the title bar. This method is overriden.\r\n   * `setWindowTitle(title: str)` - Set the title to the title bar. This method is overriden.\r\n   * `setFixedSize(width, height)` - Set the fixed width and height. This method is overriden to call `setResizable(false)`.\r\n   * `setTitleBarVisible(f: bool)` - Set the title bar's visibility. If window is movable, window moving policy will also be decided by this.\r\n       * If you set this \u003cb\u003etrue\u003c/b\u003e and window is \u003cb\u003emovable\u003c/b\u003e, you should click and drag only the title bar to move the window.\r\n       * If you set this \u003cb\u003efalse\u003c/b\u003e and window is \u003cb\u003emovable\u003c/b\u003e, you can click and drag the part of the window which is not occupied by widget to move the window.\r\n   * `getTitleBar()` - Get the title bar.\r\n   * `setTitleBarHint(hint: list)` - Set the standard buttons(min, max, close...) of corner widget.\r\n#### The Others\r\n* `setMargin(margin: int)` - Set the margin which allows cursor to change its shape to resize form\r\n* `setFrameColor(color)` - Set the background color. color argument type can be both QColor and str.\r\n* `getFrameColor` -\u003e QColor - Get the background color.\r\n* `setVerticalExpandedEnabled(f: bool)` - Make it able to expand vertically when double-clicking the top or bottom edges of the window.\r\n### == TitleBar (New Version Only) ==\r\n* `getIcon() -\u003e QLabel` - Get the icon.\r\n* `getTitle() -\u003e QLabel` - Get the title.\r\n* `setTitleBarFont(font: QFont)` - Set the font of the title bar.\r\n* `setIconSize(w, h)` - Set the size of icon on the title bar.\r\n\r\nNote: Do not use any functions other than the above.\r\n\r\n### Preview\r\n\r\n#### Title bar\r\n\r\n![image](https://user-images.githubusercontent.com/55078043/201617865-a613c415-61df-4402-a420-7c15ce3bb868.png)\r\n\r\n#### No title bar \r\n\r\nIf you make the title bar not visible with `setTitleBarVisible(False)`\r\n\r\n![image](https://user-images.githubusercontent.com/55078043/202587513-62a8b31d-df94-47a6-a13c-c3d45d6ce3a2.png)\r\n\r\nTry to move and resize it.\r\n\r\nNote: Result image was tested in Windows 11, PySide6.\r\n\r\n## See Also\r\n\r\n\u003ca href=\"https://github.com/yjg30737/pyqt-frameless-window/tree/b84dd1ba421aa7f3f940229ce6379611380f5e35\"\u003eLegacy version(0.0.61) README\u003c/a\u003e - 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.\r\n\r\n## TODO list\r\n* Make QWebEngineView work in win32 app (Windows 10) \u003ca href=\"https://bugreports.qt.io/browse/PYSIDE-2248\"\u003e(bug report link)\u003c/a\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjg30737%2Fpyqt-frameless-window","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjg30737%2Fpyqt-frameless-window","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjg30737%2Fpyqt-frameless-window/lists"}