コード例 #1
0
    def createVariable(self, uid=None):
        if uid == False:
            uid = uuid4()

        var = VariableBase(self.graph.getUniqVarName('NewVar'), 0, self.graph, self, DataTypes.Float, uid=uid)
        item = QListWidgetItem(self.listWidget)
        item.setSizeHint(QtCore.QSize(60, 38))        
        self.listWidget.setItemWidget(item, var)
        return var
コード例 #2
0
 def refresh(self, directories):
     directories = python.force_list(directories)
     self.clear()
     for diretory_found in directories:
         name = diretory_found
         if not path_utils.is_dir(diretory_found):
             name = 'Directory Not Valid! {}'.format(diretory_found)
         item = QListWidgetItem()
         item.setText(name)
         item.setSizeHint(QSize(20, 25))
         self.addItem(item)
コード例 #3
0
ファイル: CodeEditor.py プロジェクト: ruchitinfushion/PyFlow
 def appendOutput(self, pw):
     item = QListWidgetItem(self.lwOutputs)
     item.setSizeHint(QtCore.QSize(pw.sizeHint().width(), 80))
     self.lwOutputs.addItem(item)
     self.lwOutputs.setItemWidget(item, pw)
     del item
コード例 #4
0
 def createVariableWrapperAndAddToList(self, rawVariable):
     uiVariable = UIVariable(rawVariable, self)
     item = QListWidgetItem(self.listWidget)
     item.setSizeHint(QtCore.QSize(60, 20))
     self.listWidget.setItemWidget(item, uiVariable)
     return uiVariable
コード例 #5
0
    def addWidget(self, widget):

        item = QListWidgetItem(self)
        item.setSizeHint(widget.sizeHint())
        super(ItemWidgetsList, self).addItem(item)