Skip to main content

PyQt drawer

Project description

pyqt-drawer

PyQt Drawer

Requirements

PyQt5 >= 5.8

Setup

python -m pip install pyqt-drawer

Included Packages

Feature

  • Drawer(widget: QWidget, orientation) Constructor. Default orientation is set to Qt.Horizontal. Giving Qt.Vertical is enabled, but not recommended. (There is a bug related to vertical animation starting point, i will fix it)

  • Being able to set duration with drawer.setDuration(msc)

  • Being able to set end value with drawer.setEndValue(size)

Example

Code Example

from PyQt5.QtWidgets import QMainWindow, QListWidget, QApplication

from pyqt_drawer.drawer import Drawer





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(listWidget) # widget to show/hide

        drawer.setDuration(200) # set duration (200 mseconds)

        drawer.setEndValue(listWidget.sizeHint().width()) # set end value with listwidget's appropriate maximum width

        self.setCentralWidget(drawer)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    mainWindow = MainWindow()

    mainWindow.show()

    app.exec_()

Result

https://user-images.githubusercontent.com/55078043/158046059-69d9cbfa-cd20-420c-a81e-62429cb47989.mp4

Project details


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.11.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

pyqt_drawer-0.0.11-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page