PyQt drawer
Project description
pyqt-drawer
PyQt drawer.
You can set the widget to drawer.
Opening, closing drawer involved animations of size change and opacity
Requirements
PyQt5 >= 5.8
Setup
python -m pip install pyqt-drawer
Included Packages
Feature
-
Drawer(parent, widget: QWidget, orientation)
Constructor.-
parent
is parent window. -
widget
is the widget you want to set in the drawer. -
orientation
is orientation of drawer. Available values are Qt.Horizontal, Qt.Vertical.
-
-
Being able to set size/opacity duration with
drawer.setDuration(msc)
-
Being able to set end size value with
drawer.setEndValue(size)
.
Example
Code Example
from PyQt5.QtWidgets import QMainWindow, QListWidget, QApplication, QWidget, QGridLayout
from pyqt_drawer.drawer import Drawer
from pyqt_timer.settingsDialog import SettingsDialog
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
listWidget = QListWidget()
listWidget.addItems(
['Age of Empires II: Definitive Edition', 'American Truck Simulator', 'Arma 3', "Assassin's Creed"])
drawer = Drawer(self, listWidget) # widget to show/hide
drawer.setDuration(200) # set duration (200 milliseconds)
drawer.setEndValue(listWidget.sizeHint().width()) # set end value with listWidget's appropriate maximum width
lay = QGridLayout()
lay.addWidget(SettingsDialog(), 0, 0, 1, 1)
lay.addWidget(drawer, 0, 0, 1, 1)
lay.setContentsMargins(0, 0, 0, 0)
drawer.raise_()
mainWidget = QWidget()
mainWidget.setLayout(lay)
self.setCentralWidget(mainWidget)
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
app.exec_()
Result
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyqt-drawer-0.0.12.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for pyqt_drawer-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d00074a392fa05e48f769b713aebbe1f933792400d4c8fe516a70fdf4d9f8d8 |
|
MD5 | 65c504a6fc3a1f676fe3d0e4bf7e3d6e |
|
BLAKE2b-256 | 413203d7513dc294ec2a1ebe0aacd04cc7eaac8adce185db884d4f7f9d715c0c |