本文整理汇总了Python中PyQt4.QtGui.QListWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QListWidget方法的具体用法?Python QtGui.QListWidget怎么用?Python QtGui.QListWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui
的用法示例。
在下文中一共展示了QtGui.QListWidget方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.gridLayout = QtGui.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.dataList = QtGui.QListWidget(self.centralwidget)
self.dataList.setObjectName(_fromUtf8("dataList"))
self.gridLayout.addWidget(self.dataList, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
示例2: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def setupUi(self, TrezorChooserDialog):
TrezorChooserDialog.setObjectName(_fromUtf8("TrezorChooserDialog"))
TrezorChooserDialog.resize(400, 300)
self.verticalLayout = QtGui.QVBoxLayout(TrezorChooserDialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label = QtGui.QLabel(TrezorChooserDialog)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label)
self.trezorList = QtGui.QListWidget(TrezorChooserDialog)
self.trezorList.setObjectName(_fromUtf8("trezorList"))
self.verticalLayout.addWidget(self.trezorList)
self.buttonBox = QtGui.QDialogButtonBox(TrezorChooserDialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(TrezorChooserDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), TrezorChooserDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), TrezorChooserDialog.reject)
QtCore.QMetaObject.connectSlotsByName(TrezorChooserDialog)
示例3: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(241, 367)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
self.itemTree = QtGui.QTreeWidget(Form)
self.itemTree.setObjectName(_fromUtf8("itemTree"))
self.itemTree.headerItem().setText(0, _fromUtf8("1"))
self.itemTree.header().setVisible(False)
self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3)
self.label_2 = QtGui.QLabel(Form)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3)
self.formatList = QtGui.QListWidget(Form)
self.formatList.setObjectName(_fromUtf8("formatList"))
self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3)
self.exportBtn = QtGui.QPushButton(Form)
self.exportBtn.setObjectName(_fromUtf8("exportBtn"))
self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1)
self.closeBtn = QtGui.QPushButton(Form)
self.closeBtn.setObjectName(_fromUtf8("closeBtn"))
self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1)
self.paramTree = ParameterTree(Form)
self.paramTree.setObjectName(_fromUtf8("paramTree"))
self.paramTree.headerItem().setText(0, _fromUtf8("1"))
self.paramTree.header().setVisible(False)
self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3)
self.label_3 = QtGui.QLabel(Form)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3)
self.copyBtn = QtGui.QPushButton(Form)
self.copyBtn.setObjectName(_fromUtf8("copyBtn"))
self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例4: createDeviceListGroupBox
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def createDeviceListGroupBox(self):
self.deviceListGroupBox = QtGui.QGroupBox("Airplay to")
self.deviceSelectList = QtGui.QListWidget()
deviceSelectListNoDisplayItem = QtGui.QListWidgetItem("No display.")
self.deviceSelectList.addItem(deviceSelectListNoDisplayItem)
# layout
deviceListLayout = QtGui.QHBoxLayout()
deviceListLayout.addWidget(self.deviceSelectList)
self.deviceListGroupBox.setLayout(deviceListLayout)
示例5: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def __init__(self):
super(Gui, self).__init__()
self.resize(250, 300)
self._list = QtGui.QListWidget(self)
self._button1 = QtGui.QPushButton("Test CallbackEvent", self)
self._button2 = QtGui.QPushButton("Test CallbackPool", self)
layout = QtGui.QVBoxLayout(self)
layout.setSpacing(2)
layout.addWidget(self._button1)
line = QtGui.QFrame(self)
line.setFrameStyle(line.HLine)
layout.addSpacing(6)
layout.addWidget(line)
layout.addSpacing(6)
layout.addWidget(self._list)
layout.addWidget(self._button2)
self._pool = CallbackThreadPool(4)
self._button1.clicked.connect(self.runCallbackEvents)
self._button2.clicked.connect(self.runCallbackPool)
示例6: _addItemtoContainer
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def _addItemtoContainer(self,content):
'''
Adds items to specific container
'''
if isinstance(self._container,QToolBar) or isinstance(self._container,QMenu):
if self._actionReference != None:
self._container.insertAction(self._actionReference, content)
else:
self._container.addAction(content)
elif isinstance(self._container,QListWidget):
self._container.insertItem(self._iter,content)
self._iter += 1
示例7: _init_list_widgets
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def _init_list_widgets(self):
search_list_widget = self.findChild(qg.QListWidget,
'searchList')
self.search_list = SearchListController(self, search_list_widget)
chain_list_widget = self.findChild(qg.QListWidget, 'chainList')
self.chain_list = ChainListController(self, chain_list_widget)
favourites_list_widget = self.findChild(qg.QListWidget,
'favouritesList')
self.favourites_list = ChainListController(self,
favourites_list_widget)
示例8: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def setupUi(self, Chat):
self.main=Chat
Chat.setWindowTitle(_translate("Chat", "聊天", None))
Chat.resize(575, 524)
# font
self.font = QtGui.QFont()
self.font.setFamily(_fromUtf8("Helvetica"))
self.font.setPointSize(13)
self.font.setBold(True)
self.font.setItalic(False)
self.font.setWeight(75)
self.font2 = QtGui.QFont()
self.font2.setFamily(_fromUtf8("Helvetica"))
self.font2.setPointSize(9)
# side bar
self.listWidget_Users = QtGui.QListWidget(Chat)
self.listWidget_Users.setGeometry(QtCore.QRect(0, 0, 94, 521))
self.listWidget_Users.setSpacing(2)
self.line = QtGui.QFrame(Chat)
self.line.setGeometry(QtCore.QRect(97, 0, 10, 521))
self.line.setFrameShape(QtGui.QFrame.VLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
# stack widget
self.stackedWidget = QtGui.QStackedWidget(Chat)
self.stackedWidget.setGeometry(QtCore.QRect(100, 0, 471, 521))
# page
self.stack = {}
self.listWidget = {}
self.sideButton = {}
self.button_send = {}
self.button_close ={}
self.item_widget={}
self.textEdit = {}
QtCore.QMetaObject.connectSlotsByName(Chat)
# data
self.groupInfo={} #gcode
self.discussInfo={}
示例9: closeButtonOnClick
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def closeButtonOnClick(self,uin,flag):
print 'close,',uin
if len(self.stackedWidget)>1:
self.stackedWidget.setCurrentIndex(0)
self.stackedWidget.removeWidget(self.stack[uin])
self.stack[uin]=None
self.listWidget[uin]=QtGui.QListWidget(self.page)
self.listWidget_Users.removeItemWidget(self.item_widget[uin])
self.listWidget_Users.takeItem(self.listWidget_Users.row(self.item_widget[uin]))
self.sideButton[uin]=None
print 'remove'
示例10: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def __init__(self):
"""
Setup widgets and select signatures data from the database.
"""
super(SignaturesListWidget, self).__init__()
# Defines all layouts
self.mainLayout = QtGui.QVBoxLayout()
self.listLayout = QtGui.QHBoxLayout()
self.btnsLayout = QtGui.QVBoxLayout()
# Window config
self.titleLabel = QtGui.QLabel(u"Assinaturas cadastradas", self)
self.titleLabel.setFont(titleFont)
# Creates the btnsLayout and adds CRUD buttons
self.addBtn = QtGui.QPushButton(u"Adicionar")
self.addBtn.clicked.connect(self.add_signature)
self.editBtn = QtGui.QPushButton(u"Editar")
self.editBtn.clicked.connect(self.update_signature)
self.removeBtn = QtGui.QPushButton(u"Remover")
self.removeBtn.clicked.connect(self.remove_signature)
self.btnsLayout.addWidget(self.addBtn)
self.btnsLayout.addWidget(self.editBtn)
self.btnsLayout.addWidget(self.removeBtn)
self.btnsLayout.addStretch()
# Create a list widget for showing existing signatures
self.signaturesList = QtGui.QListWidget()
# Loads all signatures
self.load_list()
# A label for showing errors
self.errorMsg = QtGui.QLabel(u"", self)
self.errorMsg.setStyleSheet("color: red; font-weight: bold;")
# Add widgets to an horizontal layout
self.listLayout.addWidget(self.signaturesList)
self.listLayout.addLayout(self.btnsLayout)
# Add all widgets to the mainLayout
self.mainLayout.addWidget(self.titleLabel)
self.mainLayout.addLayout(self.listLayout)
self.mainLayout.addWidget(self.errorMsg)
# Set the mainLayout as the visible layout
self.setLayout(self.mainLayout)
示例11: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QListWidget [as 别名]
def __init__(self, mapWidgetHandle, parent=None):
super(FeatureTrainerWindow, self).__init__()
# Set up connections to the main map widget
self.mapWidgetHandle = mapWidgetHandle
self.mapWidgetHandle.mapClickedSignal.connect(self._handleMapClick)
# Start with no features
self.classDict = dict() # Class polygon storage
self.selectedClass = None # The name of the currently selected class
self.polygonOnMap = None # The polygon currently drawn on the map
self.lastFilePath = ''
# Set up the controls
self.classNameLine = QtGui.QLineEdit("Class name", self)
self.addClassButton = QtGui.QPushButton('Add New Class', self)
self.deleteClassButton = QtGui.QPushButton('Delete Class', self)
self.saveButton = QtGui.QPushButton('Save Class File', self)
self.loadButton = QtGui.QPushButton('Load Class File', self)
self.undoButton = QtGui.QPushButton('Undo Last Point', self)
self.deselectButton = QtGui.QPushButton('Deselect Class', self)
self.classListBox = QtGui.QListWidget()
self.addClassButton.clicked.connect(self._addClass)
self.deleteClassButton.clicked.connect(self._deleteClass)
self.saveButton.clicked.connect(self._saveToFile)
self.loadButton.clicked.connect(self._loadFromFile)
self.undoButton.clicked.connect(self._undoPoint)
self.deselectButton.clicked.connect(self._deselectList)
self.classListBox.itemClicked.connect(self._setCurrentClass)
# Lay everything out
vbox = QtGui.QVBoxLayout(self)
vbox.addWidget(self.loadButton)
vbox.addWidget(self.saveButton)
vbox.addWidget(self.classListBox)
vbox.addWidget(self.deselectButton)
vbox.addWidget(self.classNameLine)
vbox.addWidget(self.addClassButton)
vbox.addWidget(self.deleteClassButton)
vbox.addWidget(self.undoButton)
vbox.addStretch(1)
self.setLayout(vbox)