def constructAndAddElementEditor(self, index): elementEditor = self.constructElementEditor(index) row = index column = 0 if self._displayIndex: self._grid.addWidget(QtWidgets.QLabel(str(index), self), row, column, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) column += 1 if elementEditor is not None: self._grid.addWidget(elementEditor, row, column) column += 1 if self.isEditable() and self._enableRemoveElements and not self._constSizeArray: self.removeElementButton = QtWidgets.QPushButton(self._removeElementButtonLabel, self) def removeElement(): undoManager = UndoRedoManager.getInstance() undoManager.openBracket("Remove element from :" + self.getName()) self.removeElement(index) self._setValueToController() undoManager.closeBracket() self.rebuild() self.removeElementButton.clicked.connect(removeElement) self._grid.addWidget(self.removeElementButton, row, column) if elementEditor is not None: self._editors.append(elementEditor)
def addValueEditor(self, name, widget): # widget.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) label = QtWidgets.QLabel(name, self) # label.setMaximumWidth(200) # label.setContentsMargins(0, 5, 0, 0) # label.setMinimumWidth(60) # label.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) # label.setAlignment(QtCore.Qt.AlignRight) # label.adjustSize() rowSpan = widget.getRowSpan() columnSpan = widget.getColumnSpan() # if columnSpan==1: self._grid.addWidget(label, self._gridRow, 0, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) self._grid.addWidget(widget, self._gridRow, 1) #, QtCore.Qt.AlignLeft) self._gridRow += 1 # else: # self._grid.addWidget(label, self._gridRow, 0, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) # self._grid.addWidget(widget, self._gridRow+1, 0, rowSpan, columnSpan) # self._gridRow += 2 self._labels[name] = label self._editors[name] = widget
def defineLineEditSubEditor(name): label = QtWidgets.QLabel(name, self) hbox.addWidget(label) widget = LineEdit(self) validator = QtGui.QDoubleValidator(self) validator.setDecimals(2) widget.setValidator(validator) hbox.addWidget(widget, 1) self.__editors.append(widget) return widget
def createLayout(self): self._mainLayout = QtWidgets.QVBoxLayout() self._mainLayout.setContentsMargins(10, 10, 10, 10) self._commentTextEdit = QtWidgets.QTextEdit(self) self._commentTextEdit.setText(self.nodeItem.getComment()) self._commentTextEdit.setMinimumHeight(20) self._commentTextEdit.setMaximumHeight(40) self._settingsLayout = QtWidgets.QGridLayout() self._settingsLayout.setContentsMargins(10, 10, 10, 10) self._settingsLayout.setSpacing(3) self._settingsLayout.setColumnMinimumWidth(0, 75) self._settingsLayout.setColumnStretch(0, 0) self._settingsLayout.setColumnStretch(1, 1) # Settings widgets self._colorLabel = QtWidgets.QLabel('Color', self) self._colorLabel.setObjectName('color_label') self._colorLabel.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed) self._colorLabel.setMinimumWidth(75) self._colorWidget = KColorWidget(self, self.nodeItem.getColor()) self._settingsLayout.addWidget(self._colorLabel, 0, 0, 1, 1, alignment=QtCore.Qt.AlignLeft) self._settingsLayout.addWidget(self._colorWidget, 0, 1, 1, 1, alignment=QtCore.Qt.AlignLeft) # OK and Cancel buttons self.buttons = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) self._mainLayout.addWidget(self._commentTextEdit) self._mainLayout.addLayout(self._settingsLayout) self._mainLayout.addStretch(1) self._mainLayout.addWidget(self.buttons) self.setLayout(self._mainLayout)
def addSeparator(self, name=None): separatorEditor = QtWidgets.QFrame(self.paramsGroup) separatorEditor.setFrameShape(QtWidgets.QFrame.HLine) separatorEditor.setObjectName('separatorFrame') if name is not None: labelEditor = QtWidgets.QLabel(name, self.paramsGroup) labelEditor.setObjectName('separatorLabel') self.paramsLayout.addWidget(labelEditor, self.gridRow, 0) self.paramsLayout.addWidget(separatorEditor, self.gridRow, 1, QtCore.Qt.AlignBottom) self.gridRow += 1 else: self.paramsLayout.addWidget(separatorEditor, self.gridRow, 0, 1, 2) self.gridRow += 1
def __init__(self, componentInput, pos, parent): super(EditIndexWidget, self).__init__(parent) self.setObjectName('editIndexWidget') self.componentInput = componentInput self.setWindowTitle("Edit " + self.componentInput.getName() + " Index") self.setWindowFlags(QtCore.Qt.Window) self.setFixedSize(150, 60) self.editLabel = QtWidgets.QLabel('Array Index') self.spinBoxWidget = IndexSpinBox(self) self.spinBoxWidget.setMinimum(0) self.spinBoxWidget.setValue(self.componentInput.getIndex()) self.spinBoxWidget.valueChanged.connect(self.__setIndex) grid = QtWidgets.QVBoxLayout(self) grid.addWidget(self.editLabel, 0) grid.addWidget(self.spinBoxWidget, 0) self.move(pos) self.show() self.spinBoxWidget.setFocus()
def addEditor(self, name, widget, columnSpan=1): label = None widgetColumn = 0 if name != None: label = QtWidgets.QLabel(name, self.paramsGroup) label.setContentsMargins(0, 5, 0, 0) self.paramsLayout.addWidget( label, self.gridRow, 0, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) self.gridRow += 1 widgetColumn = 1 if widget is not None: if columnSpan == 1: self.paramsLayout.addWidget(widget, self.gridRow - 1, widgetColumn) else: self.paramsLayout.addWidget(widget, self.gridRow, 0, 1, columnSpan) self.gridRow += 1 self.widgets.append(widget)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(286, 527) self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.mainSettings_groupBox = QtWidgets.QGroupBox(Form) self.mainSettings_groupBox.setTitle("") self.mainSettings_groupBox.setObjectName("mainSettings_groupBox") self.gridLayout_4 = QtWidgets.QGridLayout(self.mainSettings_groupBox) self.gridLayout_4.setObjectName("gridLayout_4") self.formLayout = QtWidgets.QFormLayout() self.formLayout.setObjectName("formLayout") self.name_label = QtWidgets.QLabel(self.mainSettings_groupBox) self.name_label.setObjectName("name_label") self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.name_label) self.name_lineEdit = QtWidgets.QLineEdit(self.mainSettings_groupBox) self.name_lineEdit.setObjectName("name_lineEdit") self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.name_lineEdit) self.side_label = QtWidgets.QLabel(self.mainSettings_groupBox) self.side_label.setObjectName("side_label") self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.side_label) self.side_comboBox = QtWidgets.QComboBox(self.mainSettings_groupBox) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.side_comboBox.sizePolicy().hasHeightForWidth()) self.side_comboBox.setSizePolicy(sizePolicy) self.side_comboBox.setObjectName("side_comboBox") self.side_comboBox.addItem("") self.side_comboBox.addItem("") self.side_comboBox.addItem("") self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.side_comboBox) self.componentIndex_label = QtWidgets.QLabel( self.mainSettings_groupBox) self.componentIndex_label.setObjectName("componentIndex_label") self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.componentIndex_label) self.componentIndex_spinBox = QtWidgets.QSpinBox( self.mainSettings_groupBox) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.componentIndex_spinBox.sizePolicy().hasHeightForWidth()) self.componentIndex_spinBox.setSizePolicy(sizePolicy) self.componentIndex_spinBox.setObjectName("componentIndex_spinBox") self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.componentIndex_spinBox) self.conector_label = QtWidgets.QLabel(self.mainSettings_groupBox) self.conector_label.setObjectName("conector_label") self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.conector_label) self.connector_comboBox = QtWidgets.QComboBox( self.mainSettings_groupBox) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.connector_comboBox.sizePolicy().hasHeightForWidth()) self.connector_comboBox.setSizePolicy(sizePolicy) self.connector_comboBox.setObjectName("connector_comboBox") self.connector_comboBox.addItem("") self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.connector_comboBox) self.gridLayout_4.addLayout(self.formLayout, 0, 0, 1, 1) self.gridLayout.addWidget(self.mainSettings_groupBox, 0, 0, 1, 1) self.groupBox = QtWidgets.QGroupBox(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.groupBox.sizePolicy().hasHeightForWidth()) self.groupBox.setSizePolicy(sizePolicy) self.groupBox.setObjectName("groupBox") self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox) self.gridLayout_2.setObjectName("gridLayout_2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.host_label = QtWidgets.QLabel(self.groupBox) self.host_label.setObjectName("host_label") self.horizontalLayout_2.addWidget(self.host_label) self.host_lineEdit = QtWidgets.QLineEdit(self.groupBox) self.host_lineEdit.setObjectName("host_lineEdit") self.horizontalLayout_2.addWidget(self.host_lineEdit) self.host_pushButton = QtWidgets.QPushButton(self.groupBox) self.host_pushButton.setObjectName("host_pushButton") self.horizontalLayout_2.addWidget(self.host_pushButton) self.gridLayout_2.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 1) self.jointConnexionSettings_groupBox = QtWidgets.QGroupBox(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.jointConnexionSettings_groupBox. sizePolicy().hasHeightForWidth()) self.jointConnexionSettings_groupBox.setSizePolicy(sizePolicy) self.jointConnexionSettings_groupBox.setObjectName( "jointConnexionSettings_groupBox") self.gridLayout_3 = QtWidgets.QGridLayout( self.jointConnexionSettings_groupBox) self.gridLayout_3.setObjectName("gridLayout_3") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.useJointIndex_checkBox = QtWidgets.QCheckBox( self.jointConnexionSettings_groupBox) self.useJointIndex_checkBox.setObjectName("useJointIndex_checkBox") self.verticalLayout.addWidget(self.useJointIndex_checkBox) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.parentJointIndex_label = QtWidgets.QLabel( self.jointConnexionSettings_groupBox) self.parentJointIndex_label.setObjectName("parentJointIndex_label") self.horizontalLayout.addWidget(self.parentJointIndex_label) self.parentJointIndex_spinBox = QtWidgets.QSpinBox( self.jointConnexionSettings_groupBox) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.parentJointIndex_spinBox.sizePolicy().hasHeightForWidth()) self.parentJointIndex_spinBox.setSizePolicy(sizePolicy) self.parentJointIndex_spinBox.setMinimum(-1) self.parentJointIndex_spinBox.setMaximum(999999) self.parentJointIndex_spinBox.setProperty("value", -1) self.parentJointIndex_spinBox.setObjectName("parentJointIndex_spinBox") self.horizontalLayout.addWidget(self.parentJointIndex_spinBox) self.verticalLayout.addLayout(self.horizontalLayout) self.gridLayout_3.addLayout(self.verticalLayout, 0, 0, 1, 1) self.gridLayout.addWidget(self.jointConnexionSettings_groupBox, 1, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 4, 0, 1, 1) self.groupBox_2 = QtWidgets.QGroupBox(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.groupBox_2.sizePolicy().hasHeightForWidth()) self.groupBox_2.setSizePolicy(sizePolicy) self.groupBox_2.setObjectName("groupBox_2") self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_2) self.gridLayout_5.setObjectName("gridLayout_5") self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.subGroup_lineEdit = QtWidgets.QLineEdit(self.groupBox_2) self.subGroup_lineEdit.setObjectName("subGroup_lineEdit") self.horizontalLayout_3.addWidget(self.subGroup_lineEdit) self.gridLayout_5.addLayout(self.horizontalLayout_3, 0, 0, 1, 1) self.gridLayout.addWidget(self.groupBox_2, 3, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def __init__(self, valueController, parent=None): super(Image2DEditor, self).__init__(valueController, parent=parent) self._grid = QtWidgets.QGridLayout() self._grid.setContentsMargins(0, 0, 0, 0) self.__value = self._invokeGetter() # format formatLabelEditor = QtWidgets.QLabel("format", self) formatLabelEditor.setMinimumWidth(20) self._formatEditor = QtWidgets.QLineEdit(self) self._formatEditor.setText(self.__value.pixelFormat) self._formatEditor.setReadOnly(True) self._grid.addWidget(formatLabelEditor, 0, 0, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) self._grid.addWidget(self._formatEditor, 0, 1) # width widthLabelEditor = QtWidgets.QLabel("width", self) widthLabelEditor.setMinimumWidth(20) self._widthEditor = QtWidgets.QSpinBox(self) self._widthEditor.setMinimum(0) self._widthEditor.setMaximum(9999999) self._widthEditor.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) self._widthEditor.setValue(self.__value.width) self._widthEditor.setReadOnly(True) self._grid.addWidget(widthLabelEditor, 1, 0, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) self._grid.addWidget(self._widthEditor, 1, 1) # height heightLabelEditor = QtWidgets.QLabel("height", self) heightLabelEditor.setMinimumWidth(20) self._heightEditor = QtWidgets.QSpinBox(self) self._heightEditor.setMinimum(0) self._heightEditor.setMaximum(9999999) self._heightEditor.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) self._heightEditor.setValue(self.__value.height) self._heightEditor.setReadOnly(True) self._grid.addWidget(heightLabelEditor, 2, 0, QtCore.Qt.AlignRight | QtCore.Qt.AlignTop) self._grid.addWidget(self._heightEditor, 2, 1) self._thumbnailSize = 40 self.tumbnailEditor = QtWidgets.QLabel() self.tumbnailEditor.setBackgroundRole(QtGui.QPalette.Base) self.tumbnailEditor.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) self.tumbnailEditor.setScaledContents(True) self._updateThumbnail() self.setLayout(self._grid) self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(459, 809) self.gridLayout_2 = QtWidgets.QGridLayout(Form) self.gridLayout_2.setObjectName("gridLayout_2") self.groupBox_5 = QtWidgets.QGroupBox(Form) self.groupBox_5.setObjectName("groupBox_5") self.gridLayout_7 = QtWidgets.QGridLayout(self.groupBox_5) self.gridLayout_7.setObjectName("gridLayout_7") self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.label = QtWidgets.QLabel(self.groupBox_5) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.label_2 = QtWidgets.QLabel(self.groupBox_5) self.label_2.setAlignment(QtCore.Qt.AlignCenter) self.label_2.setObjectName("label_2") self.gridLayout.addWidget(self.label_2, 0, 1, 1, 1) self.label_3 = QtWidgets.QLabel(self.groupBox_5) self.label_3.setAlignment(QtCore.Qt.AlignCenter) self.label_3.setObjectName("label_3") self.gridLayout.addWidget(self.label_3, 0, 2, 1, 1) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.L_color_fk_label = QtWidgets.QLabel(self.groupBox_5) self.L_color_fk_label.setObjectName("L_color_fk_label") self.horizontalLayout_3.addWidget(self.L_color_fk_label) self.L_color_fk_spinBox = QtWidgets.QSpinBox(self.groupBox_5) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.L_color_fk_spinBox.sizePolicy().hasHeightForWidth()) self.L_color_fk_spinBox.setSizePolicy(sizePolicy) self.L_color_fk_spinBox.setMaximum(31) self.L_color_fk_spinBox.setObjectName("L_color_fk_spinBox") self.horizontalLayout_3.addWidget(self.L_color_fk_spinBox) self.gridLayout.addLayout(self.horizontalLayout_3, 1, 0, 1, 1) self.horizontalLayout_7 = QtWidgets.QHBoxLayout() self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.L_color_fk_label_5 = QtWidgets.QLabel(self.groupBox_5) self.L_color_fk_label_5.setObjectName("L_color_fk_label_5") self.horizontalLayout_7.addWidget(self.L_color_fk_label_5) self.C_color_fk_spinBox = QtWidgets.QSpinBox(self.groupBox_5) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.C_color_fk_spinBox.sizePolicy().hasHeightForWidth()) self.C_color_fk_spinBox.setSizePolicy(sizePolicy) self.C_color_fk_spinBox.setMaximum(31) self.C_color_fk_spinBox.setObjectName("C_color_fk_spinBox") self.horizontalLayout_7.addWidget(self.C_color_fk_spinBox) self.gridLayout.addLayout(self.horizontalLayout_7, 1, 1, 1, 1) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.L_color_fk_label_3 = QtWidgets.QLabel(self.groupBox_5) self.L_color_fk_label_3.setObjectName("L_color_fk_label_3") self.horizontalLayout_5.addWidget(self.L_color_fk_label_3) self.R_color_fk_spinBox = QtWidgets.QSpinBox(self.groupBox_5) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.R_color_fk_spinBox.sizePolicy().hasHeightForWidth()) self.R_color_fk_spinBox.setSizePolicy(sizePolicy) self.R_color_fk_spinBox.setMaximum(31) self.R_color_fk_spinBox.setObjectName("R_color_fk_spinBox") self.horizontalLayout_5.addWidget(self.R_color_fk_spinBox) self.gridLayout.addLayout(self.horizontalLayout_5, 1, 2, 1, 1) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.L_color_fk_label_2 = QtWidgets.QLabel(self.groupBox_5) self.L_color_fk_label_2.setObjectName("L_color_fk_label_2") self.horizontalLayout_4.addWidget(self.L_color_fk_label_2) self.L_color_ik_spinBox = QtWidgets.QSpinBox(self.groupBox_5) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.L_color_ik_spinBox.sizePolicy().hasHeightForWidth()) self.L_color_ik_spinBox.setSizePolicy(sizePolicy) self.L_color_ik_spinBox.setMaximum(31) self.L_color_ik_spinBox.setObjectName("L_color_ik_spinBox") self.horizontalLayout_4.addWidget(self.L_color_ik_spinBox) self.gridLayout.addLayout(self.horizontalLayout_4, 2, 0, 1, 1) self.horizontalLayout_8 = QtWidgets.QHBoxLayout() self.horizontalLayout_8.setObjectName("horizontalLayout_8") self.L_color_fk_label_6 = QtWidgets.QLabel(self.groupBox_5) self.L_color_fk_label_6.setObjectName("L_color_fk_label_6") self.horizontalLayout_8.addWidget(self.L_color_fk_label_6) self.C_color_ik_spinBox = QtWidgets.QSpinBox(self.groupBox_5) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.C_color_ik_spinBox.sizePolicy().hasHeightForWidth()) self.C_color_ik_spinBox.setSizePolicy(sizePolicy) self.C_color_ik_spinBox.setMaximum(31) self.C_color_ik_spinBox.setObjectName("C_color_ik_spinBox") self.horizontalLayout_8.addWidget(self.C_color_ik_spinBox) self.gridLayout.addLayout(self.horizontalLayout_8, 2, 1, 1, 1) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.L_color_fk_label_4 = QtWidgets.QLabel(self.groupBox_5) self.L_color_fk_label_4.setObjectName("L_color_fk_label_4") self.horizontalLayout_6.addWidget(self.L_color_fk_label_4) self.R_color_ik_spinBox = QtWidgets.QSpinBox(self.groupBox_5) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.R_color_ik_spinBox.sizePolicy().hasHeightForWidth()) self.R_color_ik_spinBox.setSizePolicy(sizePolicy) self.R_color_ik_spinBox.setMaximum(31) self.R_color_ik_spinBox.setObjectName("R_color_ik_spinBox") self.horizontalLayout_6.addWidget(self.R_color_ik_spinBox) self.gridLayout.addLayout(self.horizontalLayout_6, 2, 2, 1, 1) self.gridLayout_7.addLayout(self.gridLayout, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox_5, 6, 0, 1, 1) self.groupBox = QtWidgets.QGroupBox(Form) self.groupBox.setObjectName("groupBox") self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox) self.gridLayout_3.setObjectName("gridLayout_3") self.formLayout = QtWidgets.QFormLayout() self.formLayout.setObjectName("formLayout") self.rigName_label = QtWidgets.QLabel(self.groupBox) self.rigName_label.setObjectName("rigName_label") self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.rigName_label) self.rigName_lineEdit = QtWidgets.QLineEdit(self.groupBox) self.rigName_lineEdit.setObjectName("rigName_lineEdit") self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.rigName_lineEdit) self.mode_label = QtWidgets.QLabel(self.groupBox) self.mode_label.setObjectName("mode_label") self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.mode_label) self.mode_comboBox = QtWidgets.QComboBox(self.groupBox) self.mode_comboBox.setObjectName("mode_comboBox") self.mode_comboBox.addItem("") self.mode_comboBox.addItem("") self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.mode_comboBox) self.step_label = QtWidgets.QLabel(self.groupBox) self.step_label.setObjectName("step_label") self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.step_label) self.step_comboBox = QtWidgets.QComboBox(self.groupBox) self.step_comboBox.setObjectName("step_comboBox") self.step_comboBox.addItem("") self.step_comboBox.addItem("") self.step_comboBox.addItem("") self.step_comboBox.addItem("") self.step_comboBox.addItem("") self.step_comboBox.addItem("") self.step_comboBox.addItem("") self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.step_comboBox) self.gridLayout_3.addLayout(self.formLayout, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox, 0, 0, 1, 1) self.groupBox_2 = QtWidgets.QGroupBox(Form) self.groupBox_2.setObjectName("groupBox_2") self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_2) self.gridLayout_4.setObjectName("gridLayout_4") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.importSkin_checkBox = QtWidgets.QCheckBox(self.groupBox_2) self.importSkin_checkBox.setObjectName("importSkin_checkBox") self.verticalLayout.addWidget(self.importSkin_checkBox) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.skin_label = QtWidgets.QLabel(self.groupBox_2) self.skin_label.setObjectName("skin_label") self.horizontalLayout.addWidget(self.skin_label) self.skin_lineEdit = QtWidgets.QLineEdit(self.groupBox_2) self.skin_lineEdit.setObjectName("skin_lineEdit") self.horizontalLayout.addWidget(self.skin_lineEdit) self.loadSkinPath_pushButton = QtWidgets.QPushButton(self.groupBox_2) self.loadSkinPath_pushButton.setObjectName("loadSkinPath_pushButton") self.horizontalLayout.addWidget(self.loadSkinPath_pushButton) self.verticalLayout.addLayout(self.horizontalLayout) self.gridLayout_4.addLayout(self.verticalLayout, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox_2, 3, 0, 1, 1) self.groupBox_4 = QtWidgets.QGroupBox(Form) self.groupBox_4.setObjectName("groupBox_4") self.gridLayout_6 = QtWidgets.QGridLayout(self.groupBox_4) self.gridLayout_6.setObjectName("gridLayout_6") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.rigTabs_label = QtWidgets.QLabel(self.groupBox_4) self.rigTabs_label.setObjectName("rigTabs_label") self.verticalLayout_3.addWidget(self.rigTabs_label) self.rigTabs_listWidget = QtWidgets.QListWidget(self.groupBox_4) self.rigTabs_listWidget.setDragDropOverwriteMode(True) self.rigTabs_listWidget.setDragDropMode( QtWidgets.QAbstractItemView.InternalMove) self.rigTabs_listWidget.setDefaultDropAction(QtCore.Qt.MoveAction) self.rigTabs_listWidget.setAlternatingRowColors(True) self.rigTabs_listWidget.setSelectionMode( QtWidgets.QAbstractItemView.ExtendedSelection) self.rigTabs_listWidget.setSelectionRectVisible(False) self.rigTabs_listWidget.setObjectName("rigTabs_listWidget") self.verticalLayout_3.addWidget(self.rigTabs_listWidget) self.horizontalLayout_2.addLayout(self.verticalLayout_3) self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) self.verticalLayout_4.setObjectName("verticalLayout_4") spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_4.addItem(spacerItem) self.addTab_pushButton = QtWidgets.QPushButton(self.groupBox_4) self.addTab_pushButton.setObjectName("addTab_pushButton") self.verticalLayout_4.addWidget(self.addTab_pushButton) self.removeTab_pushButton = QtWidgets.QPushButton(self.groupBox_4) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.removeTab_pushButton.sizePolicy().hasHeightForWidth()) self.removeTab_pushButton.setSizePolicy(sizePolicy) self.removeTab_pushButton.setObjectName("removeTab_pushButton") self.verticalLayout_4.addWidget(self.removeTab_pushButton) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_4.addItem(spacerItem1) self.horizontalLayout_2.addLayout(self.verticalLayout_4) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.available_label = QtWidgets.QLabel(self.groupBox_4) self.available_label.setObjectName("available_label") self.verticalLayout_2.addWidget(self.available_label) self.available_listWidget = QtWidgets.QListWidget(self.groupBox_4) self.available_listWidget.setDragDropOverwriteMode(True) self.available_listWidget.setDragDropMode( QtWidgets.QAbstractItemView.NoDragDrop) self.available_listWidget.setDefaultDropAction(QtCore.Qt.IgnoreAction) self.available_listWidget.setAlternatingRowColors(True) self.available_listWidget.setSelectionMode( QtWidgets.QAbstractItemView.ExtendedSelection) self.available_listWidget.setSelectionRectVisible(False) self.available_listWidget.setObjectName("available_listWidget") self.verticalLayout_2.addWidget(self.available_listWidget) self.horizontalLayout_2.addLayout(self.verticalLayout_2) self.gridLayout_6.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox_4, 5, 0, 1, 1) self.groupBox_3 = QtWidgets.QGroupBox(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.groupBox_3.sizePolicy().hasHeightForWidth()) self.groupBox_3.setSizePolicy(sizePolicy) self.groupBox_3.setObjectName("groupBox_3") self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_3) self.gridLayout_5.setObjectName("gridLayout_5") self.jointRig_checkBox = QtWidgets.QCheckBox(self.groupBox_3) self.jointRig_checkBox.setObjectName("jointRig_checkBox") self.gridLayout_5.addWidget(self.jointRig_checkBox, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox_3, 4, 0, 1, 1) self.groupBox_6 = QtWidgets.QGroupBox(Form) self.groupBox_6.setObjectName("groupBox_6") self.gridLayout_8 = QtWidgets.QGridLayout(self.groupBox_6) self.gridLayout_8.setObjectName("gridLayout_8") self.proxyChannels_checkBox = QtWidgets.QCheckBox(self.groupBox_6) self.proxyChannels_checkBox.setObjectName("proxyChannels_checkBox") self.gridLayout_8.addWidget(self.proxyChannels_checkBox, 0, 0, 1, 1) self.classicChannelNames_checkBox = QtWidgets.QCheckBox( self.groupBox_6) self.classicChannelNames_checkBox.setObjectName( "classicChannelNames_checkBox") self.gridLayout_8.addWidget(self.classicChannelNames_checkBox, 1, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox_6, 1, 0, 1, 1) self.groupBox_7 = QtWidgets.QGroupBox(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.groupBox_7.sizePolicy().hasHeightForWidth()) self.groupBox_7.setSizePolicy(sizePolicy) self.groupBox_7.setObjectName("groupBox_7") self.gridLayout_9 = QtWidgets.QGridLayout(self.groupBox_7) self.gridLayout_9.setObjectName("gridLayout_9") self.worldCtl_checkBox = QtWidgets.QCheckBox(self.groupBox_7) self.worldCtl_checkBox.setObjectName("worldCtl_checkBox") self.gridLayout_9.addWidget(self.worldCtl_checkBox, 0, 0, 1, 1) self.gridLayout_2.addWidget(self.groupBox_7, 2, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def __init__(self, valueController, parent=None): super(ArrayEditor, self).__init__(valueController, parent=parent) self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding) self._enableAddElements = True #valueController.getOption('enableAddElements', valueController.getOption('enableAddRemoveElements', True)) self._enableRemoveElements = True #valueController.getOption('enableRemoveElements', valueController.getOption('enableAddRemoveElements', True)) self._addElementButtonLabel = 'add' #valueController.getOption('addElementButtonLabel', 'add') self._removeElementButtonLabel = 'remove' #valueController.getOption('removeElementButtonLabel', 'remove') self._displayGroupBox = False #self._valueController.getOption('displayArrayLimit', True) self._displayIndex = False #self._valueController.getOption('displayArrayLimit', True) self._displayArrayLimit = False #self._valueController.getOption('displayArrayLimit', True) self._displayNumElements = False #self._valueController.getOption('displayNumElements', True) self._arrayLimit = 3 #self._valueController.getOption('arrayLimit', 3) self._dataType = valueController.getDataType() self._valueArray = self._invokeGetter() self.determineElementType() vbox = QtWidgets.QVBoxLayout() if self._displayArrayLimit or self._displayNumElements: topToolbar = QtWidgets.QWidget(self) topToolbarLayout = QtWidgets.QHBoxLayout() topToolbar.setLayout(topToolbarLayout) vbox.addWidget(topToolbar, 0) if self._displayNumElements: topToolbarLayout.addWidget(QtWidgets.QLabel('Num Elements:'+str(len(self._valueArray)), self)) if self._displayArrayLimit: # display a widget to enable setting the maximum number of displayed elements. label = QtWidgets.QLabel('Max Displayed elements:', self) # label.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) topToolbarLayout.addWidget(label, 0) spinBox = QtWidgets.QSpinBox(self) spinBox.setMinimum(0) spinBox.setMaximum(100) # spinBox.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) spinBox.setValue(self._arrayLimit) def setArrayLimit(value): self._arrayLimit = value self.rebuild() spinBox.valueChanged.connect(setArrayLimit) topToolbarLayout.addWidget(spinBox, 0) topToolbarLayout.addStretch(1) self._grid = QtWidgets.QGridLayout() self._grid.setContentsMargins(0, 0, 0, 0) widget = QtWidgets.QWidget(self) widget.setLayout(self._grid) vbox.addWidget(widget) if self._displayGroupBox: groupBox = QtWidgets.QGroupBox(self._valueController.getDataType()) groupBox.setLayout(vbox) groupBox.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) groupBoxLayout = QtWidgets.QVBoxLayout() groupBoxLayout.addWidget(groupBox, 0) self.setLayout(groupBoxLayout) else: self.setLayout(vbox) self.build() if self._elementValueType == 'String': self.setAcceptDrops(self.isEditable())
def setupUi(self, gameTools): gameTools.setObjectName("gameTools") gameTools.resize(284, 332) self.gridLayout_4 = QtWidgets.QGridLayout(gameTools) self.gridLayout_4.setObjectName("gridLayout_4") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.gameTools_groupBox = QtWidgets.QGroupBox(gameTools) self.gameTools_groupBox.setObjectName("gameTools_groupBox") self.gridLayout_2 = QtWidgets.QGridLayout(self.gameTools_groupBox) self.gridLayout_2.setObjectName("gridLayout_2") self.assetName_frame = QtWidgets.QFrame(self.gameTools_groupBox) self.assetName_frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.assetName_frame.setFrameShadow(QtWidgets.QFrame.Raised) self.assetName_frame.setObjectName("assetName_frame") self.gridLayout = QtWidgets.QGridLayout(self.assetName_frame) self.gridLayout.setObjectName("gridLayout") self.assetName_lineEdit = QtWidgets.QLineEdit(self.assetName_frame) self.assetName_lineEdit.setObjectName("assetName_lineEdit") self.gridLayout.addWidget(self.assetName_lineEdit, 0, 2, 1, 1) self.assetName_label = QtWidgets.QLabel(self.assetName_frame) self.assetName_label.setObjectName("assetName_label") self.gridLayout.addWidget(self.assetName_label, 0, 1, 1, 1) self.gridLayout_2.addWidget(self.assetName_frame, 0, 0, 1, 2) self.rigNode_lineEdit = QtWidgets.QLineEdit(self.gameTools_groupBox) self.rigNode_lineEdit.setObjectName("rigNode_lineEdit") self.gridLayout_2.addWidget(self.rigNode_lineEdit, 1, 0, 1, 1) self.rigNode_pushButton = QtWidgets.QPushButton( self.gameTools_groupBox) self.rigNode_pushButton.setObjectName("rigNode_pushButton") self.gridLayout_2.addWidget(self.rigNode_pushButton, 1, 1, 1, 1) self.meshNode_lineEdit = QtWidgets.QLineEdit(self.gameTools_groupBox) self.meshNode_lineEdit.setObjectName("meshNode_lineEdit") self.gridLayout_2.addWidget(self.meshNode_lineEdit, 2, 0, 1, 1) self.meshNode_pushButton = QtWidgets.QPushButton( self.gameTools_groupBox) self.meshNode_pushButton.setObjectName("meshNode_pushButton") self.gridLayout_2.addWidget(self.meshNode_pushButton, 2, 1, 1, 1) self.path_lineEdit = QtWidgets.QLineEdit(self.gameTools_groupBox) self.path_lineEdit.setObjectName("path_lineEdit") self.gridLayout_2.addWidget(self.path_lineEdit, 3, 0, 1, 1) self.path_pushButton = QtWidgets.QPushButton(self.gameTools_groupBox) self.path_pushButton.setObjectName("path_pushButton") self.gridLayout_2.addWidget(self.path_pushButton, 3, 1, 1, 1) self.script_lineEdit = QtWidgets.QLineEdit(self.gameTools_groupBox) self.script_lineEdit.setObjectName("script_lineEdit") self.gridLayout_2.addWidget(self.script_lineEdit, 4, 0, 1, 1) self.script_pushButton = QtWidgets.QPushButton(self.gameTools_groupBox) self.script_pushButton.setObjectName("script_pushButton") self.gridLayout_2.addWidget(self.script_pushButton, 4, 1, 1, 1) self.disconnectExport_pushButton = QtWidgets.QPushButton( self.gameTools_groupBox) self.disconnectExport_pushButton.setObjectName( "disconnectExport_pushButton") self.gridLayout_2.addWidget(self.disconnectExport_pushButton, 5, 0, 1, 2) self.verticalLayout.addWidget(self.gameTools_groupBox) self.assembly_groupBox = QtWidgets.QGroupBox(gameTools) self.assembly_groupBox.setObjectName("assembly_groupBox") self.gridLayout_3 = QtWidgets.QGridLayout(self.assembly_groupBox) self.gridLayout_3.setObjectName("gridLayout_3") self.importConnect_pushButton = QtWidgets.QPushButton( self.assembly_groupBox) self.importConnect_pushButton.setObjectName("importConnect_pushButton") self.gridLayout_3.addWidget(self.importConnect_pushButton, 0, 0, 1, 1) self.referenceConnect_pushButton = QtWidgets.QPushButton( self.assembly_groupBox) self.referenceConnect_pushButton.setObjectName( "referenceConnect_pushButton") self.gridLayout_3.addWidget(self.referenceConnect_pushButton, 1, 0, 1, 1) self.verticalLayout.addWidget(self.assembly_groupBox) self.gridLayout_4.addLayout(self.verticalLayout, 0, 0, 1, 1) self.retranslateUi(gameTools) QtCore.QMetaObject.connectSlotsByName(gameTools)