Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-foldable-window
PyQt foldable window
https://github.com/yjg30737/pyqt-foldable-window
pyqt pyqt-examples pyqt-gui pyqt-qmenubar pyqt-tutorial pyqt5 pyqt5-examples pyqt5-gui pyqt5-qmenubar pyqt5-tutorial python python3 python37 qmenubar qpushbutton qt qwidget
Last synced: about 1 month ago
JSON representation
PyQt foldable window
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-foldable-window
- Owner: yjg30737
- License: mit
- Created: 2022-01-06T09:45:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-18T04:40:58.000Z (over 2 years ago)
- Last Synced: 2024-12-29T08:42:11.894Z (about 2 months ago)
- Topics: pyqt, pyqt-examples, pyqt-gui, pyqt-qmenubar, pyqt-tutorial, pyqt5, pyqt5-examples, pyqt5-gui, pyqt5-qmenubar, pyqt5-tutorial, python, python3, python37, qmenubar, qpushbutton, qt, qwidget
- Language: Python
- Homepage:
- Size: 44.9 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-foldable-window
PyQt foldable windowI 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
* pyqt-svg-button
* pyqt-resource-helper
* pyqt-custom-titlebar-window## 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
```python
from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu
from pyqt_foldable_window import FoldableWindowclass MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()def __initUi(self):
fileMenu = QMenu('File', self)
self.menuBar().addMenu(fileMenu)if __name__ == "__main__":
import sysapp = 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](https://user-images.githubusercontent.com/55078043/152663899-93b65dbd-5763-448a-a421-58681be3f3b7.png)
Folded state
![image](https://user-images.githubusercontent.com/55078043/152663909-8a7766b7-3efc-4398-bbc8-73094be9aa87.png)
## Note
`FoldableWindow`'s argument should be only `QMainWindow` kind of class that `QMenuBar` exists. If that is not exist, error will occur.## See Also
* pyqt-foldable-item-list-widget