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
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)
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
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
def addWidget(self, widget): item = QListWidgetItem(self) item.setSizeHint(widget.sizeHint()) super(ItemWidgetsList, self).addItem(item)