def __init__(self, parent=None, configuration=None): BaseDialog.__init__(self, parent, "Config Dialog", layout_margin=10, layout_spacing=15, modal=True) self.configuration = configuration hbox = qt.QHBox(self) self.contentsWidget = qt.QIconView(hbox) self.contentsWidget.setMaximumWidth(128) self.pagesWidget = qt.QWidgetStack(hbox) self.pagesWidget.addWidget(ConfigurationPage(), 0) self.pagesWidget.addWidget(UpdatePage(), 1) self.pagesWidget.setSizePolicy( qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding)) self.createIcons() hbox.setStretchFactor(self.contentsWidget, 0) hbox.setStretchFactor(self.pagesWidget, 10) self.layout.addWidget(hbox) self.setupButtons({ "ok": None, "cancel": self.close, })
def __init__(self, parent, main_app): qt.QVBox.__init__(self, parent) self.setName("PerspectiveManager") self.setSpacing(5) self.setFrameStyle(qt.QFrame.PopupPanel | qt.QFrame.Plain) self._main_app = main_app self._active_perspective = None self._default = "" self._registered = {} self._toolbar = PerspectiveToolbar(self, "perspective_toolbar") self.setStretchFactor(self._toolbar, 0) self._stack_panel = qt.QWidgetStack(self) self._stack_panel.setFrameStyle(qt.QFrame.PopupPanel | qt.QFrame.Plain) self.setStretchFactor(self._stack_panel, 10)
def __init__(self, *args): BaseComponents.BlissWidget.__init__(self, *args) # Data attribtues self.energy_hwobj = None self.transmission_hwobj = None self.resolution_hwobj = None self.queue_model_hwobj = None self.session_hwobj = None # Qt-Slots self.defineSlot("populate_parameter_widget",({})) # Properties self.addProperty("session", "string", "/session") self.addProperty("queue-model", "string", "/queue-model") self.addProperty("beamline_setup", "string", "/beamline-setup") # Layout self.stack = qt.QWidgetStack(self, 'stack') self.parameters_widget = DCParametersWidget(self, "parameters_widget") self.toggle_page_button = qt.QPushButton('View Results', self, 'toggle_page_button') self.toggle_page_button.setFixedWidth(100) self.results_view = qt.QTextBrowser(self, "results_view") self.stack.addWidget(self.parameters_widget) self.stack.addWidget(self.results_view) main_layout = qt.QVBoxLayout(self) self.layout().addWidget(self.stack) bottom_layout = qt.QHBoxLayout(main_layout) bottom_layout.addStretch() bottom_layout.addWidget(self.toggle_page_button) # Logic self.stack.raiseWidget(self.parameters_widget) self.parameters_widget.collection_type = None qt.QObject.connect(self.toggle_page_button, qt.SIGNAL('clicked()'), self.toggle_page) self.toggle_page_button.setDisabled(True)
def __init__(self, *args): BaseComponents.BlissWidget.__init__(self, *args) self.session_hwobj = None # Framwork-2 properties self.addProperty("tunable-energy", "boolean", "True") self.addProperty("session", "string", "/session") self.addProperty("beamline_setup", "string", "/beamline-setup") # Qt-Slots self.defineSlot("populate_edna_parameter_widget", ({})) # Layout self.stack = qt.QWidgetStack(self, "stack") self.parameters_widget = CharParametersWidget(self) self.toggle_page_button = qt.QPushButton("View Results", self, "toggle_page_button") self.toggle_page_button.setFixedWidth(100) self.results_view = qt.QTextBrowser(self, "results_view") self.stack.addWidget(self.parameters_widget) self.stack.addWidget(self.results_view) main_layout = qt.QVBoxLayout(self) self.layout().addWidget(self.stack) bottom_layout = qt.QHBoxLayout(main_layout) bottom_layout.addStretch() bottom_layout.addWidget(self.toggle_page_button) # Logic self.stack.raiseWidget(self.parameters_widget) self.parameters_widget.collection_type = None qt.QObject.connect(self.toggle_page_button, qt.SIGNAL("clicked()"), self.toggle_page) self.toggle_page_button.setDisabled(True)