def set_connections(self): if qt_version == 4: self.connect(self.link, QtCore.SIGNAL('clicked()'), self.on_download) self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) else: self.link.clicked.connect(self.on_download) #self.link.linkActivated.connect(self.on_download) self.close_button.clicked.connect(self.on_cancel)
def set_connections(self): """creates the actions for the menu""" self.opacity_edit.valueChanged.connect(self.on_opacity) self.line_width_edit.valueChanged.connect(self.on_line_width) self.point_size_edit.valueChanged.connect(self.on_point_size) self.bar_scale_edit.valueChanged.connect(self.on_bar_scale) if self.use_slider: self.opacity_slider_edit.valueChanged.connect( self.on_opacity_slider) self.line_width_slider_edit.valueChanged.connect( self.on_line_width_slider) self.point_size_slider_edit.valueChanged.connect( self.on_point_size_slider) #self.bar_scale_slider_edit.valueChanged.connect(self.on_bar_scale_slider) # self.connect(self.opacity_edit, QtCore.SIGNAL('clicked()'), self.on_opacity) # self.connect(self.line_width, QtCore.SIGNAL('clicked()'), self.on_line_width) # self.connect(self.point_size, QtCore.SIGNAL('clicked()'), self.on_point_size) if qt_version == 4: self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) self.color_edit.clicked.connect(self.on_color) self.checkbox_show.clicked.connect(self.on_show) self.checkbox_hide.clicked.connect(self.on_hide) self.cancel_button.clicked.connect(self.on_cancel)
def set_connections(self): """creates the actions for the buttons""" self.name_button.clicked.connect(self.on_default_name) self.min_button.clicked.connect(self.on_default_min) self.max_button.clicked.connect(self.on_default_max) self.format_button.clicked.connect(self.on_default_format) self.scale_button.clicked.connect(self.on_default_scale) self.phase_button.clicked.connect(self.on_default_phase) self.nlabels_button.clicked.connect(self.on_default_nlabels) self.labelsize_button.clicked.connect(self.on_default_labelsize) self.ncolors_button.clicked.connect(self.on_default_ncolors) self.colormap_button.clicked.connect(self.on_default_colormap) self.animate_button.clicked.connect(self.on_animate) self.show_radio.clicked.connect(self.on_show_hide) self.hide_radio.clicked.connect(self.on_show_hide) self.apply_button.clicked.connect(self.on_apply) self.ok_button.clicked.connect(self.on_ok) self.cancel_button.clicked.connect(self.on_cancel) if qt_version == 4: self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent)
def set_connections(self): """creates the actions for the menu""" if qt_int == 4: self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) self.link.clicked.connect(self.on_download) #self.link.linkActivated.connect(self.on_download) self.close_button.clicked.connect(self.on_cancel)
def set_connections(self): """creates the actions for the menu""" self.connect(self.name_button, QtCore.SIGNAL('clicked()'), self.on_default_name) self.connect(self.coords_button, QtCore.SIGNAL('clicked()'), self.on_default_coords) self.connect(self.elements_button, QtCore.SIGNAL('clicked()'), self.on_default_elements) self.connect(self.add_button, QtCore.SIGNAL('clicked()'), self.on_add) self.connect(self.remove_button, QtCore.SIGNAL('clicked()'), self.on_remove) self.connect(self.color_edit, QtCore.SIGNAL('clicked()'), self.on_edit_color) #self.color_edit.clicked.connect(self.on_edit_color) self.connect(self.color_button, QtCore.SIGNAL('clicked()'), self.on_default_color) self.connect(self.apply_button, QtCore.SIGNAL('clicked()'), self.on_apply) self.connect(self.ok_button, QtCore.SIGNAL('clicked()'), self.on_ok) self.connect(self.cancel_button, QtCore.SIGNAL('clicked()'), self.on_cancel)
def print_signals_and_slots(obj): # http://visitusers.org/index.php?title=PySide_Recipes for i in range(obj.metaObject().methodCount()): m = obj.metaObject().method(i) if m.methodType() == QtCore.QMetaMethod.MethodType.Signal: print("SIGNAL: sig=", m.signature(), "hooked to nslots=",obj.receivers(QtCore.SIGNAL(m.signature()))) elif m.methodType() == QtCore.QMetaMethod.MethodType.Slot: print("SLOT: sig=", m.signature())
def __init__(self, parent=None): """ very similar to: https://stackoverflow.com/questions/40002373/qscintilla-based-text-editor-in-pyqt5-with-clickable-functions-and-variables """ super(SimplePythonEditorWidget, self).__init__(parent) # Set the default font font = QFont() font.setFamily('Courier') font.setFixedPitch(True) font.setPointSize(10) self.setFont(font) self.setMarginsFont(font) self.set_font(font) self.setMarginLineNumbers(0, True) self.setMarginsBackgroundColor(QColor("#cccccc")) # Clickable margin 1 for showing markers self.setMarginSensitivity(1, True) if qt_version == 'pyqt4': self.connect(self, QtCore.SIGNAL('marginClicked(int, int, Qt::KeyboardModifiers)'), self.on_margin_clicked) else: self.marginClicked.connect(self.on_margin_clicked) self.markerDefine(Qsci.QsciScintilla.RightArrow, self.ARROW_MARKER_NUM) self.setMarkerBackgroundColor(QColor("#ee1111"), self.ARROW_MARKER_NUM) # Brace matching: enable for a brace immediately before or after # the current position self.setBraceMatching(Qsci.QsciScintilla.SloppyBraceMatch) # Current line visible with special background color self.setCaretLineVisible(True) self.setCaretLineBackgroundColor(QColor("#ffe4e4")) # Set Python lexer # Set style for Python comments (style number 1) to a fixed-width # courier. lexer = Qsci.QsciLexerPython() lexer.setDefaultFont(font) self.setLexer(lexer) if qt_version == 'pyqt4': self.SendScintilla(Qsci.QsciScintilla.SCI_STYLESETFONT, 1, 'Courier') else: font_style = bytearray(str.encode("Courier")) self.SendScintilla(Qsci.QsciScintilla.SCI_STYLESETFONT, 1, font_style) # Don't want to see the horizontal scrollbar at all # Use raw message to Scintilla here (all messages are documented # here: http://www.scintilla.org/ScintillaDoc.html) self.SendScintilla(Qsci.QsciScintilla.SCI_SETHSCROLLBAR, 0)
def __init__(self): QtGui.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) #Menu and toolbar setting self.connect(self.importFile, QtCore.SIGNAL('triggered()'), self.showDialog) self.connect(self.resultFile, QtCore.SIGNAL('triggered()'), self.openResult) #self.connect(self.resultSave, QtCore.SIGNAL('triggered()'), self.saveFile) self.connect(self.exit, QtCore.SIGNAL('triggered()'), QtCore.SLOT('close()')) self.connect(self.actionHelp, QtCore.SIGNAL('triggered()'), self.openHelp) ''' self.toolbar = self.addToolBar('import') self.toolbar.addAction(self.importFile) self.toolbar = self.addToolBar('ResultFile') self.toolbar.addAction(self.resultFile) self.toolbar = self.addToolBar('ResultSave AS') self.toolbar.addAction(self.resultSave) self.toolbar = self.addToolBar('Exit') self.toolbar.addAction(self.exit) ''' self.connect(self.run, QtCore.SIGNAL('clicked()'), self.runs) #self.connect(self.ViewFig, QtCore.SIGNAL('clicked()'),self.imageOpen) self.connect(self.Delete, QtCore.SIGNAL('clicked()'), self.delete) self.connect(self.all, QtCore.SIGNAL('clicked()'), self.allselect) self.statusBar.showMessage('Ready') self.tw.setSelectionBehavior( QAbstractItemView.SelectRows) #select whole row #self.tw.setSelectionMode(QAbstractItemView.ExtendedSelection) self.tw.setSelectionMode(QAbstractItemView.MultiSelection) global allfilepath, Imgpath allfilepath, Imgpath = [], []
def addTab(self, widget, title): QTabWidget.addTab(self, widget, title) checkBox = QCheckBox() self.checkBoxList.append(checkBox) self.tabBar().setTabButton(self.tabBar().count() - 1, QTabBar.LeftSide, checkBox) self.connect( checkBox, QtCore.SIGNAL('stateChanged(int)'), lambda checkState: self.__emitStateChanged(checkBox, checkState))
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(400, 300) self.verticalLayout_3 = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout_3.setObjectName("verticalLayout_3") self.tableView = QtWidgets.QTableView(Dialog) self.tableView.setObjectName("tableView") self.verticalLayout_3.addWidget(self.tableView) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout_3.addWidget(self.buttonBox) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def addButton(self, vbox): """添加确认退出按钮""" self.buttonEdit = QPushButton(u'确认') self.buttonClose = QPushButton(u'退出') # 界面美化 self.buttonEdit.setObjectName(_fromUtf8("redButton")) self.buttonClose.setObjectName(_fromUtf8("blueButton")) self.connect(self.buttonEdit, QtCore.SIGNAL('clicked()'), self.OnButtonEdit) self.connect(self.buttonClose, QtCore.SIGNAL('clicked()'), self.close) hbox = QHBoxLayout() hbox.addWidget(self.buttonEdit) hbox.addWidget(self.buttonClose) vbox.addLayout(hbox)
def set_connections(self): if qt_version == 4: self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) #else: # closeEvent self.min_button.clicked.connect(self.on_default_min) self.max_button.clicked.connect(self.on_default_max) self.min_edit.textChanged.connect(self.on_apply) self.max_edit.textChanged.connect(self.on_apply) self.ok_button.clicked.connect(self.on_ok)
def setupUi(self): self.setObjectName("DataDialog") self.resize(400, 300) self.layout = QW.QVBoxLayout(self) self.layout.setObjectName("layout") # Table View self.tableView = QW.QTableView(self) self.tableView.setObjectName("tableView") self.layout.addWidget(self.tableView) # QTableView Headers self.horizontal_header = self.tableView.horizontalHeader() self.vertical_header = self.tableView.verticalHeader() self.horizontal_header.setSectionResizeMode( QW.QHeaderView.ResizeToContents ) self.vertical_header.setSectionResizeMode( QW.QHeaderView.ResizeToContents ) self.horizontal_header.setStretchLastSection(True) # Button box self.buttonBox = QW.QDialogButtonBox(self) self.buttonBox.setOrientation(QC.Qt.Horizontal) self.buttonBox.setStandardButtons( QW.QDialogButtonBox.Cancel | QW.QDialogButtonBox.Ok ) self.buttonBox.setObjectName("buttonBox") self.layout.addWidget(self.buttonBox) self.retranslateUi() # Button box connections QC.QObject.connect( self.buttonBox, QC.SIGNAL("accepted()"), self.accept ) QC.QObject.connect( self.buttonBox, QC.SIGNAL("rejected()"), self.reject ) QC.QMetaObject.connectSlotsByName(self)
def __init__(self, parent=None): super(SimplePythonEditorWidget, self).__init__(parent) # Set the default font font = QFont() font.setFamily('Courier') font.setFixedPitch(True) font.setPointSize(10) self.setFont(font) self.setMarginsFont(font) # Margin 0 is used for line numbers fontmetrics = QFontMetrics(font) self.setMarginsFont(font) self.setMarginWidth(0, fontmetrics.width("00000") + 6) self.setMarginLineNumbers(0, True) self.setMarginsBackgroundColor(QColor("#cccccc")) # Clickable margin 1 for showing markers self.setMarginSensitivity(1, True) self.connect( self, QtCore.SIGNAL( 'marginClicked(int, int, Qt::KeyboardModifiers)'), self.on_margin_clicked) self.markerDefine(Qsci.QsciScintilla.RightArrow, self.ARROW_MARKER_NUM) self.setMarkerBackgroundColor(QColor("#ee1111"), self.ARROW_MARKER_NUM) # Brace matching: enable for a brace immediately before or after # the current position self.setBraceMatching(Qsci.QsciScintilla.SloppyBraceMatch) # Current line visible with special background color self.setCaretLineVisible(True) self.setCaretLineBackgroundColor(QColor("#ffe4e4")) # Set Python lexer # Set style for Python comments (style number 1) to a fixed-width # courier. lexer = Qsci.QsciLexerPython() lexer.setDefaultFont(font) self.setLexer(lexer) self.SendScintilla(Qsci.QsciScintilla.SCI_STYLESETFONT, 1, 'Courier') # Don't want to see the horizontal scrollbar at all # Use raw message to Scintilla here (all messages are documented # here: http://www.scintilla.org/ScintillaDoc.html) self.SendScintilla(Qsci.QsciScintilla.SCI_SETHSCROLLBAR, 0)
def initUI(self): self.form = RawImportForm(self) self.buttonOk = QtWidgets.QPushButton('Ok', self) self.buttonCancel = QtWidgets.QPushButton('Cancel', self) vbox = QtWidgets.QVBoxLayout() self.setLayout(vbox) vbox.addWidget(self.form) bhbox = QtWidgets.QHBoxLayout() bhbox.addStretch() bhbox.addWidget(self.buttonOk) bhbox.addWidget(self.buttonCancel) vbox.addLayout(bhbox) self.setLayout(vbox) self.connect(self.buttonOk, QtCore.SIGNAL('clicked()'), self.accept) self.connect(self.buttonCancel, QtCore.SIGNAL('clicked()'), self.reject) self.show()
def __init__(self, d): super(DictionaryTreeDialog, self).__init__() treeWidget = DictionaryTreeWidget(d) for c in range(treeWidget._model.columnCount(None)): treeWidget.resizeColumnToContents(c) self.treeWidget = treeWidget self.buttonOk = QtWidgets.QPushButton('Ok', self) self.buttonCancel = QtWidgets.QPushButton('Cancel', self) vbox = QtWidgets.QVBoxLayout() vbox.addWidget(self.treeWidget) bhbox = QtWidgets.QHBoxLayout() bhbox.addStretch() bhbox.addWidget(self.buttonOk) bhbox.addWidget(self.buttonCancel) vbox.addLayout(bhbox) self.setLayout(vbox) self.connect(self.buttonOk, QtCore.SIGNAL('clicked()'), self.accept) self.connect(self.buttonCancel, QtCore.SIGNAL('clicked()'), self.closeCancel)
def layoutChanged(self): self.emit(QtCore.SIGNAL("layoutChanged()"))
def set_connections(self): self.connect(self.name_button, QtCore.SIGNAL('clicked()'), self.on_default_name) #combo.activated[str].connect(self.onActivated) self.combo_axis.activated[str].connect(self.on_axis) self.combo_plane.activated[str].connect(self.on_plane) #self.combo_axis.connect(self.on_axis) #self.combo_plane.connect(self.on_plane) self.connect(self.origin_default_button, QtCore.SIGNAL('clicked()'), self.on_default_origin) self.connect(self.normal_default_button, QtCore.SIGNAL('clicked()'), self.on_default_normal) self.connect(self.origin_x_edit, QtCore.SIGNAL('edited()'), self.on_origin_x) self.connect(self.origin_y_edit, QtCore.SIGNAL('edited()'), self.on_origin_y) self.connect(self.origin_z_edit, QtCore.SIGNAL('edited()'), self.on_origin_z) self.connect(self.snap_normal_xy_button, QtCore.SIGNAL('clicked()'), self.on_snap_xy) self.connect(self.snap_normal_yz_button, QtCore.SIGNAL('clicked()'), self.on_snap_yz) self.connect(self.snap_normal_xz_button, QtCore.SIGNAL('clicked()'), self.on_snap_xz) self.connect(self.check_apply, QtCore.SIGNAL('clicked()'), self.on_check_apply) self.connect(self.apply_button, QtCore.SIGNAL('clicked()'), self.on_apply) self.connect(self.ok_button, QtCore.SIGNAL('clicked()'), self.on_ok) self.connect(self.cancel_button, QtCore.SIGNAL('clicked()'), self.on_cancel)
def setupUi(self, Dialog): Dialog.setObjectName("langmuirDialog") Dialog.resize(1000, 800) self.layout = QW.QGridLayout(Dialog) self.layout.setObjectName("layout") # Isotherm display self.isoGraph = GraphView(Dialog) self.isoGraph.setObjectName("isoGraph") self.layout.addWidget(self.isoGraph, 0, 0, 1, 1) # Langmuir plot self.langGraph = GraphView(Dialog) self.langGraph.setObjectName("langGraph") self.layout.addWidget(self.langGraph, 0, 1, 1, 1) # Options/results box self.optionsBox = QW.QGroupBox('Options', Dialog) self.layout.addWidget(self.optionsBox, 1, 0, 1, 1) self.optionsLayout = QW.QGridLayout(self.optionsBox) self.pSlider = QHSpinBoxRangeSlider(parent=self, dec_pnts=2, slider_range=[0, 1, 0.01], values=[0, 1]) self.pSlider.setMaximumHeight(50) self.pSlider.setEmitWhileMoving(False) self.optionsLayout.addWidget(self.pSlider, 0, 0, 1, 4) self.optionsLayout.addWidget(QW.QLabel("Fit (R):"), 1, 0, 1, 1) self.result_r = LabelResult(self) self.optionsLayout.addWidget(self.result_r, 1, 1, 1, 1) self.auto_button = QW.QPushButton('Auto-determine', self) self.optionsLayout.addWidget(self.auto_button, 1, 3, 1, 1) # description labels self.optionsLayout.addWidget(QW.QLabel("Calculated results:"), 2, 0, 1, 2) self.optionsLayout.addWidget(LabelAlignRight("Langmuir area:"), 3, 0, 1, 1) self.optionsLayout.addWidget(LabelAlignRight("K constant:"), 3, 2, 1, 1) self.optionsLayout.addWidget(LabelAlignRight("Monolayer uptake:"), 4, 0, 1, 1) self.optionsLayout.addWidget(LabelAlignRight("Monolayer pressure:"), 4, 2, 1, 1) self.optionsLayout.addWidget(LabelAlignRight("Slope:"), 5, 0, 1, 1) self.optionsLayout.addWidget(LabelAlignRight("Intercept:"), 5, 2, 1, 1) # result labels self.result_lang = LabelResult(self) self.optionsLayout.addWidget(self.result_lang, 3, 1, 1, 1) self.result_k = LabelResult(self) self.optionsLayout.addWidget(self.result_k, 3, 3, 1, 1) self.result_mono_n = LabelResult(self) self.optionsLayout.addWidget(self.result_mono_n, 4, 1, 1, 1) self.result_mono_p = LabelResult(self) self.optionsLayout.addWidget(self.result_mono_p, 4, 3, 1, 1) self.result_slope = LabelResult(self) self.optionsLayout.addWidget(self.result_slope, 5, 1, 1, 1) self.result_intercept = LabelResult(self) self.optionsLayout.addWidget(self.result_intercept, 5, 3, 1, 1) self.optionsLayout.addWidget(QW.QLabel("Calculation output:"), 6, 0, 1, 2) self.output = LabelOutput(self) self.optionsLayout.addWidget(self.output, 7, 0, 2, 4) # Bottom buttons self.buttonBox = QW.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QC.Qt.Horizontal) self.buttonBox.setStandardButtons(QW.QDialogButtonBox.Cancel | QW.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.layout.addWidget(self.buttonBox) self.retranslateUi(Dialog) QC.QObject.connect(self.buttonBox, QC.SIGNAL("accepted()"), Dialog.accept) QC.QObject.connect(self.buttonBox, QC.SIGNAL("rejected()"), Dialog.reject) QC.QMetaObject.connectSlotsByName(Dialog)
def set_connections(self): self.connect(self.opacity_edit, QtCore.SIGNAL('clicked()'), self.on_opacity) self.connect(self.point_size, QtCore.SIGNAL('clicked()'), self.on_point_size) self.connect(self.color_edit, QtCore.SIGNAL('clicked()'), self.on_color) self.connect(self.checkbox_show, QtCore.SIGNAL('clicked()'), self.on_show) self.connect(self.checkbox_hide, QtCore.SIGNAL('clicked()'), self.on_hide) self.connect(self.description_edit, QtCore.SIGNAL("valueChanged(int)"), self.on_description) self.connect(self.coord_edit, QtCore.SIGNAL("valueChanged(int)"), self.on_coord) self.connect(self.radio_rectangular, QtCore.SIGNAL('clicked()'), self.on_coord_type) self.connect(self.radio_cylindrical, QtCore.SIGNAL('clicked()'), self.on_coord_type) self.connect(self.radio_spherical, QtCore.SIGNAL('clicked()'), self.on_coord_type) self.connect(self.location_x_edit, QtCore.SIGNAL('clicked()'), self.on_location_x) self.connect(self.location_y_edit, QtCore.SIGNAL('clicked()'), self.on_location_y) self.connect(self.location_z_edit, QtCore.SIGNAL('clicked()'), self.on_location_z) self.connect(self.close_button, QtCore.SIGNAL('clicked()'), self.on_close) #self.connect(self.check_apply, QtCore.SIGNAL('clicked()'), self.on_check_apply) #self.connect(self.apply_button, QtCore.SIGNAL('clicked()'), self.on_apply) #self.connect(self.ok_button, QtCore.SIGNAL('clicked()'), self.on_ok) self.connect(self.close_button, QtCore.SIGNAL('clicked()'), self.on_close)
def set_connections(self): """creates the actions for the menu""" if qt_version == 4: self.connect(self.opacity_edit, QtCore.SIGNAL('clicked()'), self.on_opacity) self.connect(self.point_size, QtCore.SIGNAL('clicked()'), self.on_point_size) self.connect(self.color_edit, QtCore.SIGNAL('clicked()'), self.on_color) self.connect(self.checkbox_show, QtCore.SIGNAL('clicked()'), self.on_show) self.connect(self.checkbox_hide, QtCore.SIGNAL('clicked()'), self.on_hide) self.connect(self.description_edit, QtCore.SIGNAL("valueChanged(int)"), self.on_description) self.connect(self.coord_edit, QtCore.SIGNAL("valueChanged(int)"), self.on_coord) self.connect(self.radio_rectangular, QtCore.SIGNAL('clicked()'), self.on_coord_type) self.connect(self.radio_cylindrical, QtCore.SIGNAL('clicked()'), self.on_coord_type) self.connect(self.radio_spherical, QtCore.SIGNAL('clicked()'), self.on_coord_type) self.connect(self.location_x_edit, QtCore.SIGNAL('clicked()'), self.on_location_x) self.connect(self.location_y_edit, QtCore.SIGNAL('clicked()'), self.on_location_y) self.connect(self.location_z_edit, QtCore.SIGNAL('clicked()'), self.on_location_z) self.connect(self.close_button, QtCore.SIGNAL('clicked()'), self.on_close) #self.connect(self.check_apply, QtCore.SIGNAL('clicked()'), self.on_check_apply) #self.connect(self.apply_button, QtCore.SIGNAL('clicked()'), self.on_apply) #self.connect(self.ok_button, QtCore.SIGNAL('clicked()'), self.on_ok) #self.connect(self.close_button, QtCore.SIGNAL('clicked()'), self.on_close) else: #self.opacity_edit.clicked.connect(self.on_opacity) #self.point_size.clicked.connect(self.on_point_size) #self.color_edit.clicked.connect(self.on_color) #self.checkbox_show.clicked.connect(self.on_show) #self.checkbox_hide.clicked.connect(self.on_hide) #self.description_edit.valueChanged.connect(self.on_description) #self.coord_edit.valueChanged.connect(self.on_coord) #self.radio_rectangular.clicked.connect(self.on_coord_type) #self.radio_cylindrical.clicked.connect(self.on_coord_type) #self.radio_spherical.clicked.connect(self.on_coord_type) #self.location_x_edit.clicked.connect(self.on_location_x) #self.location_y_edit.clicked.connect(self.on_location_y) #self.location_z_edit.clicked.connect(self.on_location_z) self.close_button.clicked.connect(self.on_close)
def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(1115, 652) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.horizontalLayout_2 = QtGui.QHBoxLayout(self.centralwidget) self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.tabMain = QtGui.QTabWidget(self.centralwidget) self.tabMain.setObjectName(_fromUtf8("tabMain")) self.tab = QtGui.QWidget() self.tab.setObjectName(_fromUtf8("tab")) self.verticalLayout_3 = QtGui.QVBoxLayout(self.tab) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.gridLayout_4 = QtGui.QGridLayout() self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) self.label_6 = QtGui.QLabel(self.tab) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout_4.addWidget(self.label_6, 0, 0, 1, 1) self.txtLambda0 = QtGui.QLineEdit(self.tab) self.txtLambda0.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.txtLambda0.setObjectName(_fromUtf8("txtLambda0")) self.gridLayout_4.addWidget(self.txtLambda0, 0, 1, 1, 1) self.label = QtGui.QLabel(self.tab) self.label.setObjectName(_fromUtf8("label")) self.gridLayout_4.addWidget(self.label, 1, 0, 1, 1) self.cbSuperstrate = QtGui.QComboBox(self.tab) font = QtGui.QFont() font.setBold(False) font.setWeight(50) self.cbSuperstrate.setFont(font) self.cbSuperstrate.setLayoutDirection(QtCore.Qt.LeftToRight) self.cbSuperstrate.setStyleSheet(_fromUtf8("text-align: right;")) self.cbSuperstrate.setEditable(True) self.cbSuperstrate.setObjectName(_fromUtf8("cbSuperstrate")) self.gridLayout_4.addWidget(self.cbSuperstrate, 1, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_4) self.tblStack = QtGui.QTableWidget(self.tab) self.tblStack.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) self.tblStack.setAlternatingRowColors(True) self.tblStack.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.tblStack.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tblStack.setObjectName(_fromUtf8("tblStack")) self.tblStack.setColumnCount(2) self.tblStack.setRowCount(1) item = QtGui.QTableWidgetItem() self.tblStack.setVerticalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tblStack.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tblStack.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() item.setTextAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.tblStack.setItem(0, 0, item) item = QtGui.QTableWidgetItem() self.tblStack.setItem(0, 1, item) self.tblStack.horizontalHeader().setSortIndicatorShown(False) self.tblStack.horizontalHeader().setStretchLastSection(True) self.tblStack.verticalHeader().setVisible(False) self.verticalLayout_3.addWidget(self.tblStack) self.horizontalLayout_7 = QtGui.QHBoxLayout() self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7")) self.btnAddLayer = QtGui.QPushButton(self.tab) self.btnAddLayer.setText(_fromUtf8("")) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8("gui/icons/list-add.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.btnAddLayer.setIcon(icon) self.btnAddLayer.setObjectName(_fromUtf8("btnAddLayer")) self.horizontalLayout_7.addWidget(self.btnAddLayer) self.btnRemoveLayer = QtGui.QPushButton(self.tab) self.btnRemoveLayer.setText(_fromUtf8("")) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(_fromUtf8("gui/icons/list-remove.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.btnRemoveLayer.setIcon(icon1) self.btnRemoveLayer.setObjectName(_fromUtf8("btnRemoveLayer")) self.horizontalLayout_7.addWidget(self.btnRemoveLayer) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_7.addItem(spacerItem) self.verticalLayout_3.addLayout(self.horizontalLayout_7) self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.label_2 = QtGui.QLabel(self.tab) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout_4.addWidget(self.label_2) self.cbSubstrate = QtGui.QComboBox(self.tab) self.cbSubstrate.setEditable(True) self.cbSubstrate.setObjectName(_fromUtf8("cbSubstrate")) self.horizontalLayout_4.addWidget(self.cbSubstrate) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.tabMain.addTab(self.tab, _fromUtf8("")) self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName(_fromUtf8("tab_3")) self.tabMain.addTab(self.tab_3, _fromUtf8("")) self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) self.verticalLayout_4 = QtGui.QVBoxLayout(self.tab_2) self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) self.horizontalLayout_11 = QtGui.QHBoxLayout() self.horizontalLayout_11.setObjectName( _fromUtf8("horizontalLayout_11")) self.label_5 = QtGui.QLabel(self.tab_2) self.label_5.setObjectName(_fromUtf8("label_5")) self.horizontalLayout_11.addWidget(self.label_5) self.cbPlotType = QtGui.QComboBox(self.tab_2) self.cbPlotType.setObjectName(_fromUtf8("cbPlotType")) self.horizontalLayout_11.addWidget(self.cbPlotType) self.horizontalLayout_11.setStretch(1, 1) self.verticalLayout_4.addLayout(self.horizontalLayout_11) self.groupBox = QtGui.QGroupBox(self.tab_2) self.groupBox.setMinimumSize(QtCore.QSize(0, 0)) self.groupBox.setMaximumSize(QtCore.QSize(16777215, 220)) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.horizontalLayout_8 = QtGui.QHBoxLayout(self.groupBox) self.horizontalLayout_8.setObjectName(_fromUtf8("horizontalLayout_8")) self.horizontalLayout_9 = QtGui.QHBoxLayout() self.horizontalLayout_9.setObjectName(_fromUtf8("horizontalLayout_9")) self.groupBox_2 = QtGui.QGroupBox(self.groupBox) self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.gridLayout = QtGui.QGridLayout(self.groupBox_2) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.lineEdit_2 = QtGui.QLineEdit(self.groupBox_2) self.lineEdit_2.setEnabled(False) self.lineEdit_2.setMaximumSize(QtCore.QSize(50, 16777215)) self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2")) self.gridLayout.addWidget(self.lineEdit_2, 2, 2, 1, 1) self.radioButton = QtGui.QRadioButton(self.groupBox_2) self.radioButton.setChecked(True) self.radioButton.setObjectName(_fromUtf8("radioButton")) self.gridLayout.addWidget(self.radioButton, 0, 0, 1, 3) self.lineEdit = QtGui.QLineEdit(self.groupBox_2) self.lineEdit.setEnabled(False) self.lineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) self.lineEdit.setObjectName(_fromUtf8("lineEdit")) self.gridLayout.addWidget(self.lineEdit, 2, 0, 1, 1) self.label_3 = QtGui.QLabel(self.groupBox_2) self.label_3.setObjectName(_fromUtf8("label_3")) self.gridLayout.addWidget(self.label_3, 2, 1, 1, 1) self.radioButton_2 = QtGui.QRadioButton(self.groupBox_2) self.radioButton_2.setObjectName(_fromUtf8("radioButton_2")) self.gridLayout.addWidget(self.radioButton_2, 1, 0, 1, 3) self.horizontalLayout_9.addWidget(self.groupBox_2) self.groupBox_3 = QtGui.QGroupBox(self.groupBox) self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_3) self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.radioButton_3 = QtGui.QRadioButton(self.groupBox_3) self.radioButton_3.setChecked(True) self.radioButton_3.setObjectName(_fromUtf8("radioButton_3")) self.verticalLayout_2.addWidget(self.radioButton_3) self.radioButton_4 = QtGui.QRadioButton(self.groupBox_3) self.radioButton_4.setObjectName(_fromUtf8("radioButton_4")) self.verticalLayout_2.addWidget(self.radioButton_4) self.horizontalLayout_9.addWidget(self.groupBox_3) self.horizontalLayout_8.addLayout(self.horizontalLayout_9) self.verticalLayout_4.addWidget(self.groupBox) self.groupBox_4 = QtGui.QGroupBox(self.tab_2) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.groupBox_4.sizePolicy().hasHeightForWidth()) self.groupBox_4.setSizePolicy(sizePolicy) self.groupBox_4.setMinimumSize(QtCore.QSize(0, 0)) self.groupBox_4.setMaximumSize(QtCore.QSize(16777215, 220)) self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) self.horizontalLayout_6 = QtGui.QHBoxLayout(self.groupBox_4) self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) self.horizontalLayout_10 = QtGui.QHBoxLayout() self.horizontalLayout_10.setObjectName( _fromUtf8("horizontalLayout_10")) self.groupBox_5 = QtGui.QGroupBox(self.groupBox_4) self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_5) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.radioButton_7 = QtGui.QRadioButton(self.groupBox_5) self.radioButton_7.setChecked(True) self.radioButton_7.setObjectName(_fromUtf8("radioButton_7")) self.gridLayout_2.addWidget(self.radioButton_7, 0, 0, 1, 3) self.radioButton_8 = QtGui.QRadioButton(self.groupBox_5) self.radioButton_8.setObjectName(_fromUtf8("radioButton_8")) self.gridLayout_2.addWidget(self.radioButton_8, 1, 0, 1, 3) self.lineEdit_3 = QtGui.QLineEdit(self.groupBox_5) self.lineEdit_3.setEnabled(False) self.lineEdit_3.setMaximumSize(QtCore.QSize(50, 16777215)) self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3")) self.gridLayout_2.addWidget(self.lineEdit_3, 2, 0, 1, 1) self.label_4 = QtGui.QLabel(self.groupBox_5) self.label_4.setObjectName(_fromUtf8("label_4")) self.gridLayout_2.addWidget(self.label_4, 2, 1, 1, 1) self.lineEdit_4 = QtGui.QLineEdit(self.groupBox_5) self.lineEdit_4.setEnabled(False) self.lineEdit_4.setMaximumSize(QtCore.QSize(50, 16777215)) self.lineEdit_4.setObjectName(_fromUtf8("lineEdit_4")) self.gridLayout_2.addWidget(self.lineEdit_4, 2, 2, 1, 1) self.horizontalLayout_10.addWidget(self.groupBox_5) self.groupBox_6 = QtGui.QGroupBox(self.groupBox_4) self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox_6) self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) self.radioButton_5 = QtGui.QRadioButton(self.groupBox_6) self.radioButton_5.setChecked(True) self.radioButton_5.setObjectName(_fromUtf8("radioButton_5")) self.verticalLayout_5.addWidget(self.radioButton_5) self.radioButton_6 = QtGui.QRadioButton(self.groupBox_6) self.radioButton_6.setObjectName(_fromUtf8("radioButton_6")) self.verticalLayout_5.addWidget(self.radioButton_6) self.horizontalLayout_10.addWidget(self.groupBox_6) self.horizontalLayout_6.addLayout(self.horizontalLayout_10) self.verticalLayout_4.addWidget(self.groupBox_4) self.groupBox_7 = QtGui.QGroupBox(self.tab_2) self.groupBox_7.setObjectName(_fromUtf8("groupBox_7")) self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_7) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) self.listWidget = QtGui.QListWidget(self.groupBox_7) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.listWidget.sizePolicy().hasHeightForWidth()) self.listWidget.setSizePolicy(sizePolicy) self.listWidget.setMaximumSize(QtCore.QSize(130, 16777215)) self.listWidget.setObjectName(_fromUtf8("listWidget")) self.gridLayout_3.addWidget(self.listWidget, 0, 0, 5, 1) self.pushButton = QtGui.QPushButton(self.groupBox_7) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.pushButton.sizePolicy().hasHeightForWidth()) self.pushButton.setSizePolicy(sizePolicy) self.pushButton.setObjectName(_fromUtf8("pushButton")) self.gridLayout_3.addWidget(self.pushButton, 0, 1, 1, 1) self.pushButton_5 = QtGui.QPushButton(self.groupBox_7) self.pushButton_5.setObjectName(_fromUtf8("pushButton_5")) self.gridLayout_3.addWidget(self.pushButton_5, 1, 1, 1, 1) self.pushButton_4 = QtGui.QPushButton(self.groupBox_7) self.pushButton_4.setObjectName(_fromUtf8("pushButton_4")) self.gridLayout_3.addWidget(self.pushButton_4, 2, 1, 1, 1) self.pushButton_2 = QtGui.QPushButton(self.groupBox_7) self.pushButton_2.setObjectName(_fromUtf8("pushButton_2")) self.gridLayout_3.addWidget(self.pushButton_2, 3, 1, 1, 1) self.pushButton_3 = QtGui.QPushButton(self.groupBox_7) self.pushButton_3.setObjectName(_fromUtf8("pushButton_3")) self.gridLayout_3.addWidget(self.pushButton_3, 4, 1, 1, 1) self.gridLayout_3.setColumnMinimumWidth(0, 1) self.verticalLayout_4.addWidget(self.groupBox_7) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout_4.addItem(spacerItem1) self.tabMain.addTab(self.tab_2, _fromUtf8("")) self.horizontalLayout_2.addWidget(self.tabMain) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.pltMain = MatplotlibWidget(self.centralwidget) self.pltMain.setObjectName(_fromUtf8("pltMain")) self.verticalLayout.addWidget(self.pltMain) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem2) self.btnUpdate = QtGui.QPushButton(self.centralwidget) self.btnUpdate.setObjectName(_fromUtf8("btnUpdate")) self.horizontalLayout.addWidget(self.btnUpdate) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2.addLayout(self.verticalLayout) self.horizontalLayout_2.setStretch(1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1115, 21)) self.menubar.setObjectName(_fromUtf8("menubar")) self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName(_fromUtf8("menuFile")) self.menuPlot = QtGui.QMenu(self.menubar) self.menuPlot.setObjectName(_fromUtf8("menuPlot")) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.actionQuit = QtGui.QAction(MainWindow) self.actionQuit.setObjectName(_fromUtf8("actionQuit")) self.actionNew = QtGui.QAction(MainWindow) self.actionNew.setObjectName(_fromUtf8("actionNew")) self.actionSave = QtGui.QAction(MainWindow) self.actionSave.setObjectName(_fromUtf8("actionSave")) self.actionOpen = QtGui.QAction(MainWindow) self.actionOpen.setObjectName(_fromUtf8("actionOpen")) self.actionExport = QtGui.QAction(MainWindow) self.actionExport.setObjectName(_fromUtf8("actionExport")) self.menuFile.addAction(self.actionNew) self.menuFile.addAction(self.actionOpen) self.menuFile.addAction(self.actionSave) self.menuFile.addSeparator() self.menuFile.addAction(self.actionQuit) self.menuPlot.addAction(self.actionExport) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuPlot.menuAction()) self.retranslateUi(MainWindow) self.tabMain.setCurrentIndex(0) QtCore.QObject.connect(self.actionQuit, QtCore.SIGNAL(_fromUtf8("triggered()")), MainWindow.close) QtCore.QObject.connect(self.radioButton_2, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEdit.setEnabled) QtCore.QObject.connect(self.radioButton_2, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEdit_2.setEnabled) QtCore.QObject.connect(self.radioButton_8, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEdit_3.setEnabled) QtCore.QObject.connect(self.radioButton_8, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEdit_4.setEnabled) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def mouseReleaseEvent(self, event): if qt_int == 4: self.emit(QtCore.SIGNAL('clicked()')) else: # ???? pass
def __emitStateChanged(self, checkBox, checkState): index = self.checkBoxList.index(checkBox) self.emit(QtCore.SIGNAL('stateChanged(int, int)'), index, checkState)