Python PyQt5.QtWidgets.QDialogButtonBox() Examples
The following are 30
code examples of PyQt5.QtWidgets.QDialogButtonBox().
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
PyQt5.QtWidgets
, or try the search function
.
Example #1
Source File: warning_dlg.py From mindfulness-at-the-computer with GNU General Public License v3.0 | 8 votes |
def __init__(self, i_description_str: str, i_parent=None) -> None: super(WarningDlg, self).__init__(i_parent) vbox = QtWidgets.QVBoxLayout(self) self.description_qll = QtWidgets.QLabel(i_description_str) vbox.addWidget(self.description_qll) self.button_box = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok , QtCore.Qt.Horizontal, self ) vbox.addWidget(self.button_box) self.button_box.accepted.connect(self.accept) # -accept and reject are "slots" built into Qt
Example #2
Source File: calendar_widget.py From easygui_qt with BSD 3-Clause "New" or "Revised" License | 8 votes |
def __init__(self, title="Calendar"): super(CalendarWidget, self).__init__() self.setWindowTitle(title) layout = qt_widgets.QGridLayout() layout.setColumnStretch(1, 1) self.cal = qt_widgets.QCalendarWidget(self) self.cal.setGridVisible(True) self.cal.clicked[QtCore.QDate].connect(self.show_date) layout.addWidget(self.cal, 0, 0, 1, 2) self.date_label = qt_widgets.QLabel() self.date = self.cal.selectedDate() self.date_label.setText(self.date.toString()) layout.addWidget(self.date_label, 1, 0) button_box = qt_widgets.QDialogButtonBox() confirm_button = button_box.addButton(qt_widgets.QDialogButtonBox.Ok) confirm_button.clicked.connect(self.confirm) layout.addWidget(button_box, 1, 1) self.setLayout(layout) self.show() self.raise_()
Example #3
Source File: safe_delete_dlg.py From mindfulness-at-the-computer with GNU General Public License v3.0 | 7 votes |
def __init__(self, i_description_str: str, i_parent=None) -> None: super(SafeDeleteDlg, self).__init__(i_parent) vbox = QtWidgets.QVBoxLayout(self) self.description_qll = QtWidgets.QLabel(i_description_str) vbox.addWidget(self.description_qll) self.button_box = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self ) vbox.addWidget(self.button_box) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) # -accept and reject are "slots" built into Qt
Example #4
Source File: postinstall_simnibs.py From simnibs with GNU General Public License v3.0 | 7 votes |
def __init__(self): super().__init__() button_box = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel) button_box.accepted.connect(self.accept) button_box.rejected.connect(self.reject) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget( QtWidgets.QLabel( f'SimNIBS version {__version__} will be uninstalled. ' 'Are you sure?')) mainLayout.addWidget(button_box) self.setLayout(mainLayout) self.setWindowTitle('SimNIBS Uninstaller') gui_icon = os.path.join(SIMNIBSDIR,'resources', 'gui_icon.ico') self.setWindowIcon(QtGui.QIcon(gui_icon))
Example #5
Source File: puzzle.py From Miyamoto with GNU General Public License v3.0 | 6 votes |
def __init__(self): """ Creates and initializes the dialog """ QtWidgets.QDialog.__init__(self) self.setWindowTitle('Choose Object') self.objNum = QtWidgets.QSpinBox() count = len(Tileset.objects) - 1 self.objNum.setRange(0, count) self.objNum.setValue(0) buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) buttonBox.accepted.connect(self.accept) buttonBox.rejected.connect(self.reject) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget(self.objNum) mainLayout.addWidget(buttonBox) self.setLayout(mainLayout)
Example #6
Source File: simulation_menu.py From simnibs with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, session): super(SimulationOptionsDialog, self).__init__(parent) self.session = session self.fields_box = self.selectFields() self.options_box = self.selectOtherOptions() self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget(self.fields_box) mainLayout.addWidget(self.options_box) mainLayout.addWidget(self.button_box) self.setLayout(mainLayout) self.setWindowTitle('Simulation Options')
Example #7
Source File: experimental_list_widget.py From mindfulness-at-the-computer with GNU General Public License v3.0 | 6 votes |
def __init__(self, i_description_str, i_parent = None): super(SafeDeleteDialog, self).__init__(i_parent) vbox = QtWidgets.QVBoxLayout(self) self.description_qll = QtWidgets.QLabel(i_description_str) vbox.addWidget(self.description_qll) self.button_box = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self ) vbox.addWidget(self.button_box) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) # -accept and reject are "slots" built into Qt
Example #8
Source File: main_gui.py From simnibs with GNU General Public License v3.0 | 6 votes |
def setButtonBox(self): runButton = QtWidgets.QPushButton("Run") runButton.setDefault(True) runButton.clicked.connect(self.runSimnibs) button_box = QtWidgets.QDialogButtonBox() button_box.addButton(runButton, QtWidgets.QDialogButtonBox.ActionRole) return button_box #Creates the menu bar
Example #9
Source File: ui_doc_dlg.py From dash-masternode-tool with MIT License | 6 votes |
def setupUi(self, DocDlg): DocDlg.setObjectName("DocDlg") DocDlg.resize(714, 454) self.verticalLayout = QtWidgets.QVBoxLayout(DocDlg) self.verticalLayout.setContentsMargins(6, 6, 6, 6) self.verticalLayout.setSpacing(6) self.verticalLayout.setObjectName("verticalLayout") self.textMain = QtWidgets.QTextBrowser(DocDlg) self.textMain.setStyleSheet("") self.textMain.setLineWrapMode(QtWidgets.QTextEdit.NoWrap) self.textMain.setOpenExternalLinks(True) self.textMain.setObjectName("textMain") self.verticalLayout.addWidget(self.textMain) self.buttonBox = QtWidgets.QDialogButtonBox(DocDlg) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(DocDlg) self.buttonBox.accepted.connect(DocDlg.accept) self.buttonBox.rejected.connect(DocDlg.reject) QtCore.QMetaObject.connectSlotsByName(DocDlg)
Example #10
Source File: clrapplier.py From IDASkins with MIT License | 6 votes |
def eventFilter(self, obj, event): def is_colors_dialog(): return isinstance( obj, QDialog) and 'IDA Colors' in obj.windowTitle() if isinstance(event, QShowEvent) and is_colors_dialog(): qApp.removeEventFilter(self) # Hide window and find &Import button obj.windowHandle().setOpacity(0) buttons = [widget for widget in obj.children() if isinstance( widget, QDialogButtonBox)][0] button = [widget for widget in buttons.buttons() if widget.text() == '&Import'][0] with NativeHook(ask_file=self.ask_file_handler): button.click() QTimer.singleShot(0, lambda: obj.accept()) return 1 return 0
Example #11
Source File: flujo.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def changeproject(self, path): st = QtWidgets.QApplication.translate("pychemqt", "Loading project...") self.status.setText(st) QtWidgets.QApplication.processEvents() try: with open(path, "r") as file: self.project = json.load(file) except Exception as e: print(e) self.status.setText(QtGui.QApplication.translate( "pychemqt", "Failed to loading project...")) self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True) self.status.setText(QtWidgets.QApplication.translate( "pychemqt", "Project loaded succesfully")) self.stream.clear() for stream in sorted(self.project["stream"].keys()): self.stream.addItem(stream)
Example #12
Source File: wizard.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent=None): super(AutoDialog, self).__init__(parent) layout = QtWidgets.QGridLayout(self) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "T<sub>min</sub>")), 1, 1) self.Tmin = Entrada_con_unidades(Temperature) layout.addWidget(self.Tmin, 1, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "T<sub>max</sub>")), 2, 1) self.Tmax = Entrada_con_unidades(Temperature) layout.addWidget(self.Tmax, 2, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "P<sub>min</sub>")), 3, 1) self.Pmin = Entrada_con_unidades(Pressure) layout.addWidget(self.Pmin, 3, 2) layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate( "pychemqt", "P<sub>max</sub>")), 4, 1) self.Pmax = Entrada_con_unidades(Pressure) layout.addWidget(self.Pmax, 4, 2) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox, 5, 1, 1, 2)
Example #13
Source File: inputTable.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def __init__(self, columnas=2, help=False, helpFile="", **kwargs): """ title: window title help: boolean to show help button helpFile: Path for help file, file or url """ parent = kwargs.get("parent", None) super(InputTableDialog, self).__init__(parent) title = kwargs.get("title", "") self.setWindowTitle(title) self.helpFile = helpFile layout = QtWidgets.QVBoxLayout(self) self.widget = InputTableWidget(columnas, **kwargs) layout.addWidget(self.widget) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) if help: self.buttonBox.addButton(QtWidgets.QDialogButtonBox.Help) self.buttonBox.helpRequested.connect(self.ayuda) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox)
Example #14
Source File: viewComponents.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def buttonClicked(self, boton): role = self.btnBox.buttonRole(boton) if role == QtWidgets.QDialogButtonBox.AcceptRole: componente = self.getComponent() sql.inserElementsFromArray(sql.databank_Custom_name, [componente]) self.accept() elif role == QtWidgets.QDialogButtonBox.ApplyRole: componente = self.getComponent() sql.updateElement(componente, self.index) self.accept() elif role == QtWidgets.QDialogButtonBox.DestructiveRole: componente = self.getComponent() if self.index == 0: func = sql.inserElementsFromArray arg = (sql.databank_Custom_name, [componente]) elif self.index > 1000: func = sql.updateElement arg = (componente, self.index) if okToContinue(self, self.dirty, func, arg): self.accept() else: self.reject() else: self.reject()
Example #15
Source File: UI_unitConverter.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent=None): super(UI_unitConverter, self).__init__(parent) self.setWindowTitle( QtWidgets.QApplication.translate("pychemqt", "Units converter")) self.verticalLayout = QtWidgets.QVBoxLayout(self) self.lista = QtWidgets.QListWidget() self.lista.itemDoubleClicked.connect(self.showChildWindow) self.verticalLayout.addWidget(self.lista) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Close) self.buttonBox.rejected.connect(self.reject) self.verticalLayout.addWidget(self.buttonBox) for unidad in _all: self.lista.addItem(unidad.__title__) self.lista.setCurrentRow(-1) logging.info(QtWidgets.QApplication.translate( "pychemqt", "Starting unit converte tool"))
Example #16
Source File: reference.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def buttonClicked(self, boton): """Actions for dialogbuttonbox functionality""" if self.buttonBox.buttonRole(boton) == \ QtWidgets.QDialogButtonBox.AcceptRole: self.accept() elif self.buttonBox.buttonRole(boton) == \ QtWidgets.QDialogButtonBox.RejectRole: self.reject() else: if boton == \ self.buttonBox.button(QtWidgets.QDialogButtonBox.Reset): values = self._default elif boton.text() == \ QtWidgets.QApplication.translate("pychemqt", "No Mark"): values = [0]*N_PROP else: values = [1]*N_PROP for i, propiedad in enumerate(values): if propiedad == 1: val = "1" else: val = "" self.prop.item(i, 0).setText(val)
Example #17
Source File: plot.py From pychemqt with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent=None): super(AddLine, self).__init__(parent) self.setWindowTitle( QtWidgets.QApplication.translate("pychemqt", "Add Line to Plot")) layout = QtWidgets.QGridLayout(self) self.tipo = QtWidgets.QComboBox() layout.addWidget(self.tipo, 1, 1, 1, 2) layout.addWidget(QtWidgets.QLabel( QtWidgets.QApplication.translate("pychemqt", "Value")), 2, 1) self.input = [] for title, unidad, magnitud in self.lineas: self.input.append(Entrada_con_unidades(unidad, magnitud)) layout.addWidget(self.input[-1], 2, 2) self.tipo.addItem(title) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox, 10, 1, 1, 2) self.isolineaChanged(0) self.tipo.currentIndexChanged.connect(self.isolineaChanged)
Example #18
Source File: simulation_menu.py From simnibs with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, eeg_cap): super(EEGFileDialog, self).__init__(parent) self.fname = eeg_cap groupBox = QtWidgets.QGroupBox('EEG Cap File') layout = QtWidgets.QHBoxLayout() groupBox.lineEdit = QtWidgets.QLineEdit() if self.fname is not None: groupBox.lineEdit.setText(self.fname) layout.addWidget(groupBox.lineEdit) groupBox.selectFile = QtWidgets.QPushButton('&Browse') groupBox.selectFile.clicked.connect(self.selectFile) layout.addWidget(groupBox.selectFile) groupBox.setLayout(layout) self.group_box = groupBox self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) mainLayout = QtWidgets.QGridLayout() mainLayout.addWidget(self.group_box) mainLayout.addWidget(self.button_box) self.setLayout(mainLayout) self.setWindowTitle('Tensor file names') self.resize(400,200)
Example #19
Source File: petro.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def changeUnknown(self): self.status.setState(self.unknown.status, self.unknown.msg) self.buttonShowDetails.setEnabled(self.unknown.status) self.buttonBox.button(QtWidgets.QDialogButtonBox.Save).setEnabled( self.unknown.status) # Curve distillation definition
Example #20
Source File: flujo.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, text=None, parent=None): super(TextItemDlg, self).__init__(parent) layout = QtWidgets.QGridLayout(self) self.editor = texteditor.TextEditor() self.editor.notas.textChanged.connect(self.updateUi) layout.addWidget(self.editor, 1, 1, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox, 2, 1, 1, 1) self.editor.notas.setFocus() if text: self.editor.setText(text) self.setWindowTitle(QtWidgets.QApplication.translate("pychemqt", "Edit text")) self.updateUi()
Example #21
Source File: prefPFD.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(Dialog, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "PFD configuration")) layout = QtWidgets.QVBoxLayout(self) self.widget = Widget(config) layout.addWidget(self.widget) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox)
Example #22
Source File: prefPsychrometric.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(Dialog, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Psychrometric chart configuration")) layout = QtWidgets.QVBoxLayout(self) self.widget = Widget(config) layout.addWidget(self.widget) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox)
Example #23
Source File: prefStandingKatz.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(ConfigDialog, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Moody diagram configuration")) layout = QtWidgets.QVBoxLayout(self) self.widget = Widget(config) layout.addWidget(self.widget) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox)
Example #24
Source File: prefPFD.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, pen=None, parent=None): super(ConfLineDialog, self).__init__(pen) self.setWindowTitle( QtWidgets.QApplication.translate("pychemqt", "Edit format line")) buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) buttonBox.accepted.connect(self.accept) buttonBox.rejected.connect(self.reject) self.layout().addWidget(buttonBox)
Example #25
Source File: UI_confResolution.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(Dialog, self).__init__(parent) self.setWindowTitle( QtWidgets.QApplication.translate("pychemqt", "Define PFD resolution")) layout = QtWidgets.QVBoxLayout(self) self.datos = UI_confResolution_widget(config) layout.addWidget(self.datos) self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox)
Example #26
Source File: dependences.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent=None): super(ShowDependences, self).__init__(parent) self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap( os.environ["pychemqt"]+"/images/button/showPrograms.png"))) self.setWindowTitle( QtWidgets.QApplication.translate("pychemqt", "External program")) layout = QtWidgets.QVBoxLayout(self) self.tree = QtWidgets.QTreeWidget() header = QtWidgets.QTreeWidgetItem( [QtWidgets.QApplication.translate("pychemqt", "Module"), QtWidgets.QApplication.translate("pychemqt", "Status")]) self.tree.setHeaderItem(header) for module, txt in optional_modules: if os.environ[module] == "True": mod = __import__(module) st = mod.__file__ else: st = QtWidgets.QApplication.translate("pychemqt", "not found") item = QtWidgets.QTreeWidgetItem([module, st]) self.tree.addTopLevelItem(item) layout.addWidget(self.tree) button = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close) button.rejected.connect(self.reject) layout.addWidget(button)
Example #27
Source File: UI_confTransport.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(Dialog, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Transport Properties Methods")) layout = QtWidgets.QVBoxLayout(self) self.datos = UI_confTransport_widget(config) layout.addWidget(self.datos) btnBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) btnBox.accepted.connect(self.accept) btnBox.rejected.connect(self.reject) layout.addWidget(btnBox)
Example #28
Source File: UI_confThermo.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, config=None, parent=None): super(Dialog, self).__init__(parent) self.setWindowTitle(QtWidgets.QApplication.translate( "pychemqt", "Define project thermodynamic methods")) layout = QtWidgets.QVBoxLayout(self) self.datos = UI_confThermo_widget(config) layout.addWidget(self.datos) self.buttonBox = QtWidgets.QDialogButtonBox( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) layout.addWidget(self.buttonBox)
Example #29
Source File: main_gui.py From simnibs with GNU General Public License v3.0 | 5 votes |
def __init__(self, simulist): super(ConductivitiesGui, self).__init__() self.simulist = simulist mainLayout = QtWidgets.QVBoxLayout() self.setCondTable() self.tensorBox = self.setTensorThings() self.changeCondType() mainLayout.addWidget(self.condTable) mainLayout.addWidget(self.tensorBox) self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.button_box.accepted.connect(self.checkAndAccept) #self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) self.resetButton = QtWidgets.QPushButton("Reset") self.resetButton.clicked.connect(self.reset) self.button_box.addButton(self.resetButton, QtWidgets.QDialogButtonBox.ResetRole) mainLayout.addWidget(self.button_box) self.setLayout(mainLayout) self.setWindowTitle("Conductivities") self.resize(450,400)
Example #30
Source File: plot.py From pychemqt with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent=None): super(Plot, self).__init__(parent) gridLayout = QtWidgets.QGridLayout(self) self.plot=matplotlib() gridLayout.addWidget(self.plot,1,1,1,2) self.toolbar=NavigationToolbar2QT(self.plot, self.plot) gridLayout.addWidget(self.toolbar,2,1) self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Close) self.buttonBox.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) self.buttonBox.rejected.connect(self.reject) gridLayout.addWidget(self.buttonBox,2,2)