Skip to content

yjg30737/pyqt-foldable-window

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyqt-foldable-window

PyQt foldable window

I will add this feature to pyqt-custom-titlebar-window.

Even though this included aforementioned package.

Requirements

PyQt5 >= 5.8

Setup

pip3 install git+https://github.com/yjg30737/pyqt-foldable-window.git --upgrade

Included Packages

Feature

  • Being able to fold, unfold window by toggle button on the menu bar
  • Being able to move the window with dragging menu bar

Example

from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu
from pyqt_foldable_window import FoldableWindow


class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.__initUi()

    def __initUi(self):
        fileMenu = QMenu('File', self)
        self.menuBar().addMenu(fileMenu)


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    window = FoldableWindow(MainWindow())
    window.show()
    app.exec_()

Result

Note: Preview below is very first version. Current version(0.3.0) icons are svg, so they are not blurry anymore.

Unfolded state

image

Folded state

image

Note

FoldableWindow's argument should be only QMainWindow kind of class that QMenuBar exists. If that is not exist, error will occur.

See Also