本文整理匯總了Python中qtpy.QtWidgets.QListWidget方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QListWidget方法的具體用法?Python QtWidgets.QListWidget怎麽用?Python QtWidgets.QListWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qtpy.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QListWidget方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setupUi
# 需要導入模塊: from qtpy import QtWidgets [as 別名]
# 或者: from qtpy.QtWidgets import QListWidget [as 別名]
def setupUi(self):
self.resize(200, 320)
self.vbox = QVBoxLayout(self)
self.listWidget = QListWidget(self)
self.listWidget.setSelectionMode(self.listWidget.MultiSelection)
self.listWidget.selectionModel().reset()
self.vbox.addWidget(self.listWidget)
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self)
self.vbox.addWidget(self.buttonBox)
self.buttonBox.accepted.connect(self.accept)
self.listWidget.doubleClicked.connect(self.accept)
self.buttonBox.rejected.connect(self.reject)
self.fill_logger_list()
示例2: __init__
# 需要導入模塊: from qtpy import QtWidgets [as 別名]
# 或者: from qtpy.QtWidgets import QListWidget [as 別名]
def __init__(self, arg):
QComboBox.__init__(self, arg)
self.actorlist = QListWidget()
self.setModel(self.actorlist.model())
self.setView(self.actorlist)
self.view().installEventFilter(self)
self.parent = None
示例3: _make_widget
# 需要導入模塊: from qtpy import QtWidgets [as 別名]
# 或者: from qtpy.QtWidgets import QListWidget [as 別名]
def _make_widget(self):
"""
Sets up the widget (here a QComboBox)
:return:
"""
self.widget = QtWidgets.QListWidget()
self.widget.addItems(self.options)
self.widget.currentItemChanged.connect(self.write_widget_value_to_attribute)
示例4: setupUi
# 需要導入模塊: from qtpy import QtWidgets [as 別名]
# 或者: from qtpy.QtWidgets import QListWidget [as 別名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(346, 309)
Dialog.setSizeGripEnabled(True)
Dialog.setModal(True)
self.verticalLayout_4 = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.main_label = QtWidgets.QLabel(Dialog)
self.main_label.setObjectName("main_label")
self.verticalLayout_4.addWidget(self.main_label)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.other_label = QtWidgets.QLabel(Dialog)
self.other_label.setObjectName("other_label")
self.verticalLayout_3.addWidget(self.other_label)
self.other_list = QtWidgets.QListWidget(Dialog)
self.other_list.setObjectName("other_list")
self.verticalLayout_3.addWidget(self.other_list)
self.horizontalLayout.addLayout(self.verticalLayout_3)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.targets_add = QtWidgets.QPushButton(Dialog)
self.targets_add.setMaximumSize(QtCore.QSize(30, 16777215))
self.targets_add.setObjectName("targets_add")
self.verticalLayout.addWidget(self.targets_add)
self.other_add = QtWidgets.QPushButton(Dialog)
self.other_add.setMaximumSize(QtCore.QSize(30, 16777215))
self.other_add.setObjectName("other_add")
self.verticalLayout.addWidget(self.other_add)
self.horizontalLayout.addLayout(self.verticalLayout)
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.targets_label = QtWidgets.QLabel(Dialog)
self.targets_label.setObjectName("targets_label")
self.verticalLayout_2.addWidget(self.targets_label)
self.targets_list = QtWidgets.QListWidget(Dialog)
self.targets_list.setObjectName("targets_list")
self.verticalLayout_2.addWidget(self.targets_list)
self.horizontalLayout.addLayout(self.verticalLayout_2)
self.verticalLayout_4.addLayout(self.horizontalLayout)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.button_box = QtWidgets.QDialogButtonBox(Dialog)
self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.button_box.setObjectName("button_box")
self.horizontalLayout_2.addWidget(self.button_box)
self.verticalLayout_4.addLayout(self.horizontalLayout_2)
self.retranslateUi(Dialog)
self.button_box.accepted.connect(Dialog.accept)
self.button_box.rejected.connect(Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)