def setup_fit_options_table(self): self.fit_options_table.setRowCount(6) self.fit_options_table.setColumnCount(2) self.fit_options_table.setColumnWidth(0, 150) self.fit_options_table.setColumnWidth(1, 300) self.fit_options_table.verticalHeader().setVisible(False) self.fit_options_table.horizontalHeader().setStretchLastSection(True) self.fit_options_table.setHorizontalHeaderLabels( ("Property;Value").split(";")) table_utils.setRowName(self.fit_options_table, 0, "Time Start") self.time_start = table_utils.addDoubleToTable(self.fit_options_table, 0.0, 0, 1) table_utils.setRowName(self.fit_options_table, 1, "Time End") self.time_end = table_utils.addDoubleToTable(self.fit_options_table, 15.0, 1, 1) table_utils.setRowName(self.fit_options_table, 2, "Minimizer") self.minimizer_combo = table_utils.addComboToTable( self.fit_options_table, 2, []) self.minimizer_combo.addItems(allowed_minimizers) table_utils.setRowName(self.fit_options_table, 3, "Fit To Raw Data") self.fit_to_raw_data_checkbox = table_utils.addCheckBoxWidgetToTable( self.fit_options_table, True, 3) table_utils.setRowName(self.fit_options_table, 4, "TF Asymmetry Mode") self.tf_asymmetry_mode_checkbox = table_utils.addCheckBoxWidgetToTable( self.fit_options_table, False, 4) table_utils.setRowName(self.fit_options_table, 5, "Evaluate Function As") self.evaluation_combo = table_utils.addComboToTable( self.fit_options_table, 5, ['CentrePoint', 'Histogram'])
def setup_phase_table_options_table(self): self.phase_table_options_table.setColumnWidth(0, 300) self.phase_table_options_table.setColumnWidth(1, 300) # populate table options = [] table_utils.setRowName(self.phase_table_options_table, 0, "Workspace") self.input_workspace_combo_box = table_utils.addComboToTable( self.phase_table_options_table, 0, options) table_utils.setRowName(self.phase_table_options_table, 1, "Forward group") self.forward_group_combo = table_utils.addComboToTable( self.phase_table_options_table, 1, options) table_utils.setRowName(self.phase_table_options_table, 2, "Backward group") self.backward_group_combo = table_utils.addComboToTable( self.phase_table_options_table, 2, options) table_utils.setRowName(self.phase_table_options_table, 3, "First Good Data") self.first_good_data_item = table_utils.addDoubleToTable( self.phase_table_options_table, 0.1, 3) table_utils.setRowName(self.phase_table_options_table, 4, "Last Good Data") self.last_good_data_item = table_utils.addDoubleToTable( self.phase_table_options_table, 15.0, 4) table_utils.setRowName(self.phase_table_options_table, 5, "Output fit information") self.output_fit_info_box = table_utils.addCheckBoxToTable( self.phase_table_options_table, False, 5) self.phase_table_options_table.resizeRowsToContents() table_utils.setTableHeaders(self.phase_table_options_table) self.phase_quad_table.setColumnWidth(0, 300) self.phase_quad_table.setColumnWidth(1, 300) # self.calculate_phase_table_button = QtWidgets.QPushButton('Calculate Phase Table', self) table_utils.setRowName(self.phase_quad_table, 0, 'InputWorkspace') self.phase_quad_input_workspace_combo = table_utils.addComboToTable( self.phase_quad_table, 0, options) table_utils.setRowName(self.phase_quad_table, 1, 'PhaseTable') self.phase_quad_phase_table_combo = table_utils.addComboToTable( self.phase_quad_table, 1, options) self.phase_quad_table.resizeRowsToContents() # add to layout table_utils.setTableHeaders(self.phase_quad_table)
def setup_phase_table_options_table(self): self.phase_table_options_table.setColumnCount(2) self.phase_table_options_table.setColumnWidth(0, 300) self.phase_table_options_table.setColumnWidth(1, 300) self.phase_table_options_table.setRowCount(6) self.phase_table_options_table.setHorizontalHeaderLabels( ["Property", "Value"]) header = self.phase_table_options_table.horizontalHeader() header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents) header.setSectionResizeMode(1, QtWidgets.QHeaderView.Stretch) vertical_headers = self.phase_table_options_table.verticalHeader() vertical_headers.setSectionsMovable(False) vertical_headers.setSectionResizeMode( QtWidgets.QHeaderView.ResizeToContents) vertical_headers.setVisible(True) self.phase_table_options_table.horizontalHeaderItem(0).setToolTip("") self.phase_table_options_table.horizontalHeaderItem(1).setToolTip("") # populate table options = [] table_utils.setRowName(self.phase_table_options_table, 0, "Workspace") self.input_workspace_combo_box = table_utils.addComboToTable( self.phase_table_options_table, 0, options) table_utils.setRowName(self.phase_table_options_table, 1, "Forward group") self.forward_group_combo = table_utils.addComboToTable( self.phase_table_options_table, 1, options) table_utils.setRowName(self.phase_table_options_table, 2, "Backward group") self.backward_group_combo = table_utils.addComboToTable( self.phase_table_options_table, 2, options) table_utils.setRowName(self.phase_table_options_table, 3, "First Good Data") self.first_good_data_item, self.first_good_data_validator = table_utils.addDoubleToTable( self.phase_table_options_table, 0.1, 3) table_utils.setRowName(self.phase_table_options_table, 4, "Last Good Data") self.last_good_data_item, self.last_good_data_validator = table_utils.addDoubleToTable( self.phase_table_options_table, 15.0, 4) table_utils.setRowName(self.phase_table_options_table, 5, "Output fit information") self.output_fit_info_box = table_utils.addCheckBoxToTable( self.phase_table_options_table, False, 5)
def __init__(self, context, parent=None): super(ContextExampleView, self).__init__(parent) self.grid = QtGui.QGridLayout(self) self.table = QtGui.QTableWidget(self) self.table.resize(800, 800) self.table.setRowCount(2) self.table.setColumnCount(4) self.table.setColumnWidth(0, 300) self.table.setColumnWidth(1, 100) self.table.setColumnWidth(2, 100) self.table.setColumnWidth(3, 100) self.table.verticalHeader().setVisible(False) self.table.horizontalHeader().setStretchLastSection(True) self.table.setHorizontalHeaderLabels( ("Property;Value 1; Value 2; Value3").split(";")) # populate table # row of groups table_utils.setRowName(self.table, 0, "Groups") group_name = ["a", "b", "c"] self.ws0 = table_utils.addDoubleToTable(self.table, group_name[0], 0, 1) self.ws1 = table_utils.addDoubleToTable(self.table, group_name[1], 0, 2) self.ws2 = table_utils.addDoubleToTable(self.table, group_name[2], 0, 3) # row to describe a pair table_utils.setRowName(self.table, 1, "Pair") self.g1 = table_utils.addComboToTable(self.table, 1, group_name, 1) self.g2 = table_utils.addComboToTable(self.table, 1, group_name, 2) self.alpha = table_utils.addDoubleToTable(self.table, "2.", 1, 3) # explicit update button btn = QtGui.QPushButton("print context", self) # create grid self.grid.addWidget(self.table) self.grid.addWidget(btn) # add connections btn.clicked.connect(self.sendUpdateSignal) # needed for updating the possible pairs when groups change self.table.itemChanged.connect(self.groupChanged) # load values into GUI from context self.loadFromContext(context)
def setup_phase_table_options_table(self): self.phase_table_options_table.setColumnWidth(0, 300) self.phase_table_options_table.setColumnWidth(1, 300) # populate table options = [] table_utils.setRowName(self.phase_table_options_table, 0, "Workspace") self.input_workspace_combo_box = table_utils.addComboToTable(self.phase_table_options_table, 0, options) table_utils.setRowName(self.phase_table_options_table, 1, "Forward group") self.forward_group_combo = table_utils.addComboToTable(self.phase_table_options_table, 1, options) table_utils.setRowName(self.phase_table_options_table, 2, "Backward group") self.backward_group_combo = table_utils.addComboToTable(self.phase_table_options_table, 2, options) table_utils.setRowName(self.phase_table_options_table, 3, "First Good Data") self.first_good_data_item = table_utils.addDoubleToTable(self.phase_table_options_table, 0.1, 3) table_utils.setRowName(self.phase_table_options_table, 4, "Last Good Data") self.last_good_data_item = table_utils.addDoubleToTable(self.phase_table_options_table, 15.0, 4) table_utils.setRowName(self.phase_table_options_table, 5, "Output fit information") self.output_fit_info_box = table_utils.addCheckBoxToTable( self.phase_table_options_table, False, 5) self.phase_table_options_table.resizeRowsToContents() table_utils.setTableHeaders(self.phase_table_options_table) self.phase_quad_table.setColumnWidth(0, 300) self.phase_quad_table.setColumnWidth(1, 300) # self.calculate_phase_table_button = QtWidgets.QPushButton('Calculate Phase Table', self) table_utils.setRowName(self.phase_quad_table, 0, 'InputWorkspace') self.phase_quad_input_workspace_combo = table_utils.addComboToTable(self.phase_quad_table, 0, options) table_utils.setRowName(self.phase_quad_table, 1, 'PhaseTable') self.phase_quad_phase_table_combo = table_utils.addComboToTable(self.phase_quad_table, 1, options) self.phase_quad_table.resizeRowsToContents() # add to layout table_utils.setTableHeaders(self.phase_quad_table)
def _setup_fit_options_table(self) -> None: """Setup the fit options table with the appropriate options.""" self.fit_options_table.setRowCount(8) self.fit_options_table.setColumnCount(2) self.fit_options_table.setColumnWidth(0, 150) self.fit_options_table.verticalHeader().setVisible(False) self.fit_options_table.horizontalHeader().setStretchLastSection(True) self.fit_options_table.setHorizontalHeaderLabels(["Property", "Value"]) table_utils.setRowName(self.fit_options_table, START_X_TABLE_ROW, "Start X") self.start_x_line_edit, self.start_x_validator = table_utils.addDoubleToTable(self.fit_options_table, 0.0, START_X_TABLE_ROW, 1) table_utils.setRowName(self.fit_options_table, END_X_TABLE_ROW, "End X") self.end_x_line_edit, self.end_x_validator = table_utils.addDoubleToTable(self.fit_options_table, 15.0, END_X_TABLE_ROW, 1) table_utils.setRowName(self.fit_options_table, EXCLUDE_RANGE_TABLE_ROW, "Exclude Range") self.exclude_range_checkbox = table_utils.addCheckBoxWidgetToTable( self.fit_options_table, False, EXCLUDE_RANGE_TABLE_ROW) table_utils.setRowName(self.fit_options_table, EXCLUDE_START_X_TABLE_ROW, "Exclude Start X") self.exclude_start_x_line_edit, self.exclude_start_x_validator = table_utils.addDoubleToTable( self.fit_options_table, 15.0, EXCLUDE_START_X_TABLE_ROW, 1) table_utils.setRowName(self.fit_options_table, EXCLUDE_END_X_TABLE_ROW, "Exclude End X") self.exclude_end_x_line_edit, self.exclude_end_x_validator = table_utils.addDoubleToTable( self.fit_options_table, 15.0, EXCLUDE_END_X_TABLE_ROW, 1) table_utils.setRowName(self.fit_options_table, RAW_DATA_TABLE_ROW, "Fit To Raw Data") self.fit_to_raw_data_checkbox = table_utils.addCheckBoxWidgetToTable( self.fit_options_table, True, RAW_DATA_TABLE_ROW) table_utils.setRowName(self.fit_options_table, MINIMIZER_TABLE_ROW, "Minimizer") self.minimizer_combo = table_utils.addComboToTable(self.fit_options_table, MINIMIZER_TABLE_ROW, []) self.minimizer_combo.addItems(ALLOWED_MINIMIZERS) table_utils.setRowName(self.fit_options_table, EVALUATE_AS_TABLE_ROW, "Evaluate Function As") self.evaluation_combo = table_utils.addComboToTable(self.fit_options_table, EVALUATE_AS_TABLE_ROW, ['CentrePoint', 'Histogram'])
def __init__(self, parent=None): super(MaxEntView, self).__init__(parent) self.grid = QtGui.QVBoxLayout(self) # add splitter for resizing splitter = QtGui.QSplitter(QtCore.Qt.Vertical) self.run = None # make table self.table = QtGui.QTableWidget(self) self.table.resize(800, 800) self.table.setRowCount(11) self.table.setColumnCount(2) self.table.setColumnWidth(0, 300) self.table.setColumnWidth(1, 300) self.table.verticalHeader().setVisible(False) self.table.horizontalHeader().setStretchLastSection(True) self.table.setHorizontalHeaderLabels( ("MaxEnt Property;Value").split(";")) table_utils.setTableHeaders(self.table) # populate table options = ['test'] table_utils.setRowName(self.table, 0, "Workspace") self.ws = table_utils.addComboToTable(self.table, 0, options) table_utils.setRowName(self.table, 1, "First good time") self.first_good = table_utils.addDoubleToTable(self.table, 0.1, 1) table_utils.setRowName(self.table, 2, "Last good time") self.last_good = table_utils.addDoubleToTable(self.table, 15.0, 2) table_utils.setRowName(self.table, 3, "Fit dead times") self.dead_box = table_utils.addCheckBoxToTable(self.table, True, 3) table_utils.setRowName(self.table, 4, "Use Phase Table") self.use_phaseTable_box = table_utils.addCheckBoxToTable( self.table, False, 4) table_utils.setRowName(self.table, 5, "Select Phase Table") options = [construct] self.phaseTable_box = table_utils.addComboToTable( self.table, 5, options) table_utils.setRowName(self.table, 6, "Fix phases") self.fix_phase_box = table_utils.addCheckBoxToTable( self.table, False, 6) self.table.hideRow(5) self.table.hideRow(6) table_utils.setRowName(self.table, 7, "Output phase table") self.output_phase_box = table_utils.addCheckBoxToTable( self.table, False, 7) table_utils.setRowName(self.table, 8, "Output deadtimes") self.output_dead_box = table_utils.addCheckBoxToTable( self.table, False, 8) table_utils.setRowName(self.table, 9, "Output reconstructed data") self.output_data_box = table_utils.addCheckBoxToTable( self.table, False, 9) table_utils.setRowName(self.table, 10, "Output phase convergence") self.output_phase_evo_box = table_utils.addCheckBoxToTable( self.table, False, 10) self.table.resizeRowsToContents() # advanced options table self.advancedLabel = QtGui.QLabel("\n Advanced Options") # make table self.tableA = QtGui.QTableWidget(self) self.tableA.resize(800, 800) self.tableA.setRowCount(7) self.tableA.setColumnCount(2) self.tableA.setColumnWidth(0, 300) self.tableA.setColumnWidth(1, 300) self.tableA.verticalHeader().setVisible(False) self.tableA.horizontalHeader().setStretchLastSection(True) self.tableA.setHorizontalHeaderLabels( ("Advanced Property;Value").split(";")) table_utils.setTableHeaders(self.tableA) table_utils.setRowName(self.tableA, 0, "Maximum entropy constant (A)") self.AConst = table_utils.addDoubleToTable(self.tableA, 0.1, 0) table_utils.setRowName(self.tableA, 1, "Lagrange multiplier for chi^2") self.factor = table_utils.addDoubleToTable(self.tableA, 1.04, 1) table_utils.setRowName(self.tableA, 2, "Inner Iterations") self.inner_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 2) table_utils.setRowName(self.tableA, 3, "Outer Iterations") self.outer_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 3) table_utils.setRowName(self.tableA, 4, "Double pulse data") self.double_pulse_box = table_utils.addCheckBoxToTable( self.tableA, False, 4) table_utils.setRowName(self.tableA, 5, "Number of data points") self.N_points = table_utils.addComboToTable(self.tableA, 5, options) table_utils.setRowName(self.tableA, 6, "Maximum Field ") self.max_field = table_utils.addDoubleToTable(self.tableA, 1000.0, 6) # layout # this is if complex data is unhidden self.table.setMinimumSize(40, 203) self.tableA.setMinimumSize(40, 207) # make buttons self.button = QtGui.QPushButton('Calculate MaxEnt', self) self.button.setStyleSheet("background-color:lightgrey") self.cancel = QtGui.QPushButton('Cancel', self) self.cancel.setStyleSheet("background-color:lightgrey") self.cancel.setEnabled(False) # connects self.button.clicked.connect(self.MaxEntButtonClick) self.cancel.clicked.connect(self.cancelClick) self.table.cellClicked.connect(self.phaseBoxClick) # button layout self.buttonLayout = QtGui.QHBoxLayout() self.buttonLayout.addWidget(self.button) self.buttonLayout.addWidget(self.cancel) # add to layout splitter.addWidget(self.table) splitter.addWidget(self.advancedLabel) splitter.addWidget(self.tableA) self.grid.addWidget(splitter) self.grid.addLayout(self.buttonLayout)
def __init__(self, parent=None): super(FFTView, self).__init__(parent) self.grid = QtWidgets.QGridLayout(self) # add splitter for resizing splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) # make table self.FFTTable = QtWidgets.QTableWidget(self) self.FFTTable.resize(800, 800) self.FFTTable.setRowCount(6) self.FFTTable.setColumnCount(2) self.FFTTable.setColumnWidth(0, 300) self.FFTTable.setColumnWidth(1, 300) self.FFTTable.verticalHeader().setVisible(False) self.FFTTable.horizontalHeader().setStretchLastSection(True) self.FFTTable.setHorizontalHeaderLabels( ("FFT Property;Value").split(";")) # populate table options = ['test'] table_utils.setRowName(self.FFTTable, 0, "Workspace") self.ws = table_utils.addComboToTable(self.FFTTable, 0, options) self.Im_box_row = 1 table_utils.setRowName( self.FFTTable, self.Im_box_row, "Imaginary Data") self.Im_box = table_utils.addCheckBoxToTable( self.FFTTable, True, self.Im_box_row) table_utils.setRowName(self.FFTTable, 2, "Imaginary Workspace") self.Im_ws = table_utils.addComboToTable(self.FFTTable, 2, options) self.shift_box_row = 3 table_utils.setRowName(self.FFTTable, self.shift_box_row, "Auto shift") self.shift_box = table_utils.addCheckBoxToTable( self.FFTTable, True, self.shift_box_row) table_utils.setRowName(self.FFTTable, 4, "Shift") self.shift = table_utils.addDoubleToTable(self.FFTTable, 0.0, 4) self.FFTTable.hideRow(4) table_utils.setRowName(self.FFTTable, 5, "Use Raw data") self.Raw_box = table_utils.addCheckBoxToTable(self.FFTTable, True, 5) self.FFTTable.resizeRowsToContents() # make advanced table options self.advancedLabel = QtWidgets.QLabel("\n Advanced Options") self.FFTTableA = QtWidgets.QTableWidget(self) self.FFTTableA.resize(800, 800) self.FFTTableA.setRowCount(4) self.FFTTableA.setColumnCount(2) self.FFTTableA.setColumnWidth(0, 300) self.FFTTableA.setColumnWidth(1, 300) self.FFTTableA.verticalHeader().setVisible(False) self.FFTTableA.horizontalHeader().setStretchLastSection(True) self.FFTTableA.setHorizontalHeaderLabels( ("Advanced Property;Value").split(";")) table_utils.setRowName(self.FFTTableA, 0, "Apodization Function") options = ["Lorentz", "Gaussian", "None"] self.apodization = table_utils.addComboToTable( self.FFTTableA, 0, options) table_utils.setRowName( self.FFTTableA, 1, "Decay Constant (micro seconds)") self.decay = table_utils.addDoubleToTable(self.FFTTableA, 4.4, 1) table_utils.setRowName(self.FFTTableA, 2, "Negative Padding") self.negativePadding = table_utils.addCheckBoxToTable( self.FFTTableA, True, 2) table_utils.setRowName(self.FFTTableA, 3, "Padding") self.padding = table_utils.addSpinBoxToTable(self.FFTTableA, 1, 3) self.FFTTableA.resizeRowsToContents() # make button self.button = QtWidgets.QPushButton('Calculate FFT', self) self.button.setStyleSheet("background-color:lightgrey") # connects self.FFTTable.cellClicked.connect(self.tableClick) self.button.clicked.connect(self.buttonClick) self.ws.currentIndexChanged.connect(self.phaseCheck) # add to layout self.FFTTable.setMinimumSize(40, 158) self.FFTTableA.setMinimumSize(40, 127) table_utils.setTableHeaders(self.FFTTable) table_utils.setTableHeaders(self.FFTTableA) # add to layout splitter.addWidget(self.FFTTable) splitter.addWidget(self.advancedLabel) splitter.addWidget(self.FFTTableA) self.grid.addWidget(splitter) self.grid.addWidget(self.button)
def __init__(self, parent=None): super(MaxEntView, self).__init__(parent) self.grid = QtGui.QVBoxLayout(self) # add splitter for resizing splitter = QtGui.QSplitter(QtCore.Qt.Vertical) self.run = None # make table self.table = QtGui.QTableWidget(self) self.table.resize(800, 800) self.table.setRowCount(11) self.table.setColumnCount(2) self.table.setColumnWidth(0, 300) self.table.setColumnWidth(1, 300) self.table.verticalHeader().setVisible(False) self.table.horizontalHeader().setStretchLastSection(True) self.table.setHorizontalHeaderLabels( ("MaxEnt Property;Value").split(";")) table_utils.setTableHeaders(self.table) # populate table options = ['test'] table_utils.setRowName(self.table, 0, "Workspace") self.ws = table_utils.addComboToTable(self.table, 0, options) table_utils.setRowName(self.table, 1, "First good time") self.first_good = table_utils.addDoubleToTable(self.table, 0.1, 1) table_utils.setRowName(self.table, 2, "Last good time") self.last_good = table_utils.addDoubleToTable(self.table, 15.0, 2) table_utils.setRowName(self.table, 3, "Fit dead times") self.dead_box = table_utils.addCheckBoxToTable(self.table, True, 3) table_utils.setRowName(self.table, 4, "Use Phase Table") self.use_phaseTable_box = table_utils.addCheckBoxToTable( self.table, False, 4) table_utils.setRowName(self.table, 5, "Construct Phase Table") self.phaseTable_box = table_utils.addCheckBoxToTable( self.table, True, 5) table_utils.setRowName(self.table, 6, "Fix phases") self.fix_phase_box = table_utils.addCheckBoxToTable( self.table, False, 6) self.table.hideRow(5) self.table.hideRow(6) table_utils.setRowName(self.table, 7, "Output phase table") self.output_phase_box = table_utils.addCheckBoxToTable( self.table, False, 7) table_utils.setRowName(self.table, 8, "Output deadtimes") self.output_dead_box = table_utils.addCheckBoxToTable( self.table, False, 8) table_utils.setRowName(self.table, 9, "Output reconstructed data") self.output_data_box = table_utils.addCheckBoxToTable( self.table, False, 9) table_utils.setRowName(self.table, 10, "Output phase convergence") self.output_phase_evo_box = table_utils.addCheckBoxToTable( self.table, False, 10) self.table.resizeRowsToContents() # advanced options table self.advancedLabel = QtGui.QLabel("\n Advanced Options") # make table self.tableA = QtGui.QTableWidget(self) self.tableA.resize(800, 800) self.tableA.setRowCount(7) self.tableA.setColumnCount(2) self.tableA.setColumnWidth(0, 300) self.tableA.setColumnWidth(1, 300) self.tableA.verticalHeader().setVisible(False) self.tableA.horizontalHeader().setStretchLastSection(True) self.tableA.setHorizontalHeaderLabels( ("Advanced Property;Value").split(";")) table_utils.setTableHeaders(self.tableA) table_utils.setRowName(self.tableA, 0, "Maximum entropy constant (A)") self.AConst = table_utils.addDoubleToTable(self.tableA, 0.1, 0) table_utils.setRowName(self.tableA, 1, "Lagrange multiplier for chi^2") self.factor = table_utils.addDoubleToTable(self.tableA, 1.04, 1) table_utils.setRowName(self.tableA, 2, "Inner Iterations") self.inner_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 2) table_utils.setRowName(self.tableA, 3, "Outer Iterations") self.outer_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 3) table_utils.setRowName(self.tableA, 4, "Double pulse data") self.double_pulse_box = table_utils.addCheckBoxToTable( self.tableA, False, 4) table_utils.setRowName(self.tableA, 5, "Number of data points") self.N_points = table_utils.addComboToTable(self.tableA, 5, options) table_utils.setRowName(self.tableA, 6, "Maximum Field ") self.max_field = table_utils.addDoubleToTable(self.tableA, 1000.0, 6) # layout # this is if complex data is unhidden self.table.setMinimumSize(40, 203) self.tableA.setMinimumSize(40, 207) # make buttons self.button = QtGui.QPushButton('Calculate MaxEnt', self) self.button.setStyleSheet("background-color:lightgrey") self.cancel = QtGui.QPushButton('Cancel', self) self.cancel.setStyleSheet("background-color:lightgrey") self.cancel.setEnabled(False) # connects self.button.clicked.connect(self.MaxEntButtonClick) self.cancel.clicked.connect(self.cancelClick) self.table.cellClicked.connect(self.phaseBoxClick) # button layout self.buttonLayout = QtGui.QHBoxLayout() self.buttonLayout.addWidget(self.button) self.buttonLayout.addWidget(self.cancel) # add to layout splitter.addWidget(self.table) splitter.addWidget(self.advancedLabel) splitter.addWidget(self.tableA) self.grid.addWidget(splitter) self.grid.addLayout(self.buttonLayout)