PyQt drawer
Project description
pyqt-drawer
PyQt drawer.
You can set the widget to drawer.
Opening, closing drawer involved animations of size change and drawer/parent window's 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)
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
Built Distribution
File details
Details for the file pyqt-drawer-0.0.17.tar.gz
.
File metadata
- Download URL: pyqt-drawer-0.0.17.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d38b6cdfbae0dac013878eb889830905101814c377d6f7c3e8f1db893c301271 |
|
MD5 | 7968b5c6738efef77ddfdde96e91e3c5 |
|
BLAKE2b-256 | 5d1046399eb0c1356bc2e95cee848f55d2c07d0cb2df7358b937b111fff9ea25 |
File details
Details for the file pyqt_drawer-0.0.17-py3-none-any.whl
.
File metadata
- Download URL: pyqt_drawer-0.0.17-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1cf3490bef6000cbb1c5f63ebcf70a19aaa0f2dbd21a30f9ca286edfe567e2 |
|
MD5 | 1abffd5c5f1190ed40566efaf2b4d1a5 |
|
BLAKE2b-256 | 67f55486b36dd3eacbbbf8611c93cca19253882bbd3c021187bce2aff456846c |