Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.43 KB

README.md

File metadata and controls

56 lines (38 loc) · 1.43 KB

pyqt-checkbox-list-widget

PyQt QListWidget for checkable items

Requirements

PyQt5 >= 5.8

Setup

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

Included Packages

Note

If you want to use pyqt-checkbox-list-widget only without pyqt-tooltip-list-widget, just remove and update the source - bug won't occur.

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

example.mp4

Similar package

pyqt-checkbox-table-widget