Skip to main content

PyQt QListWidget for checkable items

Project description

pyqt-checkbox-list-widget

PyQt QListWidget for checkable items

Requirements

PyQt5 >= 5.8

Setup

python -m pip install pyqt-checkbox-list-widget

Included Packages

Example

from PyQt5.QtWidgets import QCheckBox, QVBoxLayout, QWidget, QApplication

from pyqt_checkbox_list_widget.checkBoxListWidget import CheckBoxListWidget





class Widget(QWidget):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        allCheckBox = QCheckBox('Check all')

        checkBoxListWidget = CheckBoxListWidget()

        checkBoxListWidget.addItems(['a', 'b', 'c', 'd'])



        allCheckBox.stateChanged.connect(checkBoxListWidget.toggleState)



        lay = QVBoxLayout()

        lay.addWidget(allCheckBox)

        lay.addWidget(checkBoxListWidget)



        self.setLayout(lay)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    widget = Widget()

    widget.show()

    app.exec_()

Result

https://user-images.githubusercontent.com/55078043/145694178-9d583318-2533-43fd-bbc1-71c85444a953.mp4

Similar package

pyqt-checkbox-table-widget

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-checkbox-list-widget-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

pyqt_checkbox_list_widget-0.0.1-py3-none-any.whl (3.7 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