def __init__(self, swappers): QMessageBox.__init__(self) decorateWindow(self, i18n("Swap Seats")) self.setText( i18n("By the rules, %1 and %2 should now exchange their seats. ", swappers[0].name, swappers[1].name)) self.yesAnswer = QPushButton(i18n("&Exchange")) self.addButton(self.yesAnswer, QMessageBox.YesRole) self.noAnswer = QPushButton(i18n("&Keep seat")) self.addButton(self.noAnswer, QMessageBox.NoRole)
def __init__(self): super(OuterCaller, self).__init__() v_box = QVBoxLayout() recip_lat_but = QPushButton("\n Open Reciprocal Lattice Viewer \n") recip_lat_but.clicked.connect(self.run_recip_dialg) v_box.addWidget(recip_lat_but) img_but = QPushButton("\n Open Image Viewer \n") img_but.clicked.connect(self.run_img_dialg) v_box.addWidget(img_but) self.diag = ExternalProcDialog(parent=self.window()) self.setLayout(v_box)
def __init__(self, parent=None): super(ImportPage, self).__init__(parent=None) main_v_box = QVBoxLayout() label_font = QFont() sys_font_point_size = label_font.pointSize() label_font.setPointSize(sys_font_point_size + 2) step_label = QLabel(str("Import")) step_label.setFont(label_font) self.simple_lin = QLineEdit(self) self.simple_lin.textChanged.connect(self.update_command) self.x_spn_bx = QSpinBox() self.x_spn_bx.setMaximum(99999) self.x_spn_bx.setSpecialValueText(" ") self.y_spn_bx = QSpinBox() self.y_spn_bx.setMaximum(99999) self.y_spn_bx.setSpecialValueText(" ") self.x_spn_bx.valueChanged.connect(self.x_beam_changed) self.y_spn_bx.valueChanged.connect(self.y_beam_changed) self.chk_invert = QCheckBox("Invert rotation axis") self.chk_invert.stateChanged.connect(self.inv_rota_changed) self.opn_fil_btn = QPushButton(" \n Select file(s) \n ") main_path = get_main_path() self.opn_fil_btn.setIcon(QIcon(main_path + "/resources/import.png")) self.opn_fil_btn.setIconSize(QSize(80, 48)) main_v_box.addWidget(step_label) main_v_box.addWidget(self.opn_fil_btn) main_v_box.addWidget(self.simple_lin) self.b_cetre_label = QLabel("\n\n Beam centre") main_v_box.addWidget(self.b_cetre_label) cent_hbox = QHBoxLayout() self.x_label = QLabel(" X: ") cent_hbox.addWidget(self.x_label) cent_hbox.addWidget(self.x_spn_bx) self.y_label = QLabel(" Y: ") cent_hbox.addWidget(self.y_label) cent_hbox.addWidget(self.y_spn_bx) # cent_hbox.addWidget(QLabel(" \n ")) cent_hbox.addStretch() main_v_box.addLayout(cent_hbox) main_v_box.addWidget(self.chk_invert) main_v_box.addStretch() self.opn_fil_btn.clicked.connect(self.open_files) self.defa_dir = str(os.getcwd()) self.setLayout(main_v_box) # self.show() self.reset_par()
def setup(self): showPlusServerWidget = True if _platform == "linux" or _platform == "linux2" or _platform == "darwin": #linux or linux or OS X message = "Attention: You are running Slicer on Linux or OS X. Do you have PlusServer installed on the current OS?" result = QMessageBox.question(slicer.util.mainWindow(), 'ProstateTRUSNav', message, QMessageBox.Yes | QMessageBox.No) showPlusServerWidget = result == QMessageBox.Yes if _platform == "win32" or showPlusServerWidget: # Windows... plusServerCollapsibleButton = ctkCollapsibleButton() plusServerCollapsibleButton.text = "PlusServer" self.layout.addWidget(plusServerCollapsibleButton) self.configurationFileChooserButton = QPushButton( self.configurationFile) self.configurationFileChooserButton.connect( 'clicked()', self.onConfigFileSelected) self.runPlusServerButton = QPushButton("Run PlusServer") self.runPlusServerButton.setCheckable(True) self.runPlusServerButton.connect('clicked()', self.onRunPlusServerButtonClicked) self.serverFormLayout = QFormLayout(plusServerCollapsibleButton) self.serverExecutableChooserButton = QPushButton( self.serverExecutable) self.serverExecutableChooserButton.connect( 'clicked()', self.onServerExecutableSelected) hbox = QHBoxLayout() hbox.addWidget(self.serverExecutableChooserButton) self.serverFormLayout.addRow(hbox) hbox = QHBoxLayout() hbox.addWidget(self.configurationFileChooserButton) hbox.addWidget(self.runPlusServerButton) self.serverFormLayout.addRow(hbox) GuideletWidget.setup(self) # do specific setup here if _platform == "win32" or showPlusServerWidget: self.launchGuideletButton.setEnabled(False) self.checkExecutableAndArgument()
def __init__(self, parent=None): super(StopRunRetry, self).__init__() main_path = get_main_path() ctrl_box = QHBoxLayout() self.repeat_btn = QPushButton("\n Retry \n", self) re_try_icon_path = str(main_path + "/resources/re_try.png") re_try_grayed_path = str(main_path + "/resources/re_try_grayed.png") tmp_ico = QIcon() tmp_ico.addFile(re_try_icon_path, mode=QIcon.Normal) tmp_ico.addFile(re_try_grayed_path, mode=QIcon.Disabled) self.repeat_btn.setIcon(tmp_ico) self.repeat_btn.setIconSize(QSize(50, 38)) ctrl_box.addWidget(self.repeat_btn) self.run_btn = QPushButton("\n Run \n", self) self.dials_logo_path = str( main_path + "/resources/DIALS_Logo_smaller_centred.png" ) dials_grayed_path = str( main_path + "/resources/DIALS_Logo_smaller_centred_grayed.png" ) tmp_ico = QIcon() tmp_ico.addFile(self.dials_logo_path, mode=QIcon.Normal) tmp_ico.addFile(dials_grayed_path, mode=QIcon.Disabled) self.run_btn.setIcon(tmp_ico) self.run_btn.setIconSize(QSize(50, 50)) ctrl_box.addWidget(self.run_btn) self.stop_btn = QPushButton("\n Stop \n", self) stop_logo_path = str(main_path + "/resources/stop.png") stop_grayed_path = str(main_path + "/resources/stop_grayed.png") tmp_ico = QIcon() tmp_ico.addFile(stop_logo_path, mode=QIcon.Normal) tmp_ico.addFile(stop_grayed_path, mode=QIcon.Disabled) self.stop_btn.setIcon(tmp_ico) self.stop_btn.setIconSize(QSize(50, 38)) ctrl_box.addWidget(self.stop_btn) self.setLayout(ctrl_box)
def setupUi(self): """layout the window""" decorateWindow(self, i18n('Customize rulesets')) self.setObjectName('Rulesets') hlayout = QHBoxLayout(self) v1layout = QVBoxLayout() self.v1widget = QWidget() v1layout = QVBoxLayout(self.v1widget) v2layout = QVBoxLayout() hlayout.addWidget(self.v1widget) hlayout.addLayout(v2layout) for widget in [self.v1widget, hlayout, v1layout, v2layout]: widget.setContentsMargins(0, 0, 0, 0) hlayout.setStretchFactor(self.v1widget, 10) self.btnCopy = QPushButton() self.btnRemove = QPushButton() self.btnCompare = QPushButton() self.btnClose = QPushButton() self.rulesetView = RuleTreeView( i18ncE('kajongg', 'Rule'), self.btnCopy, self.btnRemove, self.btnCompare) v1layout.addWidget(self.rulesetView) self.rulesetView.setWordWrap(True) self.rulesetView.setMouseTracking(True) spacerItem = QSpacerItem( 20, 20, QSizePolicy.Minimum, QSizePolicy.Expanding) v2layout.addWidget(self.btnCopy) v2layout.addWidget(self.btnRemove) v2layout.addWidget(self.btnCompare) self.btnCopy.clicked.connect(self.rulesetView.copyRow) self.btnRemove.clicked.connect(self.rulesetView.removeRow) self.btnCompare.clicked.connect(self.rulesetView.compareRow) self.btnClose.clicked.connect(self.hide) v2layout.addItem(spacerItem) v2layout.addWidget(self.btnClose) self.retranslateUi() StateSaver(self) self.show()
def __init__(self, scene): QWidget.__init__(self) self.scene = scene decorateWindow(self, i18n('Scoring for this Hand')) self.nameLabels = [None] * 4 self.spValues = [None] * 4 self.windLabels = [None] * 4 self.wonBoxes = [None] * 4 self.detailsLayout = [None] * 4 self.details = [None] * 4 self.__tilePixMaps = [] self.__meldPixMaps = [] grid = QGridLayout(self) pGrid = QGridLayout() grid.addLayout(pGrid, 0, 0, 2, 1) pGrid.addWidget(QLabel(i18nc('kajongg', "Player")), 0, 0) pGrid.addWidget(QLabel(i18nc('kajongg', "Wind")), 0, 1) pGrid.addWidget(QLabel(i18nc('kajongg', 'Score')), 0, 2) pGrid.addWidget(QLabel(i18n("Winner")), 0, 3) self.detailTabs = QTabWidget() self.detailTabs.setDocumentMode(True) pGrid.addWidget(self.detailTabs, 0, 4, 8, 1) for idx in range(4): self.setupUiForPlayer(pGrid, idx) self.draw = QCheckBox(i18nc('kajongg', 'Draw')) self.draw.clicked.connect(self.wonChanged) btnPenalties = QPushButton(i18n("&Penalties")) btnPenalties.clicked.connect(self.penalty) self.btnSave = QPushButton(i18n('&Save Hand')) self.btnSave.clicked.connect(self.game.nextScoringHand) self.btnSave.setEnabled(False) self.setupUILastTileMeld(pGrid) pGrid.setRowStretch(87, 10) pGrid.addWidget(self.draw, 7, 3) self.cbLastTile.currentIndexChanged.connect(self.slotLastTile) self.cbLastMeld.currentIndexChanged.connect(self.slotInputChanged) btnBox = QHBoxLayout() btnBox.addWidget(btnPenalties) btnBox.addWidget(self.btnSave) pGrid.addLayout(btnBox, 8, 4) StateSaver(self) self.refresh()
def setupFrameControlFrame(self): # TODO: initialize the slider based on the contents of the labels array self.frameSlider = ctk.ctkSliderWidget() self.frameLabel = QLabel('Current frame number') self.playButton = QPushButton('Play') self.playButton.toolTip = 'Iterate over multivolume frames' self.playButton.checkable = True frameControlHBox = QHBoxLayout() frameControlHBox.addWidget(self.frameLabel) frameControlHBox.addWidget(self.frameSlider) frameControlHBox.addWidget(self.playButton) self.inputFrameLayout.addRow(frameControlHBox)
def setupPlottingFrame(self, parent=None): if not parent: parent = self.layout self.plottingFrameWidget = QWidget() self.plottingFrameLayout = QGridLayout() self.plottingFrameWidget.setLayout(self.plottingFrameLayout) self._multiVolumeIntensityChart = MultiVolumeIntensityChartView() self.popupChartButton = QPushButton("Undock chart") self.popupChartButton.setCheckable(True) self.plottingFrameLayout.addWidget(self._multiVolumeIntensityChart.chartView) self.plottingFrameLayout.addWidget(self.popupChartButton) parent.addWidget(self.plottingFrameWidget)
def set_ref(self, in_json_path, lin_num): my_box = QVBoxLayout() self.my_inner_table = ReindexTable(self) cwd_path = os.path.join(sys_arg.directory, "dui_files") full_json_path = os.path.join(cwd_path, in_json_path) self.my_inner_table.add_opts_lst(json_path=full_json_path) if self.my_inner_table.rec_col is not None: my_solu = self.my_inner_table.find_best_solu() self.my_inner_table.opt_clicked(my_solu, 0) recomd_str = "Select a bravais lattice to enforce: \n" try: recomd_str += "(best guess solution = row {})".format( self.my_inner_table.tmp_sel + 1) except BaseException as e: # Since we don't know exactly what this was supposed to be # - AttributeError? We don't know how to cleanly catch logger.error("Unknown exception catch caught. Was: %s", e) recomd_str += "(no best solution could be automatically determined)" bot_box = QHBoxLayout() bot_box.addWidget(QLabel(recomd_str)) bot_box.addStretch() ok_but = QPushButton(" OK ") ok_but.clicked.connect(self.my_inner_table.ok_clicked) bot_box.addWidget(ok_but) heather_text, v_heather_size = heather_text_from_lin( lin_num, full_json_path) my_box.addWidget(QLabel(heather_text)) my_box.addWidget(self.my_inner_table) my_box.addLayout(bot_box) self.setLayout(my_box) n_col = self.my_inner_table.columnCount() tot_width = 80 for col in range(n_col): loc_width = self.my_inner_table.columnWidth(col) tot_width += loc_width n_row = self.my_inner_table.rowCount() row_height = self.my_inner_table.rowHeight(1) tot_heght = int((float(n_row)) * float(row_height)) tot_heght += int( (float(v_heather_size + 2)) * float(row_height * 0.62)) self.resize(tot_width, tot_heght) # self.adjustSize() self.show()
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.btn1 = QPushButton("Click me", self) vbox = QVBoxLayout() vbox.addWidget(QLabel("A1")) vbox.addWidget(self.btn1) vbox.addWidget(QLabel("B2")) self.btn1.clicked.connect(self.doit) self.my_pop = None self.main_widget = QWidget(self) self.main_widget.setLayout(vbox) self.setCentralWidget(self.main_widget)
def __init__(self, parent=None): super(ExternalProcDialog, self).__init__(parent) vbox = QVBoxLayout() label = QLabel(("Running a pop-up viewer ...\n\n" "remember to close the viewer before\n" "performing any other task")) label.setAlignment(Qt.AlignCenter) vbox.addWidget(label) kl_but = QPushButton("Close pop-up viewer") kl_but.clicked.connect(self.kill_my_proc) vbox.addWidget(kl_but) self.setLayout(vbox) self.setFixedSize(self.sizeHint()) self.setModal(True) self.setWindowTitle("External Tool") self.my_process = None
def SimpleButton(parent, title, handler, page=None, image=None): tabpage = parent.getPage(page) button = QPushButton(tabpage) if image: bi = QPixmap() bi.loadFromData(image, "PNG") button.setIconSet(QIconSet(bi)) w = bi.width() + 3 h = bi.height() + 3 if w < 32: w = 32 if h < 32: h = 32 button.setMaximumSize(QSize(w, h)) else: button.setText(title) QToolTip.add(button, title) parent.connect(button, SIGNAL("clicked()"), handler) button.show() p = ToolbarPlugin(parent) p.getWidget = lambda: button
def setupFrameControlFrame(self): qSlicerMultiVolumeExplorerSimplifiedModuleWidget.setupFrameControlFrame( self) self.frameCopySelector = slicer.qMRMLNodeComboBox() self.frameCopySelector.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Preferred) self.frameCopySelector.nodeTypes = ['vtkMRMLScalarVolumeNode'] self.frameCopySelector.setMRMLScene(slicer.mrmlScene) self.frameCopySelector.addEnabled = 1 self.frameCopySelector.enabled = 0 # do not show "children" of vtkMRMLScalarVolumeNode self.frameCopySelector.hideChildNodeTypes = [ "vtkMRMLDiffusionWeightedVolumeNode", "vtkMRMLDiffusionTensorVolumeNode", "vtkMRMLVectorVolumeNode" ] self.extractFrameCopy = False self.extractFrameCheckBox = QCheckBox('Enable copying while sliding') hbox = QHBoxLayout() hbox.addWidget(QLabel('Current frame copy')) hbox.addWidget(self.frameCopySelector) hbox.addWidget(self.extractFrameCheckBox) self.inputFrameLayout.addRow(hbox) self.currentFrameCopySelector = slicer.qMRMLNodeComboBox() self.currentFrameCopySelector.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Preferred) self.currentFrameCopySelector.nodeTypes = ['vtkMRMLScalarVolumeNode'] self.currentFrameCopySelector.setMRMLScene(slicer.mrmlScene) self.currentFrameCopySelector.addEnabled = 0 self.currentFrameCopySelector.enabled = 0 self.currentFrameCopyButton = QPushButton('Copy frame') self.currentFrameCopyButton.toolTip = 'Copy currently selected frame' hbox2 = QHBoxLayout() hbox2.addWidget(QLabel('Current frame click-to-copy')) hbox2.addWidget(self.currentFrameCopySelector) hbox2.addWidget(self.currentFrameCopyButton) self.inputFrameLayout.addRow(hbox2)
def __init__(self, phl_obj=None, parent=None): super(ParamAdvancedWidget, self).__init__() self.scrollable_widget = PhilWidget(phl_obj, parent=self) scrollArea = QScrollArea() scrollArea.setWidget(self.scrollable_widget) vbox = QVBoxLayout() search_label = QLabel("Search:") search_edit = QLineEdit() search_edit.setPlaceholderText("Type search here") search_edit.textChanged.connect(self.scrollable_widget.user_searching) self.search_next_button = QPushButton("Find next") self.search_next_button.setEnabled(False) hbox = QHBoxLayout() hbox.addWidget(search_label) hbox.addWidget(search_edit) hbox.addWidget(self.search_next_button) self.search_next_button.clicked.connect(self.scrollable_widget.find_next) vbox.addLayout(hbox) vbox.addWidget(scrollArea) self.setLayout(vbox)
def setupPlotSettingsFrame(self): self.plotSettingsFrame = ctk.ctkCollapsibleButton() self.plotSettingsFrame.text = "Plotting Settings" self.plotSettingsFrame.collapsed = 1 plotSettingsFrameLayout = QFormLayout(self.plotSettingsFrame) self.layout.addWidget(self.plotSettingsFrame) # label map for probing self.labelMapSelector = slicer.qMRMLNodeComboBox() self.labelMapSelector.nodeTypes = ['vtkMRMLLabelMapVolumeNode'] self.labelMapSelector.toolTip = 'Label map to be probed' self.labelMapSelector.setMRMLScene(slicer.mrmlScene) self.labelMapSelector.addEnabled = 0 self.chartButton = QPushButton('Chart') self.chartButton.setEnabled(False) hbox = QHBoxLayout() hbox.addWidget(QLabel('Probed label volume')) hbox.addWidget(self.labelMapSelector) hbox.addWidget(self.chartButton) plotSettingsFrameLayout.addRow(hbox) self.iCharting = QCheckBox('Interactive charting') self.iCharting.setChecked(True) plotSettingsFrameLayout.addRow(self.iCharting) self.iChartingMode = QButtonGroup() self.iChartingIntensity = QRadioButton('Signal intensity') self.iChartingIntensityFixedAxes = QRadioButton( 'Fixed range intensity') self.iChartingPercent = QRadioButton('Percentage change') self.iChartingIntensity.setChecked(1) self.iChartingMode.addButton(self.iChartingIntensity) self.iChartingMode.addButton(self.iChartingIntensityFixedAxes) self.iChartingMode.addButton(self.iChartingPercent) hbox = QHBoxLayout() self.plottingModeGroupBox = QGroupBox('Plotting mode:') plottingModeLayout = QVBoxLayout() self.plottingModeGroupBox.setLayout(plottingModeLayout) plottingModeLayout.addWidget(self.iChartingIntensity) plottingModeLayout.addWidget(self.iChartingIntensityFixedAxes) plottingModeLayout.addWidget(self.iChartingPercent) hbox.addWidget(self.plottingModeGroupBox) self.showLegendCheckBox = QCheckBox('Display legend') self.showLegendCheckBox.setChecked(0) self.xLogScaleCheckBox = QCheckBox('Use log scale for X axis') self.xLogScaleCheckBox.setChecked(0) self.yLogScaleCheckBox = QCheckBox('Use log scale for Y axis') self.yLogScaleCheckBox.setChecked(0) self.plotGeneralSettingsGroupBox = QGroupBox('General Plot options:') plotGeneralSettingsLayout = QVBoxLayout() self.plotGeneralSettingsGroupBox.setLayout(plotGeneralSettingsLayout) plotGeneralSettingsLayout.addWidget(self.showLegendCheckBox) plotGeneralSettingsLayout.addWidget(self.xLogScaleCheckBox) plotGeneralSettingsLayout.addWidget(self.yLogScaleCheckBox) hbox.addWidget(self.plotGeneralSettingsGroupBox) plotSettingsFrameLayout.addRow(hbox) self.nFramesBaselineCalculation = QSpinBox() self.nFramesBaselineCalculation.minimum = 1 hbox = QHBoxLayout() hbox.addWidget(QLabel('Frame count(baseline calculation):')) hbox.addWidget(self.nFramesBaselineCalculation) plotSettingsFrameLayout.addRow(hbox)
def setupPanel(self, parentWidget): logging.debug('ProstateTRUSNavUltrasound.setupPanel') self.connectorNode = self.guideletParent.connectorNode self.connectorNodeConnected = False collapsibleButton = ctkCollapsibleButton() collapsibleButton.setProperty('collapsedHeight', 20) setButtonStyle(collapsibleButton, 2.0) collapsibleButton.text = "Ultrasound" parentWidget.addWidget(collapsibleButton) ultrasoundLayout = QFormLayout(collapsibleButton) ultrasoundLayout.setContentsMargins(12, 4, 4, 4) ultrasoundLayout.setSpacing(4) self.connectDisconnectButton = QPushButton("Connect") self.connectDisconnectButton.setToolTip( "If clicked, connection OpenIGTLink") hbox = QHBoxLayout() hbox.addWidget(self.connectDisconnectButton) ultrasoundLayout.addRow(hbox) self.setupIcons() self.captureIDSelector = QComboBox() self.captureIDSelector.setToolTip("Pick capture device ID") self.captureIDSelector.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.volumeReconstructorIDSelector = QComboBox() self.volumeReconstructorIDSelector.setToolTip( "Pick volume reconstructor device ID") self.volumeReconstructorIDSelector.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Expanding) self.startStopRecordingButton = QPushButton(" Start Recording") self.startStopRecordingButton.setCheckable(True) self.startStopRecordingButton.setIcon(self.recordIcon) self.startStopRecordingButton.setEnabled(False) self.startStopRecordingButton.setToolTip("If clicked, start recording") self.startStopRecordingButton.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) recordParametersControlsLayout = QGridLayout() self.filenameLabel = self.createLabel("Filename:", visible=False) recordParametersControlsLayout.addWidget(self.filenameLabel, 1, 0) # Offline Reconstruction self.offlineReconstructButton = QPushButton(" Offline Reconstruction") self.offlineReconstructButton.setCheckable(True) self.offlineReconstructButton.setIcon(self.recordIcon) self.offlineReconstructButton.setEnabled(False) self.offlineReconstructButton.setToolTip( "If clicked, reconstruct recorded volume") self.offlineReconstructButton.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.offlineVolumeToReconstructSelector = QComboBox() self.offlineVolumeToReconstructSelector.setEditable(True) self.offlineVolumeToReconstructSelector.setToolTip( "Pick/set volume to reconstruct") self.offlineVolumeToReconstructSelector.visible = False hbox = QHBoxLayout() hbox.addWidget(self.startStopRecordingButton) hbox.addWidget(self.offlineReconstructButton) ultrasoundLayout.addRow(hbox) # Scout scan (record and low resolution reconstruction) and live reconstruction # Scout scan part self.startStopScoutScanButton = QPushButton( " Scout scan\n Start recording") self.startStopScoutScanButton.setCheckable(True) self.startStopScoutScanButton.setIcon(self.recordIcon) self.startStopScoutScanButton.setToolTip("If clicked, start recording") self.startStopScoutScanButton.setEnabled(False) self.startStopScoutScanButton.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.startStopLiveReconstructionButton = QPushButton( " Start live reconstruction") self.startStopLiveReconstructionButton.setCheckable(True) self.startStopLiveReconstructionButton.setIcon(self.recordIcon) self.startStopLiveReconstructionButton.setToolTip( "If clicked, start live reconstruction") self.startStopLiveReconstructionButton.setEnabled(False) self.startStopLiveReconstructionButton.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Expanding) self.displayRoiButton = QToolButton() self.displayRoiButton.setCheckable(True) self.displayRoiButton.setIcon(self.visibleOffIcon) self.displayRoiButton.setToolTip("If clicked, display ROI") hbox = QHBoxLayout() hbox.addWidget(self.startStopScoutScanButton) hbox.addWidget(self.startStopLiveReconstructionButton) # hbox.addWidget(self.displayRoiButton) ultrasoundLayout.addRow(hbox) self.snapshotTimer = QTimer() self.snapshotTimer.setSingleShot(True) self.onParameterSetSelected() return collapsibleButton
import sys from qt import QApplication, QPushButton app=QApplication(sys.argv) button=QPushButton(None) button.setText("Hello World") app.setMainWidget(button) button.show() app.exec_loop()