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)
def addmodulesBtns(self): uiScriptFile = os.path.realpath(__file__) uiScriptPath, _ = os.path.split(uiScriptFile) modulesPath = uiScriptPath.replace('ui', 'modules') moduleFiles = [ py for py in os.listdir(modulesPath) if py.endswith('.py') and '__init__' not in py ] if moduleFiles: btnWidget = QtGui.QWidget() btnModulesLayout = QtGui.QVBoxLayout() btnModulesLayout.setAlignment(QtCore.Qt.AlignTop) btnModulesLayout.setContentsMargins(5, 3, 5, 0) btnLayout = QtGui.QVBoxLayout() btnLayout.setSpacing(3) btnModulesLayout.addLayout(btnLayout) btnWidget.setLayout(btnModulesLayout) self.mb_splitLayout.addWidget(btnWidget) numBtn = len(moduleFiles) for i in range(numBtn): name = moduleFiles[i][:-3] btn = QtGui.QPushButton(name) btn.setMinimumWidth(100) btnLayout.addWidget(btn) btn.clicked.connect(self.displayModuleWidget)
def skeleton_setupUI(self): layout = QtGui.QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) self.skeleton_box = utils.TitledBox(title='Skeleton', settings=0) self.buildSkeletonBtn = QtGui.QPushButton('Build Skeleton') self.skeleton_box.groupBoxLayout.addWidget(self.buildSkeletonBtn) layout.addWidget(self.skeleton_box) self.skeletonWidget.setLayout(layout) self.buildSkeletonBtn.clicked.connect(self.buildModuleSkeleton)
def setupUI(self): mainLayout = QtGui.QVBoxLayout() self.attrlayout = utils.VertBox() self.moduleNameEdit = utils.LabelEdit(label='Module Name:') separator = QtGui.QFrame() separator.setFrameShape(QtGui.QFrame.HLine) separator.setFrameShadow(QtGui.QFrame.Sunken) self.createModuleBtn = QtGui.QPushButton('Create') self.attrlayout.addWidget(self.moduleNameEdit) mainLayout.addLayout(self.attrlayout) mainLayout.addWidget(separator) mainLayout.addWidget(self.createModuleBtn) # self.createModuleBtn.clicked.connect(self.createModule) self.setLayout(mainLayout)
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)