Skip to main content

PyQt QListWidget which itemWidget is foldable

Project description

pyqt-foldable-item-list-widget

PyQt QListWidget which itemWidget is foldable

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-foldable-item-list-widget

Included Package

Example

Code Sample

from PyQt5.QtWidgets import QPushButton, QVBoxLayout, QLineEdit, QTextEdit, QWidget, QApplication

from pyqt_foldable_item_list_widget import FoldableListWidget





class Widget(QWidget):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        addBtn = QPushButton('Add')

        addBtn.clicked.connect(self.__add)

        self.__foldableListWidget = FoldableListWidget()

        lay = QVBoxLayout()

        lay.addWidget(addBtn)

        lay.addWidget(self.__foldableListWidget)

        self.setLayout(lay)



    def __add(self):

        foldedItem = QLineEdit()

        foldedItem.setPlaceholderText('Input...')

        unfoldedItem = QTextEdit()

        unfoldedItem.setPlaceholderText('Input...')

        self.__foldableListWidget.setFoldableListWidgetItem(foldedItem, unfoldedItem)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    widget = Widget()

    widget.show()

    app.exec_()

Result

python 2022-02-14 오전 11_16_52

See Also

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-foldable-item-list-widget-0.0.12.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

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