def __init__(self, *args, **kwargs): self.saveInfo = False self.title = '' if kwargs.has_key('title'): self.title = kwargs.pop('title') if kwargs.has_key('saveInfo'): self.saveInfo = kwargs.pop('saveInfo') self.path_uiInfo = path_basedir + "/Widget_Controller_%s.json" % self.title super(Widget_loadObject, self).__init__(*args, **kwargs) self.installEventFilter( self ) mainLayout = QHBoxLayout(self) self.setStyleSheet( "font:12px;" ) label = QLabel( "%s : " % self.title ); label.setFixedWidth( 80 ) lineEdit = QLineEdit(); lineEdit.setStyleSheet( "padding:2px; padding-bottom:1px" ) button = QPushButton( "Load" ); button.setFixedWidth( 70 ) button.setStyleSheet( "padding:3px;padding-left:6px;padding-right:6px" ) mainLayout.addWidget( label ) mainLayout.addWidget( lineEdit ) mainLayout.addWidget( button ) button.clicked.connect( self.load_target ) self.lineEdit = lineEdit if self.saveInfo : self.load_lineEdit_text( self.lineEdit, self.path_uiInfo ) self.button = button
def __init__(self, *args, **kwargs): title = "" if kwargs.has_key("title"): title = kwargs.pop("title") super(Widget_mesh, self).__init__(*args, **kwargs) label = QLabel(title) label.setFixedWidth(90) lineEdit = QLineEdit() button = QPushButton("Load") button.setFixedWidth(60) mainLayout = QHBoxLayout(self) mainLayout.setContentsMargins(0, 0, 0, 0) mainLayout.addWidget(label) mainLayout.addWidget(lineEdit) mainLayout.addWidget(button) self.title = title self.lineEdit = lineEdit QtCore.QObject.connect(button, QtCore.SIGNAL("clicked()"), self.loadSelected) WidgetInfo(self.lineEdit).loadText(Window.infoPath, 'Widget_mesh_%s_lineEdit' % title)
class TooltipPositioningWithArrow(TooltipPositioning): ARROW_MARGIN = 7 ARROW_SIZE = 11 ARROW_ODD_SIZE = 15 def _getTopOrBottomArrow(self, alignment, tooltip, main_window): arrow_alignment = TooltipAlignment.mapToMainWindow(tooltip.hoveredWidget(), main_window).x() - alignment + \ tooltip.hoveredWidget().width() / 2 - self.ARROW_ODD_SIZE / 2 if arrow_alignment > tooltip.widget().width(): arrow_alignment = tooltip.widget().width() - self.ARROW_ODD_SIZE self._arrow = QWidget() self._arrow.setLayout(self._getTopOrBottomArrowLayout(arrow_alignment)) self._label_arrow = QLabel() self._label_arrow.setStyleSheet( self._getArrowStylesheet(tooltip.color())) self._label_arrow.setFixedWidth(self.ARROW_ODD_SIZE) self._label_arrow.setFixedHeight(self.ARROW_SIZE) self._arrow.layout().addWidget(self._label_arrow) return self._arrow def _getTopOrBottomArrowLayout(self, arrow_alignment): self._arrow_layout = QHBoxLayout() self._arrow_layout.setAlignment(Qt.AlignLeft) self._arrow_layout.setContentsMargins(arrow_alignment, 0, 0, 0) return self._arrow_layout def _getLeftOrRightArrow(self, alignment, tooltip, main_window): arrow_alignment = TooltipAlignment.mapToMainWindow(tooltip.hoveredWidget(), main_window).y() \ - alignment + tooltip.hoveredWidget().height() / 2 - self.ARROW_ODD_SIZE / 2 if arrow_alignment > tooltip.widget().height(): arrow_alignment = tooltip.widget().height() - self.ARROW_ODD_SIZE self._arrow = QWidget() self._arrow.setLayout(self._getLeftOrRightArrowLayout(arrow_alignment)) self._label_arrow = QLabel() self._label_arrow.setStyleSheet( self._getArrowStylesheet(tooltip.color())) self._label_arrow.setFixedWidth(self.ARROW_SIZE) self._label_arrow.setFixedHeight(self.ARROW_ODD_SIZE) self._arrow.layout().addWidget(self._label_arrow) return self._arrow def _getLeftOrRightArrowLayout(self, arrow_alignment): self._arrow_layout = QVBoxLayout() self._arrow_layout.setAlignment(Qt.AlignTop) self._arrow_layout.setContentsMargins(0, arrow_alignment, 0, 0) return self._arrow_layout def _getArrowStylesheet(self, color="rgb(255, 255, 255)"): raise NotImplementedError("Subclass responsibility") def showTooltip(self, tooltip, align, main_window): raise NotImplementedError("Subclass responsibility")
def _create_control(self, parent): label = QLabel() width, height = self.item.width, self.item.height if self.item.width != -1.0: label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) label.setFixedWidth(abs(width)) label.setFixedHeight(abs(height)) return label
def _create_control(self, parent): label = QLabel() width, height = self.item.width, self.item.height if self.item.width != -1.0: label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) label.setFixedWidth(abs(width)) label.setFixedHeight(abs(height)) return label
class PasteToUpload(QMainWindow): def __init__(self): super(PasteToUpload, self).__init__() self.initUI() def initUI(self): self.resize(290, 150) self.setWindowTitle('PasteToUpload') font = QFont('Helvetica', 16) self.label = QLabel('Ctrl+V', self) self.edit = QLineEdit(self) self.label.setFont(font) self.label.move(45, 25) self.edit.move(45, 85) self.label.setFixedWidth(250) self.edit.setFixedWidth(200) self.edit.setReadOnly(True) self.edit.setFocusPolicy(Qt.NoFocus) self.show() def __sendPost(self, base64): value = { 'key': API_KEY, 'image': base64 } data = urllib.urlencode(value) f = urllib2.urlopen( url='http://api.imgur.com/2/upload.json', data=data ) return json.load(f) def keyPressEvent(self, e): if e.matches(QKeySequence.Paste): clipboard = QApplication.clipboard() mimeData = clipboard.mimeData() if mimeData.hasImage(): image = clipboard.image() byteArray = QByteArray() buf = QBuffer(byteArray) buf.open(QIODevice.WriteOnly) image.save(buf, "PNG") self.label.setText('Uploading') self.thread = NetThread(str(byteArray.toBase64())) self.thread.finished.connect(self.onThreadEnd) self.thread.start() else: self.label.setText('No picture in clipboard') def onThreadEnd(self): url = self.thread.getResult() self.edit.setText(url) QApplication.clipboard().setText(url) self.label.setText('Finish (URL in clipboard)')
class QtReduceStatusBar(QStatusBar): def __init__(self,parent=None): QStatusBar.__init__(self,parent) self.symbolic = None font = self.font() traceLogger.debug(font.pointSize()) if os.uname()[0] == "Darwin": font.setPointSize(font.pointSize() - 2) self.setFont(font) self.reduceMode = QLabel() self.reduceMode.setFixedWidth( QFontMetrics(font).width(self.tr("Mode: Algebraic"))) self.reduceMode.setFont(font) self.reduceTime = QLabel() self.reduceTime.setFont(font) self.reduceStatus = QLabel() self.reduceStatus.setFont(font) self.addPermanentWidget(self.reduceMode) self.addPermanentWidget(self.reduceTime) self.addWidget(self.reduceStatus) self.reduceStatus.setText(self.tr("Initializing ...")) def startComputationHandler(self,computation): signalLogger.debug(computation.command) signalLogger.debug(computation.status) self.__updateStatus(computation.status) def endComputationHandler(self,computation): signalLogger.debug(computation.status) self.__updateStatus(computation.status) self.__updateTime(computation.accTime,computation.accGcTime) self.__updateMode(computation.symbolic) def __updateMode(self,symbolic): if symbolic != self.symbolic: self.symbolic = symbolic if self.symbolic: self.reduceMode.setText(self.tr("Mode: Symbolic")) else: self.reduceMode.setText(self.tr("Mode: Algebraic")) def __updateTime(self,time,gcTime): timeStr = "%.2f s" % (float(time + gcTime)/1000) self.reduceTime.setText(self.tr("Time: ") + timeStr) def __updateStatus(self,status): if status == QtReduceComputation.Evaluating: self.reduceStatus.setText(self.tr(" Evaluating")) else: self.reduceStatus.setText(self.tr(" Ready"))
def __init__(self, *args, **kwargs ): super(Widget_attributeName, self).__init__(*args, **kwargs ) mainLayout = QHBoxLayout( self ); mainLayout.setContentsMargins( 15, 10, 10, 10 ) label = QLabel( "Attribute name : " ); label.setFixedWidth( 120 ) lineEdit = QLineEdit() mainLayout.addWidget( label ) mainLayout.addWidget( lineEdit ) self.lineEdit = lineEdit QtCore.QObject.connect( lineEdit, QtCore.SIGNAL( "textChanged(const QString & )" ), self.save_info ) self.load_info()
def __init__(self): super(ReplaceTool, self).__init__() self.setWindowFlags(Qt.WindowStaysOnTopHint) self.setWindowTitle('Replace Tool') self.setFixedHeight(100) self.setFixedWidth(320) lyt_main = QVBoxLayout() lbl_find = QLabel('Find:') lbl_find.setFixedWidth(55) self.ledit_find = QLineEdit() lbl_replace = QLabel('Replace:') lbl_replace.setFixedWidth(55) self.ledit_replace = QLineEdit() reg_ex = QRegExp("[a-zA-Z_]+") text_validator = QRegExpValidator(reg_ex, self.ledit_find) self.ledit_find.setValidator(text_validator) self.ledit_replace.setValidator(text_validator) lyt_find = QHBoxLayout() lyt_find.addWidget(lbl_find) lyt_find.addWidget(self.ledit_find) lyt_main.addLayout(lyt_find) lyt_replace = QHBoxLayout() lyt_replace.addWidget(lbl_replace) lyt_replace.addWidget(self.ledit_replace) lyt_main.addLayout(lyt_replace) btn_submit = QPushButton('Submit') btn_submit.setFixedHeight(20) btn_submit.setFixedWidth(55) lyt_submit_button = QHBoxLayout() lyt_submit_button.setAlignment(Qt.AlignRight) lyt_submit_button.addWidget(btn_submit) lyt_main.addLayout(lyt_submit_button) self.setLayout(lyt_main) btn_submit.clicked.connect(self.submit)
def __init__(self, *args, **kwargs ): super( Widget_startIndex, self ).__init__( *args, **kwargs ) mainLayout = QHBoxLayout( self ); mainLayout.setContentsMargins(15, 0, 10, 10 ) validator = QIntValidator() label = QLabel( "Start Index : " ); label.setFixedWidth( 120 ) lineEdit = QLineEdit(); lineEdit.setValidator( validator ); lineEdit.setText( "0" ); lineEdit.setFixedWidth( 50 ) space = QLabel(); space.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Preferred ) mainLayout.addWidget(label) mainLayout.addWidget(lineEdit) mainLayout.addWidget( space ) self.lineEdit = lineEdit QtCore.QObject.connect(lineEdit, QtCore.SIGNAL("textChanged(const QString & )"), self.save_info) self.load_info()
def __init__(self): QWidget.__init__(self) layout = QHBoxLayout(self) label = QLabel() label.setFixedWidth(120) layout.addWidget(label) labelX = QLabel('X Range') labelY = QLabel('Y Range') labelZ = QLabel('Z Range') labelX.setAlignment(QtCore.Qt.AlignCenter) labelY.setAlignment(QtCore.Qt.AlignCenter) labelZ.setAlignment(QtCore.Qt.AlignCenter) layout.addWidget(labelX) layout.addWidget(labelY) layout.addWidget(labelZ)
def __init__(self): QWidget.__init__( self ) layout = QHBoxLayout( self ) label = QLabel() label.setFixedWidth( 120 ) layout.addWidget( label ) labelX = QLabel( 'X Range' ) labelY = QLabel( 'Y Range' ) labelZ = QLabel( 'Z Range' ) labelX.setAlignment( QtCore.Qt.AlignCenter ) labelY.setAlignment( QtCore.Qt.AlignCenter ) labelZ.setAlignment( QtCore.Qt.AlignCenter ) layout.addWidget( labelX ) layout.addWidget( labelY ) layout.addWidget( labelZ )
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.h0 = QHBoxLayout() self.lineArray = [] labelArray = [u'時間', u'值班', u'救護勤務', u'備勤', u'待命服勤', u'水源查察', u'消防查察', u'宣導勤務', u'訓(演)練', u'專案勤務', u'南山救護站'] for i in labelArray: label = QLabel(i) label.setFixedWidth(100) label.setAlignment(Qt.AlignCenter) self.h0.addWidget(label) self.h0.addSpacing(15) self.v0 = QVBoxLayout() self.v0.addLayout(self.h0) for i in xrange(24): hn = QHBoxLayout() for j in xrange(len(labelArray)): if j == 0: time = i+8 if (i+8)< 24 else i+8-24 line = QLabel("%s:00~%s:00" % (str(time).zfill(2), str(time+1).zfill(2))) else: line = QLineEdit() self.lineArray.append(line) line.setFixedWidth(100) hn.addSpacing(15) hn.addWidget(line) self.v0.addLayout(hn) self.h1 = QHBoxLayout() self.clearPB = QPushButton("Clear All") self.clearPB.setFixedWidth(200) self.clearPB.setFixedHeight(50) self.clearPB.clicked.connect(self.clear) self.h1.addStretch() self.h1.addWidget(self.clearPB) self.h1.addStretch() self.v0.addLayout(self.h1) self.setLayout(self.v0)
def initUI(self): self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) # Select analysis file button button = QPushButton('Select analysis file', self) button.setToolTip('*.inp CalculiX analysis file.') button.move(10, 10) button.clicked.connect(self.on_click) # Text box - file path and name self.textbox_file_name = QLineEdit(self) self.textbox_file_name.move(120, 15) self.textbox_file_name.resize(420, 20) self.textbox_file_name.setText("None analysis file selected") self.textbox_file_name.setToolTip('Analysis file.') # Update button button1 = QPushButton('Update domains', self) button1.setToolTip( 'Update naming inputs and material data from FreeCAD.') button1.move(10, 50) button1.clicked.connect(self.on_click1) # Domains definition # Label above domains definition label21 = QLabel('Domain 0', self) label21.setStyleSheet("font-weight: bold") label21.move(120, 50) label21 = QLabel('Domain 1', self) label21.setStyleSheet("font-weight: bold") label21.move(260, 50) label21 = QLabel('Domain 2', self) label21.setStyleSheet("font-weight: bold") label21.move(400, 50) label24 = QLabel('Material object', self) label24.move(20, 80) label25 = QLabel('Thickness object', self) label25.move(20, 110) label26 = QLabel('As design domain', self) label26.move(20, 140) label27 = QLabel('Stress limit [MPa]', self) label27.move(20, 170) # Combo box - select domain by material object self.combo = QComboBox(self) self.combo.setToolTip('Material object to define the domain.') self.combo.move(120, 80) self.combo.resize(140, 30) self.combo.currentIndexChanged.connect(self.on_change) self.combo1 = QComboBox(self) self.combo1.setToolTip('Material object to define the domain.') self.combo1.move(260, 80) self.combo1.resize(140, 30) self.combo1.currentIndexChanged.connect(self.on_change1) self.combo2 = QComboBox(self) self.combo2.setToolTip('Material object to define the domain.') self.combo2.move(400, 80) self.combo2.resize(140, 30) self.combo2.currentIndexChanged.connect(self.on_change2) # Combo box - select thickness object self.combo0t = QComboBox(self) self.combo0t.setToolTip( 'Thickness object to specify if domain is for shells.') self.combo0t.move(120, 110) self.combo0t.resize(140, 30) self.combo1t = QComboBox(self) self.combo1t.setToolTip( 'Thickness object to specify if domain is for shells.') self.combo1t.move(260, 110) self.combo1t.resize(140, 30) self.combo2t = QComboBox(self) self.combo2t.setToolTip( 'Thickness object to specify if domain is for shells.') self.combo2t.move(400, 110) self.combo2t.resize(140, 30) self.textbox3 = QLineEdit(self) self.textbox3.move(120, 170) self.textbox3.resize(40, 20) # self.textbox3.setText("") self.textbox3.setToolTip( 'Thickness [mm] of shell elements in the domain.\n' 'This value overwrites thickness defined in FreeCAD') self.textbox4 = QLineEdit(self) self.textbox4.move(260, 170) self.textbox4.resize(40, 20) # self.textbox4.setText("") self.textbox4.setToolTip( 'Thickness [mm] of shell elements in the domain.\n' 'This value overwrites thickness defined in FreeCAD') self.textbox5 = QLineEdit(self) self.textbox5.move(400, 170) self.textbox5.resize(40, 20) # self.textbox5.setText("") self.textbox5.setToolTip( 'Thickness [mm] of shell elements in the domain.\n' 'This value overwrites thickness defined in FreeCAD') # Check box - design or nondesign self.checkbox = QCheckBox('', self) self.checkbox.setChecked(True) self.checkbox.setToolTip('Check to be the design domain.') self.checkbox.move(120, 140) self.checkbox1 = QCheckBox('', self) self.checkbox1.setChecked(True) self.checkbox1.setToolTip('Check to be the design domain.') self.checkbox1.move(260, 140) self.checkbox2 = QCheckBox('', self) self.checkbox2.setChecked(True) self.checkbox2.setToolTip('Check to be the design domain.') self.checkbox2.move(400, 140) # Text box - stress limit self.textbox = QLineEdit(self) self.textbox.move(120, 170) self.textbox.resize(40, 20) # self.textbox.setText("") self.textbox.setToolTip( 'Von Mises stress [MPa] limit, when reached, material removing will stop.' ) self.textbox1 = QLineEdit(self) self.textbox1.move(260, 170) self.textbox1.resize(40, 20) # self.textbox1.setText("") self.textbox1.setToolTip( 'Von Mises stress [MPa] limit, when reached, material removing will stop.' ) self.textbox2 = QLineEdit(self) self.textbox2.move(400, 170) self.textbox2.resize(40, 20) # self.textbox2.setText("") self.textbox2.setToolTip( 'Von Mises stress [MPa] limit, when reached, material removing will stop.' ) # Filters # Label above filter definition label31 = QLabel('Filter 0', self) label31.setStyleSheet("font-weight: bold") label31.move(120, 210) label32 = QLabel('Filter 1', self) label32.setStyleSheet("font-weight: bold") label32.move(260, 210) label33 = QLabel('Filter 2', self) label33.setStyleSheet("font-weight: bold") label33.move(400, 210) label34 = QLabel('Type', self) label34.move(20, 240) label35 = QLabel('Range [mm]', self) label35.move(20, 270) label36 = QLabel('Direction vector', self) label36.move(20, 300) label37 = QLabel('Apply to', self) label37.move(20, 330) # Combo box - select filter type self.combo6 = QComboBox(self) self.combo6.setToolTip( 'Filters:\n' '"simple" to suppress checkerboard effect,\n' '"casting" to prescribe casting direction (opposite to milling direction)\n' 'Recommendation: for casting use as first "casting" and as second "simple"' ) self.combo6.addItem("None") self.combo6.addItem("simple") self.combo6.addItem("casting") self.combo6.setCurrentIndex(1) self.combo6.move(120, 240) self.combo6.currentIndexChanged.connect(self.on_change6) self.combo7 = QComboBox(self) self.combo7.setToolTip( 'Filters:\n' '"simple" to suppress checkerboard effect,\n' '"casting" to prescribe casting direction (opposite to milling direction)\n' 'Recommendation: for casting use as first "casting" and as second "simple"' ) self.combo7.addItem("None") self.combo7.addItem("simple") self.combo7.addItem("casting") self.combo7.move(260, 240) self.combo7.currentIndexChanged.connect(self.on_change7) self.combo8 = QComboBox(self) self.combo8.setToolTip( 'Filters:\n' '"simple" to suppress checkerboard effect,\n' '"casting" to prescribe casting direction (opposite to milling direction)\n' 'Recommendation: for casting use as first "casting" and as second "simple"' ) self.combo8.addItem("None") self.combo8.addItem("simple") self.combo8.addItem("casting") self.combo8.move(400, 240) self.combo8.currentIndexChanged.connect(self.on_change8) # Text box - filter range self.textbox6 = QLineEdit(self) self.textbox6.move(120, 270) self.textbox6.resize(50, 20) # self.textbox6.setText("") self.textbox6.setToolTip( 'Filter range [mm], recommended two times mesh size.') self.textbox7 = QLineEdit(self) self.textbox7.move(260, 270) self.textbox7.resize(50, 20) # self.textbox7.setText("") self.textbox7.setToolTip( 'Filter range [mm], recommended two times mesh size.') self.textbox7.setEnabled(False) self.textbox8 = QLineEdit(self) self.textbox8.move(400, 270) self.textbox8.resize(50, 20) # self.textbox8.setText("") self.textbox8.setToolTip( 'Filter range [mm], recommended two times mesh size.') self.textbox8.setEnabled(False) # Text box - casting direction self.textbox9 = QLineEdit(self) self.textbox9.move(120, 300) self.textbox9.resize(80, 20) self.textbox9.setText("0, 0, 1") self.textbox9.setEnabled(False) self.textbox9.setToolTip( 'Casting direction vector, e.g. direction in z axis:\n' '0, 0, 1\n\n' 'solid void\n' 'XXXXXX.................\n' 'XXX........................\n' 'XX........................... --> z axis\n' 'XXXXX....................\n' 'XXXXXXXXXXX......') self.textbox10 = QLineEdit(self) self.textbox10.move(260, 300) self.textbox10.resize(80, 20) self.textbox10.resize(80, 20) self.textbox10.setText("0, 0, 1") self.textbox10.setEnabled(False) self.textbox10.setToolTip( 'Casting direction vector, e.g. direction in z axis:\n' '0, 0, 1\n\n' 'solid void\n' 'XXXXXX.................\n' 'XXX........................\n' 'XX........................... --> z axis\n' 'XXXXX....................\n' 'XXXXXXXXXXX......') self.textbox11 = QLineEdit(self) self.textbox11.move(400, 300) self.textbox11.resize(80, 20) self.textbox11.setText("0, 0, 1") self.textbox11.setEnabled(False) self.textbox11.setToolTip( 'Casting direction vector, e.g. direction in z axis:\n' '0, 0, 1\n\n' 'solid void\n' 'XXXXXX.................\n' 'XXX........................\n' 'XX........................... --> z axis\n' 'XXXXX....................\n' 'XXXXXXXXXXX......') # list widget - select domains self.widget = QListWidget(self) self.widget.setToolTip( 'Domains affected by the filter.\n' 'Select only from domains which you defined above.') self.widget.move(120, 330) self.widget.resize(140, 120) self.widget.setSelectionMode(QAbstractItemView.MultiSelection) self.widget1 = QListWidget(self) self.widget1.setToolTip( 'Domains affected by the filter.\n' 'Select only from domains which you defined above.') self.widget1.move(260, 330) self.widget1.resize(140, 120) self.widget1.setSelectionMode(QAbstractItemView.MultiSelection) self.widget1.setEnabled(False) self.widget2 = QListWidget(self) self.widget2.setToolTip( 'Domains affected by the filter.\n' 'Select only from domains which you defined above.') self.widget2.move(400, 330) self.widget2.resize(140, 120) self.widget2.setSelectionMode(QAbstractItemView.MultiSelection) self.widget2.setEnabled(False) # Other settings label40 = QLabel('Other settings', self) label40.setStyleSheet("font-weight: bold") label40.move(10, 470) # AR, RR slider label41 = QLabel('Change per iteration: low', self) label41.setFixedWidth(150) label41.move(10, 500) label42 = QLabel('high', self) label42.move(240, 500) self.slider = QSlider(Qt.Horizontal, self) self.slider.setRange(1, 3) self.slider.setSingleStep(1) self.slider.setValue(2) self.slider.move(150, 500) self.slider.resize(80, 30) self.slider.setToolTip( 'Sets mass change per iteration, which is controlled as\n' 'slow: mass_addition_ratio=0.01, mass_removal_ratio=0.02\n' 'middle: mass_addition_ratio=0.015, mass_removal_ratio=0.03\n' 'fast: mass_addition_ratio=0.03, mass_removal_ratio=0.06') # optimization base combobox label51 = QLabel('Optimization base', self) label51.move(10, 530) self.combo51 = QComboBox(self) self.combo51.setToolTip( 'Basic principle to determine if element should remain or be removed:\n' '"stiffness" to maximize stiffness (minimize compliance),\n' '"heat" to maximize heat flow.') self.combo51.addItem("stiffness") self.combo51.addItem("heat") self.combo51.move(120, 530) # mass goal ratio label52 = QLabel('Mass goal ratio', self) label52.move(10, 560) self.textbox52 = QLineEdit(self) self.textbox52.move(120, 560) self.textbox52.resize(50, 20) self.textbox52.setText("0.4") self.textbox52.setToolTip( 'Fraction of all design domains masses to be achieved;\n' 'between 0 and 1.') # generate conf. file button button21 = QPushButton('Generate conf. file', self) button21.setToolTip( 'Writes configuration file with optimization parameters.') button21.move(10, 600) button21.clicked.connect(self.on_click21) # edit conf. file button button22 = QPushButton('Edit conf. file', self) button22.setToolTip('Opens configuration file for hand modifications.') button22.move(10, 630) button22.clicked.connect(self.on_click22) # run optimization button button23 = QPushButton('Run optimization', self) button23.setToolTip('Writes configuration file and runs optimization.') button23.move(10, 660) button23.clicked.connect(self.on_click23) # generate conf file and run optimization button button24 = QPushButton('Generate conf.\nfile and run\noptimization', self) button24.setToolTip('Writes configuration file and runs optimization.') button24.move(120, 600) button24.resize(100, 90) button24.clicked.connect(self.on_click24) # help buttons label41 = QLabel('Help', self) label41.move(440, 560) button31 = QPushButton('Example', self) button31.setToolTip( 'https://github.com/fandaL/beso/wiki/Example-4:-GUI-in-FreeCAD') button31.move(440, 590) # button31.resize(80, 50) button31.clicked.connect(self.on_click31) button32 = QPushButton('Conf. comments', self) button32.setToolTip( 'https://github.com/fandaL/beso/blob/master/beso_conf.py') button32.move(440, 620) # button32.resize(80, 50) button32.clicked.connect(self.on_click32) button33 = QPushButton('Close', self) button33.move(440, 690) # button33.resize(80, 50) button33.clicked.connect(self.on_click33) # open log file button40 = QPushButton('Open log file', self) button40.setToolTip('Opens log file in your text editor.\n' '(Does not refresh automatically.)') button40.move(10, 690) button40.clicked.connect(self.on_click40) self.on_click1() # first update self.show()