def __init__(self, vw, vwgui): self.vw = vw self.vwgui = vwgui QToolBar.__init__(self, parent=vwgui) self.addWidget( QLabel('Example Toolbar:', parent=self) ) self.addAction('ONE', self.doOne)
def __init__(self): QToolBar.__init__(self) self.setMovable(False) self.toggleViewAction().setEnabled(False) back_action = QAction(self) back_action.setShortcut(QKeySequence(Qt.Key_Back)) back_action.setIcon(QIcon("images/go-previous.png")) self.addAction(back_action) back_action.triggered.connect(self.back_button_clicked) forward_action = QAction(self) forward_action.setShortcut(QKeySequence(Qt.Key_Forward)) forward_action.setIcon(QIcon("images/go-next.png")) self.addAction(forward_action) forward_action.triggered.connect(self.forward_button_clicked) self.stop_reload_action = QAction(self) self.stop_reload_action.setShortcut(QKeySequence(Qt.Key_F5)) self.stop_reload_action.setIcon(QIcon("images/view-refresh.png")) self.stop_reload_action.setData(QWebEnginePage.Reload) self.addAction(self.stop_reload_action) self.stop_reload_action.triggered.connect( lambda: self.stop_reload_button_clicked.emit( QWebEnginePage.WebAction(self.stop_reload_action.data()))) self.le = QLineEdit() fav_action = QAction(self) self.le.addAction(fav_action, QLineEdit.LeadingPosition) self.le.setClearButtonEnabled(True) self.addWidget(self.le) self.le.editingFinished.connect( lambda: self.address_changed.emit(self.le.text()))
def __init__(self): QToolBar.__init__(self) self.config_window=None self.electrical_mesh=None self.electrical_interfaces=None self.setToolButtonStyle( Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.configwindow = QAction_lock("preferences-system", _("Configure"), self,"ribbon_config_config") self.configwindow.triggered.connect(self.callback_config_window) self.addAction(self.configwindow) self.dump = dump_io(self) global_object_register("ribbon_configure_dump_refresh",self.dump.refresh) self.addAction(self.dump) self.solar = QAction_lock("weather-few-clouds", _("Solar spectrum\ngenerator"), self,"solar_spectrum_tool") self.solar.clicked.connect(self.callback_solar) if is_gpvdm_next()==True: self.addAction(self.solar) self.mesh = QAction_lock("mesh", _("Electrical\nmesh"), self,"ribbon_config_mesh") self.mesh.triggered.connect(self.callback_edit_mesh) self.addAction(self.mesh) if is_gpvdm_next()==True: self.interfaces = QAction_lock("interfaces", _("Interfaces"), self,"ribbon_config_interfaces") self.interfaces.triggered.connect(self.callback_interfaces) self.addAction(self.interfaces)
def __init__(self): QToolBar.__init__(self) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.home_new = QAction_lock("document-new", _("New simulation").replace(" ", "\n"), self, "main_new") #self.home_new.setText(_("New\nsimulation")) self.addAction(self.home_new) self.old = QAction(icon_get("document-new"), _("New simulation").replace(" ", "\n"), self) self.home_open = QAction_lock("document-open", _("Open\nsimulation"), self, "main_open") self.used_files_menu = QMenu(self) self.populate_used_file_menu() self.home_open.setMenu(self.used_files_menu) self.addAction(self.home_open) self.home_backup = QAction_lock("backup", _("Backup\nSimulaion"), self, "ribbion_db_backup") self.home_backup.clicked.connect(self.callback_home_backup) self.addAction(self.home_backup) self.home_export_xls = QAction_lock("export_xls", _("Export\nto Excel"), self, "main_export_xls") #self.home_export_xls = QAction(icon_get("export_xls"), _("Export\nto Excel"), self) self.addAction(self.home_export_xls) self.home_export_xls.clicked.connect(self.callback_export_xls) self.tb_script_editor = QAction_lock("script", _("Script\nEditor"), self, "script_editor") self.tb_script_editor.clicked.connect(self.callback_script) self.addAction(self.tb_script_editor) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.addWidget(spacer) self.cite_me = cite_me() self.addWidget(self.cite_me) if get_lock().is_trial() == True and get_lock().is_registered( ) == True: self.home_cart = QAction(icon_get("upgrade"), _("Upgrade to\ngpvdm professional."), self) self.home_cart.triggered.connect(self.callback_buy) self.addAction(self.home_cart) self.home_help = QAction(icon_get("internet-web-browser"), _("Help"), self) self.addAction(self.home_help)
def __init__(self, parent=None): QToolBar.__init__(self, parent) self.radius_tool_frame = QFrame() self.radius_tool_frame.setFrameShadow(QFrame.Plain) self.radius_tool_frame.setFrameShape(QFrame.StyledPanel) self.radius_layout = QHBoxLayout(self.radius_tool_frame) self.spin_box = QDoubleSpinBox() self.spin_box.setMinimum(0) self.spin_box.setSingleStep(0.1) self.analyse_btn = QPushButton('Analyze CC') self.analyse_btn.clicked.connect(self.analyse_btn_clicked) self.radius_layout.addWidget(self.spin_box) self.radius_layout.addWidget(self.analyse_btn) self.radius_tool_frame.setLayout(self.radius_layout) self.display_all_btn = QPushButton('Show all Channels') self.display_all_btn.clicked.connect(self.display_all_btn_clicked) self.addWidget(self.radius_tool_frame) self.addSeparator() self.addWidget(self.display_all_btn)
def __init__(self, area, parent, name=""): QToolBar.__init__(self, parent) self._area = area if not name: name = self.tr("Dock Widgets Toolbar") self.setObjectName(name) self.setWindowTitle(name) self.setFloatable(False) self.setMovable(False) # self.setAllowedAreas(self.TRANSPOSED_AREA[self._area]) self.parent().addToolBar(self.TRANSPOSED_AREA[self._area], self) self._dockToButtonAction = {} # Dock widgets for d in self._dockWidgets(): b = verticalButton(self) b.setDefaultAction(d.toggleViewAction()) # d.setStyleSheet("QDockWidget::title{background-color: red;}") # d.setTitleBarWidget(QLabel(d.windowTitle())) d.setStyleSheet(style.dockSS()) a = self.addWidget(b) self._dockToButtonAction[d] = a self.addSeparator() # Other widgets self.otherWidgets = [] self.currentGroup = None self.setStyleSheet(style.toolBarSS()) self.layout().setContentsMargins(0,0,0,0)
def __init__(self, server): QToolBar.__init__(self) self.hpc_window = QWidget() #self.hpc_window.show() self.myserver=server self.win_list=windows() self.win_list.load() self.win_list.set_window(self,"hpc_window") self.setIconSize(QSize(42, 42)) self.cluster_button = QAction(QIcon(os.path.join(get_image_file_path(),"not_connected.png")), _("Connect to cluster"), self) self.cluster_button.triggered.connect(self.callback_cluster_connect) self.addAction(self.cluster_button) self.node_view=QWidget() self.node_view_vbox=QVBoxLayout() self.node_view.setLayout(self.node_view_vbox) self.bar=[] self.button=[] self.slider=[] self.label=[] self.init_job_window()
def __init__(self): QToolBar.__init__(self) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.materials = QAction(QIcon_load("organic_material"), _("Materials\ndatabase"), self) self.materials.triggered.connect(self.callback_view_materials) self.addAction(self.materials) self.spectra_file = QAction(QIcon_load("spectra_file"), _("Optical\ndatabase"), self) self.spectra_file.triggered.connect(self.callback_view_optical) self.addAction(self.spectra_file) if enable_betafeatures() == True: self.tb_import_pvlighthouse = QAction( QIcon_load("sync"), _("Update materials\nfrom PVLighthouse"), self) self.tb_import_pvlighthouse.triggered.connect( self.callback_pvlighthouse) self.addAction(self.tb_import_pvlighthouse) self.tb_import_refractiveindex = QAction( QIcon_load("sync"), _("Update materials\nfrom refractiveindex.info"), self) self.tb_import_refractiveindex.triggered.connect( self.callback_refractiveindex) self.addAction(self.tb_import_refractiveindex)
def __init__(self): QToolBar.__init__(self) self.myserver = server_get() self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.scan_window = None self.fit_window = None self.undo = QAction(QIcon_load("edit-undo"), _("Undo"), self) self.addAction(self.undo) self.addSeparator() self.run = QAction(QIcon_load("media-playback-start"), _("Run simulation"), self) self.addAction(self.run) self.stop = QAction(QIcon_load("media-playback-pause"), _("Stop\nsimulation"), self) self.stop.triggered.connect(self.callback_simulate_stop) self.addAction(self.stop) self.addSeparator() self.scan = QAction(QIcon_load("scan"), _("Parameter\nscan"), self) self.scan.triggered.connect(self.callback_scan) self.addAction(self.scan) self.addSeparator() self.fit = QAction(QIcon_load("fit"), _("Fit\ndata"), self) self.fit.triggered.connect(self.callback_run_fit) self.addAction(self.fit) self.addSeparator() self.plot = QAction(QIcon_load("plot"), _("Plot\nFile"), self) self.plot.triggered.connect(self.callback_plot_select) self.addAction(self.plot) self.time = QAction(QIcon_load("plot_time"), _("Examine results\nin time domain"), self) self.time.triggered.connect(self.callback_examine) self.addAction(self.time) self.addSeparator() self.sun = tb_item_sun() self.sun.changed.connect(self.callback_sun) self.addWidget(self.sun) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.addWidget(spacer) self.help = QAction(QIcon_load("internet-web-browser"), _("Help"), self) self.addAction(self.help)
def __init__(self, vw, vwgui): self.vw = vw self.vwgui = vwgui QToolBar.__init__(self, parent=vwgui) self.addWidget(QLabel('Example Toolbar:', parent=self)) self.addAction('ONE', self.doOne)
def __init__(self, area, parent, name=""): QToolBar.__init__(self, parent) self._area = area if not name: name = self.tr("Dock Widgets Toolbar") self.setObjectName(name) self.setWindowTitle(name) self.setFloatable(False) self.setMovable(False) # self.setAllowedAreas(self.TRANSPOSED_AREA[self._area]) self.parent().addToolBar(self.TRANSPOSED_AREA[self._area], self) self._dockToButtonAction = {} # Dock widgets for d in self._dockWidgets(): b = verticalButton(self) b.setDefaultAction(d.toggleViewAction()) # d.setStyleSheet("QDockWidget::title{background-color: red;}") # d.setTitleBarWidget(QLabel(d.windowTitle())) d.setStyleSheet(style.dockSS()) a = self.addWidget(b) self._dockToButtonAction[d] = a self.addSeparator() # Other widgets self.otherWidgets = [] self.currentGroup = None self.setStyleSheet(style.toolBarSS()) self.layout().setContentsMargins(0, 0, 0, 0)
def __init__(self, parent, *args): QToolBar.__init__(self, parent, *args) self.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)) self._dock = parent self.aClose = QToolBar.addAction( self, self.style().standardIcon(QStyle.SP_TitleBarCloseButton), "") closeIcon = self.style().standardIcon(QStyle.SP_DockWidgetCloseButton) if not closeIcon.availableSizes(): # SP_DockWidgetCloseButton is missing on Fedora. Why??? Using fallback closeIcon = self.style().standardIcon(QStyle.SP_DialogCloseButton) self.aClose = QToolBar.addAction(self, closeIcon, "") self.setMovable(False) self.setFloatable(False) self.aClose.triggered.connect(self._dock.close) textHeight = QFontMetrics(self.font()).height() self.setIconSize(QSize(textHeight, textHeight)) # a fake spacer widget self._spacer = QWidget(self) self._spacer.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.MinimumExpanding)) self.addWidget(self._spacer)
def __init__(self, parent, *args): QToolBar.__init__(self, parent, *args) self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)) self._dock = parent self.aClose = QToolBar.addAction(self, self.style().standardIcon(QStyle.SP_TitleBarCloseButton), "") closeIcon = self.style().standardIcon(QStyle.SP_DockWidgetCloseButton) if not closeIcon.availableSizes(): # SP_DockWidgetCloseButton is missing on Fedora. Why??? Using fallback closeIcon = self.style().standardIcon( QStyle.SP_DialogCloseButton) self.aClose = QToolBar.addAction(self, closeIcon, "") self.setMovable(False) self.setFloatable(False) self.aClose.triggered.connect(self._dock.close) textHeight = QFontMetrics(self.font()).height() self.setIconSize(QSize(textHeight, textHeight)) # a fake spacer widget self._spacer = QWidget(self) self._spacer.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.MinimumExpanding)) self.addWidget(self._spacer)
def __init__(self): QToolBar.__init__(self) self.doping_window = None self.cost_window = None self.parasitic = None self.contacts_window = None self.parasitic_window = None self.layer_editor = None self.dim_editor = None self.electrical_editor = None self.emission_editor = None self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setOrientation(Qt.Vertical) self.setIconSize(QSize(42, 42)) self.tb_layer_editor = QAction_lock("layers", _("Layer\neditor"), self, "ribbon_device_layers") self.tb_layer_editor.clicked.connect(self.callback_layer_editor) self.addAction(self.tb_layer_editor) global_object_register("show_layer_editor", self.callback_layer_editor) self.contacts = QAction_lock("contact", _("Contacts"), self, "ribbon_device_contacts") self.contacts.clicked.connect(self.callback_contacts) self.addAction(self.contacts) self.doping = QAction_lock("doping", _("Doping/\nIons"), self, "ribbon_device_doping") self.doping.clicked.connect(self.callback_doping) self.addAction(self.doping) self.parasitic = QAction_lock("parasitic", _("Parasitic\n components"), self, "ribbon_device_parasitic") self.parasitic.clicked.connect(self.callback_parasitic) self.addAction(self.parasitic) self.tb_electrical_editor = QAction_lock("electrical", _("Electrical\nparameters"), self, "ribbon_device_electrical") self.tb_electrical_editor.clicked.connect( self.callback_electrical_editor) self.addAction(self.tb_electrical_editor) self.tb_emission_editor = QAction_lock("emission", _("Emission\nparameters"), self, "ribbon_device_emission") self.tb_emission_editor.clicked.connect(self.callback_emission_editor) self.addAction(self.tb_emission_editor) self.tb_dimension_editor = QAction_lock("dimensions", _("xz-size"), self, "ribbon_device_dim") self.tb_dimension_editor.clicked.connect( self.callback_dimension_editor) self.addAction(self.tb_dimension_editor) get_watch().add_call_back("diagram.inp", self.callback_circuit_diagram) self.callback_circuit_diagram()
def __init__(self, parent, canvas): QToolBar.__init__(self, parent) self._canvas = canvas self.addAction(QApplication.style().standardIcon(QStyle.SP_DialogSaveButton), "Save", canvas.saveImg) self.addAction("Zoom +", canvas.zoomUp) self.addAction("Zoom -", canvas.zoomDown) self.addAction("Configure", canvas.configure)
def __init__(self, parent, canvas): QToolBar.__init__(self, parent) self._canvas = canvas self.addAction( QApplication.style().standardIcon(QStyle.SP_DialogSaveButton), "Save", canvas.saveImg) self.addAction("Zoom +", canvas.zoomUp) self.addAction("Zoom -", canvas.zoomDown) self.addAction("Configure", canvas.configure)
def __init__(self): QToolBar.__init__(self) self.actions=[] self.order=["jv","jv_perovskite","|","sun_voc","suns_jsc","equilibrium","|","TPC","TPV","|","IS", "IMPS","|", "CELIV","Photo"] self.dont_show=["photon_extraction"] self.myserver=server_get() self.setToolButtonStyle( Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) global_object_register("ribbon_sim_mode_update",self.update)
def __init__(self, vw, vwgui): self.vw = vw self.vwgui = vwgui QToolBar.__init__(self, parent=vwgui) # Add a label to the toolbar self.addWidget(QLabel('Example Toolbar:', parent=self)) # Add an action button to the toolbar self.addAction('ONE', self.doOne)
def __init__(self): QToolBar.__init__(self) w = self.main_toolbar() self.addTab(w, _("File")) sheet = self.readStyleSheet(os.path.join(get_css_path(), "style.css")) if sheet != None: sheet = str(sheet, 'utf-8') self.setStyleSheet(sheet)
def __init__(self): QToolBar.__init__(self) self.actions = [] self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) a = mode_button("transfer_matrix", _("Transfer\nmatrix"), self, "optics_ribbon_export_image") a.mode = "full" a.clicked.connect(self.callback_click) self.actions.append(a) a = mode_button("exp_light", _("Exponential\nprofile"), self, "optics_ribbon_mode_exp") a.mode = "exp" a.clicked.connect(self.callback_click) self.actions.append(a) a = mode_button("flat_light", _("Flat\nprofile"), self, "optics_ribbon_mode_flat") a.mode = "flat" a.clicked.connect(self.callback_click) self.actions.append(a) a = mode_button("file_light", _("From\nfile"), self, "optics_ribbon_mode_from_file") a.mode = "fromfile" a.clicked.connect(self.callback_click) self.actions.append(a) a = mode_button("qe_light", _("From QE\nspectra"), self, "optics_ribbon_mode_qe") a.mode = "qe" a.clicked.connect(self.callback_click) self.actions.append(a) a = mode_button("constant_light", _("Constant\nvalue"), self, "optics_ribbon_mode_constant") a.mode = "constant" a.clicked.connect(self.callback_click) self.menu_set_constant_value = QMenu(self) #self.populate_used_file_menu() a.setMenu(self.menu_set_constant_value) f = QAction(_("Edit constant"), self) f.triggered.connect(self.callback_edit_constant) self.menu_set_constant_value.addAction(f) self.actions.append(a) for a in self.actions: self.addAction(a) self.set_mode()
def __init__(self): QToolBar.__init__(self) self.setMaximumHeight(140) w = self.main_toolbar() self.addTab(w, _("Load/Import")) w = self.plot_toolbar() self.addTab(w, _("Plot")) sheet = self.readStyleSheet(os.path.join(get_css_path(), "style.css")) if sheet != None: sheet = str(sheet, 'utf-8') self.setStyleSheet(sheet)
def __init__(self): QToolBar.__init__(self) self.myserver = server_get() self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.cluster_get_data = QAction(icon_get("server_get_data"), wrap_text(_("Cluster get data"), 8), self) self.cluster_get_data.triggered.connect(self.callback_cluster_get_data) self.addAction(self.cluster_get_data) self.cluster_get_data.setEnabled(False) self.cluster_copy_src = QAction(icon_get("server_copy_src"), wrap_text(_("Copy src to cluster"), 8), self) self.cluster_copy_src.triggered.connect(self.callback_cluster_copy_src) self.addAction(self.cluster_copy_src) self.cluster_copy_src.setEnabled(False) self.cluster_make = QAction(icon_get("server_make"), wrap_text(_("Make on cluster"), 6), self) self.cluster_make.triggered.connect(self.callback_cluster_make) self.addAction(self.cluster_make) self.cluster_make.setEnabled(False) self.cluster_clean = QAction(icon_get("server_clean"), wrap_text(_("Clean cluster"), 8), self) self.cluster_clean.triggered.connect(self.callback_cluster_clean) self.addAction(self.cluster_clean) self.cluster_clean.setEnabled(False) self.cluster_off = QAction(icon_get("off"), wrap_text(_("Kill all cluster code"), 8), self) self.cluster_off.triggered.connect(self.callback_cluster_off) self.addAction(self.cluster_off) self.cluster_off.setEnabled(False) self.cluster_sync = QAction(icon_get("sync"), _("Sync"), self) self.cluster_sync.triggered.connect(self.callback_cluster_sync) self.addAction(self.cluster_sync) self.cluster_sync.setEnabled(False) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.addWidget(spacer) self.help = QAction(icon_get("internet-web-browser"), _("Help"), self) self.addAction(self.help)
def __init__(self): QToolBar.__init__(self) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.thermal_isothermal_button = thermal_isothermal_button(self) self.thermal_isothermal_button.triggered.connect( self.callback_thermal_isothermal_button) self.addAction(self.thermal_isothermal_button) self.addSeparator() self.temperature = QAction_lock("thermal", _("Set\nTemperature"), self, "ribbon_thermal_settemp") self.temperature.clicked.connect(self.callback_thermal) self.addAction(self.temperature) self.addSeparator() self.boundary = QAction_lock("boundary", _("boundary\nConditions"), self, "ribbon_thermal_boundary") self.boundary.clicked.connect(self.callback_boundary) self.addAction(self.boundary) self.configure = QAction_lock("cog", _("Configure\nModel"), self, "ribbon_thermal_configure") self.configure.clicked.connect(self.callback_configure) self.addAction(self.configure) self.addSeparator() self.joule_heating = QAction_lock("joule_heating", _("Joule\nHeating"), self, "ribbon_thermal_joule") self.joule_heating.clicked.connect(self.callback_joule_heating) self.joule_heating.setCheckable(True) self.addAction(self.joule_heating) self.optical_heating = QAction_lock("optical_heating", _("Optical\nHeating"), self, "ribbon_thermal_optical") self.optical_heating.clicked.connect(self.callback_optical_heating) self.optical_heating.setCheckable(True) self.addAction(self.optical_heating) self.recombination_heating = QAction_lock( "recombination_heating", _("Recombination\nheating"), self, "ribbon_thermal_recombination") self.recombination_heating.clicked.connect( self.callback_recombination_heating) self.recombination_heating.setCheckable(True) self.addAction(self.recombination_heating)
def __init__(self, *args): QToolBar.__init__(self, *args) self.start = self.StartStopAction("Start", None) self.stop = self.StartStopAction("Stop", None) self.stop.setEnabled(False) self.config = QAction("Setup...", None) self.reset = QAction("Stat reset", None) #self.quit = QAction("Quit", None) self.connect(self.start, QtCore.SIGNAL("triggered()"), self.start.disable) self.connect(self.stop, QtCore.SIGNAL("triggered()"), self.stop.disable) self.addAction(self.start) self.addAction(self.stop) self.addAction(self.reset) self.addSeparator() self.addAction(self.config)
def __init__(self): QToolBar.__init__(self) self.new_text = "" self.delete_text = "" self.clone_text = "" self.rename_text = "" self.icon_size = 42 self.new_dlg_text = "" self.base_file_name = "none" self.new_tab_name = "" self.notebook_pointer = None self.clone_dlg_text = "" self.rename_dlg_text = "" self.delete_dlg_text = "" self.postfix = "" self.name_token = "#tab_name"
def __init__(self, parent, *args): QToolBar.__init__(self, parent, *args) self.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)) self._dock = parent closeIcon = self.style().standardIcon(QStyle.SP_DockWidgetCloseButton) if not closeIcon.availableSizes(): # SP_DockWidgetCloseButton is missing on Fedora. Why??? Using fallback closeIcon = self.style().standardIcon(QStyle.SP_DialogCloseButton) self.aClose = QToolBar.addAction(self, closeIcon, "") self.setMovable(False) self.setFloatable(False) self.aClose.triggered.connect(self._dock.close) textHeight = QFontMetrics(self.font()).height() self.setIconSize(QSize(textHeight * 0.8, textHeight * 0.8)) # a fake spacer widget self._spacer = QWidget(self) self._spacer.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.MinimumExpanding)) self.addWidget(self._spacer) self.setStyleSheet('QToolBar{spacing:0px; margin:0px}') # The pinned/unpinned control. self.tbUnPinned = QToolButton() icon = QIcon() # To do: Replace with my own image and put in resources. icon.addPixmap( QPixmap(os.path.join(os.path.dirname(__file__), 'unpinned.png')), QIcon.Normal, QIcon.On) icon.addPixmap( QPixmap(os.path.join(os.path.dirname(__file__), 'pinned.png')), QIcon.Normal, QIcon.Off) self.tbUnPinned.setIcon(icon) self.tbUnPinned.setCheckable(True) self._configName = parent.windowTitle() + " pinned" if self._configName in core.config(): self.tbUnPinned.setChecked(not core.config()[self._configName]) self.tbUnPinned.toggled.connect(self.on_tbUnPinned_toggled) self.addWidget(self.tbUnPinned)
def __init__(self, *args): QToolBar.__init__(self, *args) self._queuedWidget = _QueuedMessageWidget(self) self.setObjectName(self.metaObject().className()) self.setMovable(False) self.setFloatable(False) self.setAllowedAreas(Qt.TopToolBarArea) self.toggleViewAction().setEnabled(False) self.toggleViewAction().setVisible(False) self.addWidget(self._queuedWidget) self.layout().setContentsMargins(3, 3, 3, 3) # connections self._queuedWidget.shown.connect(self.messageShown) self._queuedWidget.finished.connect(self.messageFinished)
def __init__(self): QToolBar.__init__(self) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.license = QAction(icon_get("license"), _("License") + "\n", self) self.license.triggered.connect(self.callback_license) self.addAction(self.license) self.ref = QAction(icon_get("ref"), _("How to\ncite"), self) self.ref.triggered.connect(self.callback_ref) self.addAction(self.ref) self.hints = QAction(icon_get("hints.png"), _("Hints\nWindow"), self) self.hints.triggered.connect(self.callback_help) self.addAction(self.hints) #self.about = QAction(icon_get("help"), _("About")+"\n", self) #self.addAction(self.about) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.addWidget(spacer) self.paper = QAction(icon_get("pdf"), wrap_text(_("Assosiated paper"), 8), self) self.paper.triggered.connect(self.callback_paper) self.addAction(self.paper) self.twitter = QAction(icon_get("twitter.png"), _("twitter"), self) self.twitter.triggered.connect(self.callback_twitter) self.addAction(self.twitter) self.fb = QAction(icon_get("fb.png"), _("Facebook"), self) self.fb.triggered.connect(self.callback_fb) self.addAction(self.fb) self.youtube = QAction(icon_get("youtube.png"), _("Youtube\nchannel"), self) self.youtube.triggered.connect(self.callback_youtube) self.addAction(self.youtube) self.man = QAction(icon_get("internet-web-browser"), _("Help") + "\n", self) self.man.triggered.connect(self.callback_on_line_help) self.addAction(self.man)
def __init__(self): QToolBar.__init__(self) self.doping_window = None self.cost_window = None self.parasitic = None self.contacts_window = None self.parasitic_window = None self.layer_editor = None self.dim_editor = None self.electrical_editor = None self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setOrientation(Qt.Vertical) self.setIconSize(QSize(42, 42)) self.tb_layer_editor = QAction(icon_get("layers"), _("Layer\neditor"), self) self.tb_layer_editor.triggered.connect(self.callback_layer_editor) self.addAction(self.tb_layer_editor) global_object_register("show_layer_editor", self.callback_layer_editor) self.contacts = QAction(icon_get("contact"), _("Contacts"), self) self.contacts.triggered.connect(self.callback_contacts) self.addAction(self.contacts) self.doping = QAction(icon_get("doping"), _("Doping"), self) self.doping.triggered.connect(self.callback_doping) self.addAction(self.doping) self.parasitic = QAction(icon_get("parasitic"), _("Parasitic\n components"), self) self.parasitic.triggered.connect(self.callback_parasitic) self.addAction(self.parasitic) self.tb_electrical_editor = QAction(icon_get("electrical"), _("Electrical\nparameters"), self) self.tb_electrical_editor.triggered.connect( self.callback_electrical_editor) self.addAction(self.tb_electrical_editor) self.tb_dimension_editor = QAction(icon_get("dimensions"), _("xz-size"), self) self.tb_dimension_editor.triggered.connect( self.callback_dimension_editor) self.addAction(self.tb_dimension_editor)
def __init__(self): QToolBar.__init__(self) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.materials = QAction_lock("organic_material", _("Materials\ndatabase"), self, "ribbion_db_materials") self.materials.clicked.connect(self.callback_view_materials) self.addAction(self.materials) self.spectra_file = QAction_lock("spectra_file", _("Optical\ndatabase"), self, "ribbion_db_spectra") self.spectra_file.clicked.connect(self.callback_view_optical) self.addAction(self.spectra_file) self.tb_update = QAction_lock("update", _("Download extra\nmaterials"), self, "ribbion_db_update") self.tb_update.clicked.connect(self.callback_update_window) if ver_ctrl.is_gpvdm_next() == True: self.addAction(self.tb_update) self.lasers = QAction_lock("lasers", _("Laser\ndatabase"), self, "ribbion_db_lasers") self.lasers.clicked.connect(self.callback_configure_lasers) self.addAction(self.lasers) self.emission = QAction_lock("pl", _("Emission\ndatabase"), self, "ribbion_db_emission") self.emission.clicked.connect(self.callback_configure_emission) self.addAction(self.emission) self.user = QAction_lock("folder", _("User\ndata"), self, "ribbion_db_user_data") self.user.clicked.connect(self.callback_configure_user_data) self.addAction(self.user) self.shape = QAction_lock("shape", _("Shape\ndatabase"), self, "ribbion_db_shape") self.shape.clicked.connect(self.callback_configure_shape) self.addAction(self.shape) self.lasers_window = None
def __init__(self, parent): QToolBar.__init__(self) #aaa=self.readStyleSheet(os.path.join(get_css_path(),"menu.css")) #aaa=str(aaa,'utf-8') #self.setStyleSheet(aaa) self.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) self.setOrientation(Qt.Vertical) #self.setWindowFlags(Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint|Qt.WindowStaysOnTopHint) self.setIconSize(QSize(42, 42)) self.configure_configwindow = QAction(icon_get("help"), _("Help window"), self) self.addAction(self.configure_configwindow) self.configure_configwindow = QAction(icon_get("help"), _("Manual"), self) self.addAction(self.configure_configwindow) self.configure_configwindow = QAction(icon_get("help"), _("License"), self) self.addAction(self.configure_configwindow) self.configure_configwindow = QAction(icon_get("help"), _("Youtube"), self) self.addAction(self.configure_configwindow) self.configure_configwindow = QAction(icon_get("help"), _("Citing the model"), self) self.addAction(self.configure_configwindow) self.configure_configwindow = QAction(icon_get("help"), _("About"), self) self.addAction(self.configure_configwindow) l = self.layout() for i in range(0, l.count()): l.itemAt(i).setAlignment(Qt.AlignLeft) self.installEventFilter(self) self.setWindowFlags(Qt.Popup) self.move(self.mapFromGlobal(QCursor.pos()))
def __init__(self, action_handler: ActionHandler): QToolBar.__init__(self) self.action_handler = action_handler self.patient_dict_container = PatientDictContainer() self.setCursor(QCursor(Qt.PointingHandCursor)) self.setMovable(False) self.setFloatable(False) self.setContextMenuPolicy(Qt.PreventContextMenu) # Drop-down list for Windowing button on toolbar self.button_windowing = QToolButton() self.button_windowing.setMenu(self.action_handler.menu_windowing) self.button_windowing.setPopupMode(QToolButton.InstantPopup) self.button_windowing.setIcon(self.action_handler.icon_windowing) # Drop-down list for Export button on toolbar self.button_export = QToolButton() self.button_export.setMenu(self.action_handler.menu_export) self.button_export.setPopupMode(QToolButton.InstantPopup) self.button_export.setIcon(self.action_handler.icon_export) # Spacer for the toolbar spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) spacer.setFocusPolicy(Qt.NoFocus) # Add actions to toolbar self.addAction(self.action_handler.action_open) self.addSeparator() self.addAction(self.action_handler.action_zoom_out) self.addAction(self.action_handler.action_zoom_in) self.addSeparator() self.addWidget(self.button_windowing) self.addSeparator() self.addAction(self.action_handler.action_transect) self.addSeparator() self.addAction(self.action_handler.action_add_ons) self.addWidget(spacer) self.addWidget(self.button_export) self.addAction(self.action_handler.action_save_as_anonymous) if self.patient_dict_container.has_modality('rtss'): self.addAction(self.action_handler.action_save_structure)
def __init__(self): QToolBar.__init__(self) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.run = play(self, "optics_ribbon_run", run_text=wrap_text(_("Run optical simulation"), 5)) self.addAction(self.run) self.fx_box = mode_selector() self.fx_box.show_all = True self.fx_box.update() self.addWidget(self.fx_box) self.spectrum = tb_spectrum() self.addWidget(self.spectrum) self.configwindow = QAction(icon_get("preferences-system"), _("Configure"), self) self.addAction(self.configwindow) self.optical_filter = QAction(icon_get("optical_filter"), _("Optical\nFilter"), self) self.optical_filter.setCheckable(True) self.optical_filter.triggered.connect(self.callback_filter_clicked) self.menu_optical_filter = QMenu(self) self.optical_filter.setMenu(self.menu_optical_filter) self.filter_edit = QAction(_("Edit"), self) self.filter_edit.triggered.connect(self.callback_filter_window) self.menu_optical_filter.addAction(self.filter_edit) self.addAction(self.optical_filter) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.addWidget(spacer) self.help = QAction(icon_get("help"), _("Help"), self) self.addAction(self.help)
def __init__(self): QToolBar.__init__(self) self.config_window = None self.electrical_mesh = None self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setIconSize(QSize(42, 42)) self.configwindow = QAction(icon_get("preferences-system"), _("Configure"), self) self.configwindow.triggered.connect(self.callback_config_window) self.addAction(self.configwindow) self.dump = dump_io(self) global_object_register("ribbon_configure_dump_refresh", self.dump.refresh) self.addAction(self.dump) self.mesh = QAction(icon_get("mesh"), _("Electrical\nmesh"), self) self.mesh.triggered.connect(self.callback_edit_mesh) self.addAction(self.mesh)
def __init__(self, parent, *args): QToolBar.__init__(self, parent, *args) self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)) self._dock = parent closeIcon = self.style().standardIcon(QStyle.SP_DockWidgetCloseButton) if not closeIcon.availableSizes(): # SP_DockWidgetCloseButton is missing on Fedora. Why??? Using fallback closeIcon = self.style().standardIcon(QStyle.SP_DialogCloseButton) self.aClose = QToolBar.addAction(self, closeIcon, "") self.setMovable(False) self.setFloatable(False) self.aClose.triggered.connect(self._dock.close) textHeight = QFontMetrics(self.font()).height() self.setIconSize(QSize(textHeight * 0.8, textHeight * 0.8)) # a fake spacer widget self._spacer = QWidget(self) self._spacer.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.MinimumExpanding)) self.addWidget(self._spacer) self.setStyleSheet('QToolBar{spacing:0px; margin:0px}') # The pinned/unpinned control. self.tbUnPinned = QToolButton() icon = QIcon() # To do: Replace with my own image and put in resources. icon.addPixmap(QPixmap(os.path.join(os.path.dirname(__file__), 'unpinned.png')), QIcon.Normal, QIcon.On) icon.addPixmap(QPixmap(os.path.join(os.path.dirname(__file__), 'pinned.png')), QIcon.Normal, QIcon.Off) self.tbUnPinned.setIcon(icon) self.tbUnPinned.setCheckable(True) self._configName = parent.windowTitle() + " pinned" if self._configName in core.config(): self.tbUnPinned.setChecked(not core.config()[self._configName]) self.tbUnPinned.toggled.connect(self.on_tbUnPinned_toggled) self.addWidget(self.tbUnPinned)
def __init__(self, area, parent, name=""): QToolBar.__init__(self, parent) self._area = area if not name: name = self.tr("Dock Widgets Toolbar") self.setObjectName(name) self.setWindowTitle(name) self.setFloatable(False) self.setMovable(False) # self.setAllowedAreas(self.TRANSPOSED_AREA[self._area]) self.parent().addToolBar(self.TRANSPOSED_AREA[self._area], self) self._dockToButtonAction = {} # Dock widgets for d in self._dockWidgets(): b = verticalButton(self) b.setDefaultAction(d.toggleViewAction()) # d.setStyleSheet("QDockWidget::title{background-color: red;}") # d.setTitleBarWidget(QLabel(d.windowTitle())) d.setStyleSheet(""" QDockWidget::title { text-align: left; /* align the text to the left */ background: lightBlue; padding: 5px; } QDockWidget::close-button, QDockWidget::float-button { background: lightBlue; } """) a = self.addWidget(b) self._dockToButtonAction[d] = a self.addSeparator() # Other widgets self.otherWidgets = [] self.currentGroup = None
def __init__(self, parent = None): QToolBar.__init__(self, parent) self.setWindowTitle('EditorBar') self.setIconSize(QSize(16, 16)) self.createActions()