Beispiel #1
0
    def ch_setupUI(self):
        layout = QtGui.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)

        self.ch_box = utils.TitledBox(title='Character', settings=1)

        nameLayout = QtGui.QHBoxLayout()
        nameLabel = QtGui.QLabel('Character name')
        nameLabel.setMaximumWidth(80)
        self.charNameCombo = QtGui.QComboBox()
        self.charNameCombo.setEditable(1)
        self.ch_nameBtn = QtGui.QPushButton('Create character')

        nameLayout.addWidget(nameLabel)
        nameLayout.addWidget(self.charNameCombo)

        self.characterSettingWidget = QtGui.QWidget()
        self.characterSettingWidget.setContentsMargins(0, 0, 0, 0)
        self.characterSettingWidget.setFixedHeight(0)

        self.ch_box.groupBoxLayout.addWidget(self.characterSettingWidget)
        self.ch_box.groupBoxLayout.addLayout(nameLayout)
        self.ch_box.groupBoxLayout.addWidget(self.ch_nameBtn)

        layout.addWidget(self.ch_box)
        self.ch_settingsBtn = self.ch_box.settingsBtn

        self.charWidget.setLayout(layout)

        self.ch_nameBtn.clicked.connect(self.ch_create)
        self.ch_settingsBtn.clicked.connect(self.ch_toggleSettingsUi)
        self.charNameCombo.activated.connect(self.refreshCharacter)
Beispiel #2
0
    def setupUI(self):
        centralWidget = QtGui.QWidget()
        mainLayout = QtGui.QVBoxLayout()
        self.attrlayout = QtGui.QVBoxLayout()

        self.box = utils.TitledBox(title='Attributes', settings=1)

        self.moduleNameEdit = utils.LabelEdit(label='Module Name:')
        self.moduleNameEdit.edit.setText(self.moduleName.capitalize())

        self.jointNumberWidget = QtGui.QWidget()
        self.jointNumberLayout = QtGui.QHBoxLayout()
        self.jointNumberLayout.setContentsMargins(10, 0, 10, 0)
        jointNumberLabel = QtGui.QLabel('Joint Number: ')
        self.jointNumberSpin = QtGui.QSpinBox()
        self.jointNumberSpin.setMinimum(1)
        self.jointNumberLayout.addWidget(jointNumberLabel)
        self.jointNumberLayout.addWidget(self.jointNumberSpin)
        self.jointNumberWidget.setLayout(self.jointNumberLayout)

        separator = QtGui.QFrame()
        separator.setFrameShape(QtGui.QFrame.HLine)
        separator.setFrameShadow(QtGui.QFrame.Sunken)

        createModuleBtn = QtGui.QPushButton('Create')

        # self.attrlayout.addLayout(templateNameLayout)
        self.attrlayout.addWidget(self.moduleNameEdit)
        self.attrlayout.addWidget(self.jointNumberWidget)
        self.box.groupBoxLayout.addLayout(self.attrlayout)

        self.box.groupBoxLayout.addWidget(separator)
        self.box.groupBoxLayout.addWidget(createModuleBtn)

        mainLayout.addWidget(self.box)

        createModuleBtn.clicked.connect(self.createModule)
        centralWidget.setLayout(mainLayout)

        self.setCentralWidget(centralWidget)