Python PySide.QtGui.QPushButton() Examples
The following are 30
code examples of PySide.QtGui.QPushButton().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PySide.QtGui
, or try the search function
.
Example #1
Source File: renamewindow.py From TimeMachine with GNU Lesser General Public License v3.0 | 7 votes |
def __init__(self, parent=None, win=None, element="", info=()): super(RenameDialog, self).__init__(parent) self.sourceWin = parent self.info = info self.element = element title = "Rename: " + element self.setWindowTitle(title) layout = QtGui.QGridLayout() question = QtGui.QLabel("Please enter new name:") layout.addWidget(question, 0, 0) self.lineEdit = QtGui.QLineEdit() layout.addWidget(self.lineEdit, 0, 1) self.buttonOK = QtGui.QPushButton("OK", self) layout.addWidget(self.buttonOK, 1, 1) self.buttonCancel = QtGui.QPushButton("Cancel", self) layout.addWidget(self.buttonCancel, 1, 0) self.lineEdit.setText(self.element) self.setLayout(layout) self.buttonCancel.clicked.connect(self.cancelClicked) self.buttonOK.clicked.connect(self.okClicked)
Example #2
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 6 votes |
def setLang(self, langName): lang_data = self.memoData['lang'][langName] for ui_name in lang_data.keys(): if ui_name in self.uiList.keys() and lang_data[ui_name] != '': ui_element = self.uiList[ui_name] # '' means no translation availdanle in that data file if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ): # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox ui_element.setText(lang_data[ui_name]) elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ): # uiType: QMenu, QGroupBox ui_element.setTitle(lang_data[ui_name]) elif isinstance(ui_element, QtWidgets.QTabWidget): # uiType: QTabWidget tabCnt = ui_element.count() tabNameList = lang_data[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != '': ui_element.setTabText(i,tabNameList[i]) elif isinstance(ui_element, QtWidgets.QComboBox): # uiType: QComboBox itemCnt = ui_element.count() itemNameList = lang_data[ui_name].split(';') ui_element.clear() ui_element.addItems(itemNameList) elif isinstance(ui_element, QtWidgets.QTreeWidget): # uiType: QTreeWidget labelCnt = ui_element.headerItem().columnCount() labelList = lang_data[ui_name].split(';') ui_element.setHeaderLabels(labelList) elif isinstance(ui_element, QtWidgets.QTableWidget): # uiType: QTableWidget colCnt = ui_element.columnCount() headerList = lang_data[ui_name].split(';') cur_table.setHorizontalHeaderLabels( headerList ) elif isinstance(ui_element, (str, unicode) ): # uiType: string for msg self.uiList[ui_name] = lang_data[ui_name]
Example #3
Source File: options.py From dpa-pipe with MIT License | 6 votes |
def __init__(self, text, icon_path=None, parent=None): super(ActionOptionGroupHeader, self).__init__( text, icon_path=icon_path, parent=parent) font = self._label.font() font.setBold(True) self._label.setFont(font) self._btn = QtGui.QPushButton('+') self._btn.setFixedSize(QtCore.QSize(self._size, self._size)) self._btn.setFocusPolicy(QtCore.Qt.NoFocus) self._btn.setCheckable(True) self._layout.insertWidget(0, self._btn) self._btn.toggled.connect(self._toggle) # -------------------------------------------------------------------------
Example #4
Source File: UITranslator.py From universal_tool_template.py with MIT License | 6 votes |
def setLang(self, langName): uiList_lang_read = self.memoData['lang'][langName] for ui_name in uiList_lang_read: ui_element = self.uiList[ui_name] if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]: # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox if uiList_lang_read[ui_name] != "": ui_element.setText(uiList_lang_read[ui_name]) elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]: # uiType: QMenu, QGroupBox if uiList_lang_read[ui_name] != "": ui_element.setTitle(uiList_lang_read[ui_name]) elif type(ui_element) in [ QtWidgets.QTabWidget]: # uiType: QTabWidget tabCnt = ui_element.count() if uiList_lang_read[ui_name] != "": tabNameList = uiList_lang_read[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != "": ui_element.setTabText(i,tabNameList[i]) elif type(ui_element) == str: # uiType: string for msg if uiList_lang_read[ui_name] != "": self.uiList[ui_name] = uiList_lang_read[ui_name]
Example #5
Source File: renamewindow.py From AndroBugs_Framework with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent=None, win=None, element="", info=()): super(RenameDialog, self).__init__(parent) self.sourceWin = parent self.info = info self.element = element title = "Rename: " + element self.setWindowTitle(title) layout = QtGui.QGridLayout() question = QtGui.QLabel("Please enter new name:") layout.addWidget(question, 0, 0) self.lineEdit = QtGui.QLineEdit() layout.addWidget(self.lineEdit, 0, 1) self.buttonOK = QtGui.QPushButton("OK", self) layout.addWidget(self.buttonOK, 1, 1) self.buttonCancel = QtGui.QPushButton("Cancel", self) layout.addWidget(self.buttonCancel, 1, 0) self.lineEdit.setText(self.element) self.setLayout(layout) self.buttonCancel.clicked.connect(self.cancelClicked) self.buttonOK.clicked.connect(self.okClicked)
Example #6
Source File: sublink_edit.py From CurvesWB with GNU Lesser General Public License v2.1 | 6 votes |
def setupUi(self, DockWidget): DockWidget.setObjectName(_fromUtf8("DockWidget")) DockWidget.resize(400, 200) self.dockWidgetContents = QtGui.QWidget() self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents")) self.verticalLayout = QtGui.QVBoxLayout(self.dockWidgetContents) #self.verticalLayout.setMargin(0) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) for link in self.link_sub: groupBox = myGrpBox(self.dockWidgetContents, link, self.obj) self.verticalLayout.addWidget(groupBox) self.pushButton_7 = QtGui.QPushButton(self.dockWidgetContents) self.pushButton_7.setObjectName(_fromUtf8("pushButton_7")) self.verticalLayout.addWidget(self.pushButton_7, 0, QtCore.Qt.AlignHCenter) spacerItem = QtGui.QSpacerItem(20, 237, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) DockWidget.setWidget(self.dockWidgetContents) self.retranslateUi(DockWidget) QtCore.QMetaObject.connectSlotsByName(DockWidget)
Example #7
Source File: sublink_edit.py From CurvesWB with GNU Lesser General Public License v2.1 | 6 votes |
def setupUi(self): #self.groupBox = QtGui.QGroupBox(self.dockWidgetContents) self.setObjectName(_fromUtf8(self.link)) self.horizontalLayout = QtGui.QHBoxLayout(self) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.pushButton = QtGui.QPushButton(self) self.pushButton.setObjectName(_fromUtf8("View")) self.horizontalLayout.addWidget(self.pushButton) self.pushButton_2 = QtGui.QPushButton(self) self.pushButton_2.setObjectName(_fromUtf8("Set")) self.horizontalLayout.addWidget(self.pushButton_2) self.pushButton.clicked.connect(self.view_link) self.pushButton.pressed.connect(self.set_selection) self.pushButton.released.connect(self.reset_selection) self.pushButton_2.clicked.connect(self.set_link) self.setTitle(self.link) self.pushButton.setText("View") self.pushButton_2.setText("Set")
Example #8
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 5 votes |
def fontDown_action(self): if self.memoData['font_size'] >= self.memoData['font_size_default']: self.memoData['font_size'] -= 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #9
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 5 votes |
def fontUp_action(self, uiClass_list=[]): if len(uiClass_list) == 0: uiClass_list = 'QLabel,QPushButton'.split(',') self.memoData['font_size'] += 2 self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) )
Example #10
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 5 votes |
def fontDown_action(self): if self.memoData['font_size'] >= self.memoData['font_size_default']: self.memoData['font_size'] -= 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #11
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 5 votes |
def setLang(self, langName): lang_data = self.memoData['lang'][langName] for ui_name in lang_data.keys(): if ui_name in self.uiList.keys() and lang_data[ui_name] != '': ui_element = self.uiList[ui_name] # '' means no translation availdanle in that data file if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ): # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox ui_element.setText(lang_data[ui_name]) elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ): # uiType: QMenu, QGroupBox ui_element.setTitle(lang_data[ui_name]) elif isinstance(ui_element, QtWidgets.QTabWidget): # uiType: QTabWidget tabCnt = ui_element.count() tabNameList = lang_data[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != '': ui_element.setTabText(i,tabNameList[i]) elif isinstance(ui_element, QtWidgets.QComboBox): # uiType: QComboBox itemCnt = ui_element.count() itemNameList = lang_data[ui_name].split(';') ui_element.clear() ui_element.addItems(itemNameList) elif isinstance(ui_element, QtWidgets.QTreeWidget): # uiType: QTreeWidget labelCnt = ui_element.headerItem().columnCount() labelList = lang_data[ui_name].split(';') ui_element.setHeaderLabels(labelList) elif isinstance(ui_element, QtWidgets.QTableWidget): # uiType: QTableWidget colCnt = ui_element.columnCount() headerList = lang_data[ui_name].split(';') cur_table.setHorizontalHeaderLabels( headerList ) elif isinstance(ui_element, (str, unicode) ): # uiType: string for msg self.uiList[ui_name] = lang_data[ui_name]
Example #12
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 5 votes |
def fontDown_action(self): if self.memoData['font_size'] >= self.memoData['font_size_default']: self.memoData['font_size'] -= 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #13
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 5 votes |
def fontUp_action(self): self.memoData['font_size'] += 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #14
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 5 votes |
def setLang(self, langName): lang_data = self.memoData['lang'][langName] for ui_name in lang_data.keys(): if ui_name in self.uiList.keys() and lang_data[ui_name] != '': ui_element = self.uiList[ui_name] # '' means no translation availdanle in that data file if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ): # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox ui_element.setText(lang_data[ui_name]) elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ): # uiType: QMenu, QGroupBox ui_element.setTitle(lang_data[ui_name]) elif isinstance(ui_element, QtWidgets.QTabWidget): # uiType: QTabWidget tabCnt = ui_element.count() tabNameList = lang_data[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != '': ui_element.setTabText(i,tabNameList[i]) elif isinstance(ui_element, QtWidgets.QComboBox): # uiType: QComboBox itemCnt = ui_element.count() itemNameList = lang_data[ui_name].split(';') ui_element.clear() ui_element.addItems(itemNameList) elif isinstance(ui_element, QtWidgets.QTreeWidget): # uiType: QTreeWidget labelCnt = ui_element.headerItem().columnCount() labelList = lang_data[ui_name].split(';') ui_element.setHeaderLabels(labelList) elif isinstance(ui_element, QtWidgets.QTableWidget): # uiType: QTableWidget colCnt = ui_element.columnCount() headerList = lang_data[ui_name].split(';') cur_table.setHorizontalHeaderLabels( headerList ) elif isinstance(ui_element, (str, unicode) ): # uiType: string for msg self.uiList[ui_name] = lang_data[ui_name]
Example #15
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 5 votes |
def fontDown_action(self): if self.memoData['font_size'] >= self.memoData['font_size_default']: self.memoData['font_size'] -= 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #16
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 5 votes |
def fontUp_action(self): self.memoData['font_size'] += 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #17
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 5 votes |
def setLang(self, langName): lang_data = self.memoData['lang'][langName] for ui_name in lang_data.keys(): if ui_name in self.uiList.keys() and lang_data[ui_name] != '': ui_element = self.uiList[ui_name] # '' means no translation availdanle in that data file if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ): # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox ui_element.setText(lang_data[ui_name]) elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ): # uiType: QMenu, QGroupBox ui_element.setTitle(lang_data[ui_name]) elif isinstance(ui_element, QtWidgets.QTabWidget): # uiType: QTabWidget tabCnt = ui_element.count() tabNameList = lang_data[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != '': ui_element.setTabText(i,tabNameList[i]) elif isinstance(ui_element, QtWidgets.QComboBox): # uiType: QComboBox itemCnt = ui_element.count() itemNameList = lang_data[ui_name].split(';') ui_element.clear() ui_element.addItems(itemNameList) elif isinstance(ui_element, QtWidgets.QTreeWidget): # uiType: QTreeWidget labelCnt = ui_element.headerItem().columnCount() labelList = lang_data[ui_name].split(';') ui_element.setHeaderLabels(labelList) elif isinstance(ui_element, QtWidgets.QTableWidget): # uiType: QTableWidget colCnt = ui_element.columnCount() headerList = lang_data[ui_name].split(';') cur_table.setHorizontalHeaderLabels( headerList ) elif isinstance(ui_element, (str, unicode) ): # uiType: string for msg self.uiList[ui_name] = lang_data[ui_name]
Example #18
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 5 votes |
def fontUp_action(self): self.memoData['font_size'] += 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #19
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 5 votes |
def fontNormal_action(self, uiClass_list=[]): if len(uiClass_list) == 0: uiClass_list = 'QLabel,QPushButton'.split(',') self.memoData['font_size'] = self.memoData['font_size_default'] self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) )
Example #20
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 5 votes |
def setLang(self, langName): lang_data = self.memoData['lang'][langName] for ui_name in lang_data.keys(): if ui_name in self.uiList.keys() and lang_data[ui_name] != '': ui_element = self.uiList[ui_name] # '' means no translation availdanle in that data file if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ): # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox ui_element.setText(lang_data[ui_name]) elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ): # uiType: QMenu, QGroupBox ui_element.setTitle(lang_data[ui_name]) elif isinstance(ui_element, QtWidgets.QTabWidget): # uiType: QTabWidget tabCnt = ui_element.count() tabNameList = lang_data[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != '': ui_element.setTabText(i,tabNameList[i]) elif isinstance(ui_element, QtWidgets.QComboBox): # uiType: QComboBox itemCnt = ui_element.count() itemNameList = lang_data[ui_name].split(';') ui_element.clear() ui_element.addItems(itemNameList) elif isinstance(ui_element, QtWidgets.QTreeWidget): # uiType: QTreeWidget labelCnt = ui_element.headerItem().columnCount() labelList = lang_data[ui_name].split(';') ui_element.setHeaderLabels(labelList) elif isinstance(ui_element, QtWidgets.QTableWidget): # uiType: QTableWidget colCnt = ui_element.columnCount() headerList = lang_data[ui_name].split(';') cur_table.setHorizontalHeaderLabels( headerList ) elif isinstance(ui_element, (str, unicode) ): # uiType: string for msg self.uiList[ui_name] = lang_data[ui_name]
Example #21
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 5 votes |
def fontNormal_action(self): self.memoData['font_size'] = self.memoData['font_size_default'] self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #22
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 5 votes |
def fontUp_action(self): self.memoData['font_size'] += 2 self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #23
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 5 votes |
def fontNormal_action(self): self.memoData['font_size'] = self.memoData['font_size_default'] self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])
Example #24
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 5 votes |
def setLang(self, langName): lang_data = self.memoData['lang'][langName] for ui_name in lang_data.keys(): if ui_name in self.uiList.keys() and lang_data[ui_name] != '': ui_element = self.uiList[ui_name] # '' means no translation availdanle in that data file if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ): # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox ui_element.setText(lang_data[ui_name]) elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ): # uiType: QMenu, QGroupBox ui_element.setTitle(lang_data[ui_name]) elif isinstance(ui_element, QtWidgets.QTabWidget): # uiType: QTabWidget tabCnt = ui_element.count() tabNameList = lang_data[ui_name].split(';') if len(tabNameList) == tabCnt: for i in range(tabCnt): if tabNameList[i] != '': ui_element.setTabText(i,tabNameList[i]) elif isinstance(ui_element, QtWidgets.QComboBox): # uiType: QComboBox itemCnt = ui_element.count() itemNameList = lang_data[ui_name].split(';') ui_element.clear() ui_element.addItems(itemNameList) elif isinstance(ui_element, QtWidgets.QTreeWidget): # uiType: QTreeWidget labelCnt = ui_element.headerItem().columnCount() labelList = lang_data[ui_name].split(';') ui_element.setHeaderLabels(labelList) elif isinstance(ui_element, QtWidgets.QTableWidget): # uiType: QTableWidget colCnt = ui_element.columnCount() headerList = lang_data[ui_name].split(';') cur_table.setHorizontalHeaderLabels( headerList ) elif isinstance(ui_element, (str, unicode) ): # uiType: string for msg self.uiList[ui_name] = lang_data[ui_name]
Example #25
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 5 votes |
def fontDown_action(self, uiClass_list=[]): if len(uiClass_list) == 0: uiClass_list = 'QLabel,QPushButton'.split(',') if self.memoData['font_size'] >= self.memoData['font_size_default']: self.memoData['font_size'] -= 2 self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) )
Example #26
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 5 votes |
def fontUp_action(self, uiClass_list=[]): if len(uiClass_list) == 0: uiClass_list = 'QLabel,QPushButton'.split(',') self.memoData['font_size'] += 2 self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) )
Example #27
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 5 votes |
def fontNormal_action(self, uiClass_list=[]): if len(uiClass_list) == 0: uiClass_list = 'QLabel,QPushButton'.split(',') self.memoData['font_size'] = self.memoData['font_size_default'] self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) )
Example #28
Source File: recipe-578634.py From code with MIT License | 5 votes |
def __init__(self): super(Gui, self).__init__() self.resize(250, 300) self._list = QtGui.QListWidget(self) self._button1 = QtGui.QPushButton("Test CallbackEvent", self) self._button2 = QtGui.QPushButton("Test CallbackPool", self) layout = QtGui.QVBoxLayout(self) layout.setSpacing(2) layout.addWidget(self._button1) line = QtGui.QFrame(self) line.setFrameStyle(line.HLine) layout.addSpacing(6) layout.addWidget(line) layout.addSpacing(6) layout.addWidget(self._list) layout.addWidget(self._button2) self._pool = CallbackThreadPool(4) self._button1.clicked.connect(self.runCallbackEvents) self._button2.clicked.connect(self.runCallbackPool)
Example #29
Source File: animate_constraint.py From FreeCAD_assembly2 with GNU Lesser General Public License v2.1 | 5 votes |
def __init__( self, infoText ): QtGui.QPushButton.__init__( self ) self.setIcon( QtGui.QIcon(':/assembly2/icons/help.svg') ) self.info_text = infoText self.setFlat( True ) self.setMaximumWidth( 12 ) self.clicked.connect( self.clickFun )
Example #30
Source File: animate_constraint.py From FreeCAD_assembly2 with GNU Lesser General Public License v2.1 | 5 votes |
def initUI(self): vbox = QtGui.QVBoxLayout() hbox = QtGui.QHBoxLayout() #hbox2.addStretch(1) self.playStopButton = QtGui.QPushButton() #QtGui.QToolButton() self.playStopButton.setIcon( QtGui.QIcon(':/assembly2/icons/play.svg') ) self.playStopButton.clicked.connect( self.playStopButton_clicked ) self.playStopButton.setFlat( True ) self.playStopButton.setMaximumWidth( 20 ) self.playStopButton.setEnabled( False ) #self.stopButton.setIcon( QtGui.QIcon(':/haas_mill/icons/stop.svg') ) self.animationSlider = QtGui.QSlider( QtCore.Qt.Orientation.Horizontal ) self.animationSlider.setMaximum(160) self.animationSlider.sliderMoved.connect( self.slider_moved ) self.animationSlider.setEnabled( False ) #self.animationSlider.sliderMoved.connect( self.slider_moved ) hbox.addWidget( self.animationSlider ) hbox.addWidget( self.playStopButton ) vbox.addLayout( hbox ) #operation parameters self.parameterDict = {} constraint_to_animate = self.taskDialog.constraint_to_animate for widgetManager in animation_parameters: #or widgetConstructors or widgetMangers or ... w = widgetManager.generateWidget( self.parameterDict, constraint_to_animate ) if isinstance(w, QtGui.QLayout): vbox.addLayout( w ) else: vbox.addWidget( w ) self.button_generate_animiation = QtGui.QPushButton('Generate') self.button_generate_animiation.clicked.connect( self.generate_animation ) vbox.addWidget( self.button_generate_animiation ) self.setLayout(vbox)