Python PyQt4.QtGui.QListWidget() Examples

The following are 13 code examples of PyQt4.QtGui.QListWidget(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt4.QtGui , or try the search function .
Example #1
Source File: pyqt_ui.py    From pyusb-keyboard-alike with MIT License 6 votes vote down vote up
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) 
Example #2
Source File: ui_trezor_chooser_dialog.py    From deosorg with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #3
Source File: exportDialogTemplate_pyqt.py    From tf-pose with Apache License 2.0 5 votes vote down vote up
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) 
Example #4
Source File: main.py    From openairplay with MIT License 5 votes vote down vote up
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) 
Example #5
Source File: recipe-578634.py    From code with MIT License 5 votes vote down vote up
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) 
Example #6
Source File: container_loader.py    From stdm with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #7
Source File: gui.py    From ropa with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #8
Source File: exportDialogTemplate_pyqt.py    From soapy with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #9
Source File: exportDialogTemplate_pyqt.py    From qgisSpaceSyntaxToolkit with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #10
Source File: guiChatQQ.py    From PyLinuxQQ with GNU General Public License v2.0 5 votes vote down vote up
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={} 
Example #11
Source File: guiChatQQ.py    From PyLinuxQQ with GNU General Public License v2.0 5 votes vote down vote up
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' 
Example #12
Source File: institution.py    From certificate_generator with GNU General Public License v3.0 4 votes vote down vote up
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) 
Example #13
Source File: production_gui.py    From CrisisMappingToolkit with Apache License 2.0 4 votes vote down vote up
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)