Example Note: This example is for Windows only. Note: Do not use any functions other than the above. SetIconSize(w, h) - Set the size of icon on the title bar. SetTitleBarFont(font: QFont) - Set the font of the title bar. SetVerticalExpandedEnabled(f: bool) - Make it able to expand vertically when double-clicking the top or bottom edges of the window. GetFrameColor -> QColor - Get the background color. color argument type can be both QColor and str. SetFrameColor(color) - Set the background color. SetMargin(margin: int) - Set the margin which allows cursor to change its shape to resize form SetTitleBarHint(hint: list) - Set the standard buttons(min, max, close.) of corner widget. If you set this false and window is movable, you can click and drag the part of the window which is not occupied by widget to move the window. If you set this true and window is movable, you should click and drag only the title bar to move the window. If window is movable, window moving policy will also be decided by this. SetTitleBarVisible(f: bool) - Set the title bar's visibility. This method is overriden to call setResizable(false). SetFixedSize(width, height) - Set the fixed width and height. SetWindowTitle(title: str) - Set the title to the title bar. SetWindowIcon(filename: str) - Set the icon to the title bar. IsPressToMove() -> bool - Check if window is movable or not SetPressToMove(f: bool) - Set movable/non-movable IsResizable() -> bool - Check if window is resizable or not SetResizable(f: bool) - Set resizable/none-resizable. (v0.0.82) Method Overview = FramelessWidget, FramelessDialog, FramelessMainWindow = For Windows & The Others You can set the list of them with setTitleBarHint(hint: list) as well. will set by default if you don't give any arguments.įull_screen (still buggy, for example you can resize the full-screen window if you put the cusror to the very edge of the window) You can give the list of buttons on the right top of the menu bar with hint like. 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)įramelessWidget(hint=None) - frameless QWidgetįramelessDialog(hint=None) - frameless QDialogįramelessMainWindow(hint=None) - frameless QMainWindow (For new version) Recommend to clone rather than installing with pip. Python -m pip install pyqt-frameless-window Qtpy - To use PyQt5, PySide2(Qt version 5), PySide6(Qt version 6) PyQt5 - Use QtWinExtras to use Windows API feature in Qt (Qt6 doesn't support QtWinExtras anymore, sadly) I strongly recommend legacy version if your OS is not Windows and that's saying a lot. Maybe i can use the virtual machine or something to do it. I have no macOS and Linux to test so i couldn't manage to support them as well. User can make it enable/disable to move, resize Using Windows API (for Windows OS effect - shadow, rounded, animation, etc.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |