def main(): # check if the user is running the program in batch mode batchmode = '-no-gui' in sys.argv # run PyAero in batch mode if batchmode: app = QtCore.QCoreApplication(sys.argv) # FIXME # FIXME check for proper batch control file # FIXME if sys.argv[-1] == '-no-gui': print('No batch control file specified.') sys.exit() # prepare logger Logger.log('file_only') batch_controlfile = sys.argv[-1] batchmode = BatchMode.Batch(app, batch_controlfile, __version__) batchmode.run_batch() return # main application (contains the main event loop) # run PyAero in GUI mode app = QtWidgets.QApplication(sys.argv) # set icon for the application ( upper left window icon and taskbar icon) # and add specialization icons per size # (needed depending on the operating system) app_icon = QtGui.QIcon(os.path.join(ICONS, 'app_image.png')) app_icon.addFile(os.path.join(ICONS, 'app_image_16x16.png'), QtCore.QSize(16, 16)) app_icon.addFile(os.path.join(ICONS, 'app_image_24x24.png'), QtCore.QSize(24, 24)) app_icon.addFile(os.path.join(ICONS, 'app_image_32x32.png'), QtCore.QSize(32, 32)) app_icon.addFile(os.path.join(ICONS, 'app_image_48x48.png'), QtCore.QSize(48, 48)) app_icon.addFile(os.path.join(ICONS, 'app_image_256x256.png'), QtCore.QSize(256, 256)) app.setWindowIcon(app_icon) if LOCALE == 'C': # set default locale to C, so that decimal separator is a # dot in spin boxes, etc. QtCore.QLocale.setDefault(QtCore.QLocale.c()) # window style set in Settings.py window = MainWindow(app, STYLE) window.show() sys.exit(app.exec())
def set_default_window_icon(window: QtWidgets.QWidget): """ Sets the window icon for the given widget to the default icon :param window: :return: """ window.setWindowIcon( QtGui.QIcon( str(get_data_path().joinpath("icons", "sky_temple_key_NqN_icon.ico"))))
def get_icon(icon_file: str, system_icon: Optional[str] = None) -> QtGui.QIcon: """Load icon from system or if not available from resources.""" if system_icon and QtGui.QIcon.hasThemeIcon(system_icon): return QtGui.QIcon.fromTheme(system_icon) icon = QtGui.QIcon() with resources.path("normcap.resources", icon_file) as icon_path: icon.addFile(str(icon_path.resolve())) return icon
def __init__(self): super(PatientWeightDialog, self).__init__() # Class variables self.patient_weight_message = "Patient weight is needed for SUV2ROI " self.patient_weight_message += "conversion.\nPlease enter patient " self.patient_weight_message += "weight in kg." # Get stylesheet if platform.system() == 'Darwin': self.stylesheet_path = "res/stylesheet.qss" else: self.stylesheet_path = "res/stylesheet-win-linux.qss" self.stylesheet = open(resource_path(self.stylesheet_path)).read() self.setWindowIcon( QtGui.QIcon("res/images/btn-icons/onkodicom_icon.png")) buttonBox = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self) self.patient_weight_message_label = QLabel(self.patient_weight_message) self.patient_weight_prompt = QLabel("Patient Weight:") self.patient_weight_entry = QLineEdit() self.text_font = QtGui.QFont() self.text_font.setPointSize(11) # Set button object names buttonBox.button(QDialogButtonBox.Ok).setProperty( "QPushButtonClass", "success-button") buttonBox.button(QDialogButtonBox.Cancel).setProperty( "QPushButtonClass", "fail-button") # Set stylesheets buttonBox.setStyleSheet(self.stylesheet) self.patient_weight_message_label.setFont(self.text_font) self.patient_weight_message_label.setStyleSheet(self.stylesheet) self.patient_weight_prompt.setMinimumHeight(36) self.patient_weight_prompt.setMargin(4) self.patient_weight_prompt.setFont(self.text_font) self.patient_weight_prompt.setAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignHCenter) self.patient_weight_prompt.setStyleSheet(self.stylesheet) self.patient_weight_entry.setStyleSheet(self.stylesheet) # Input dialog layout entry_layout = QFormLayout(self) entry_layout.addRow(self.patient_weight_message_label) entry_layout.addRow(self.patient_weight_prompt, self.patient_weight_entry) entry_layout.addWidget(buttonBox) buttonBox.accepted.connect(self.accepting) buttonBox.rejected.connect(self.rejecting) self.setWindowTitle("Enter Patient Weight")
def __init__(self): QDialog.__init__(self) if platform.system() == 'Darwin': self.stylesheet_path = "res/stylesheet.qss" else: self.stylesheet_path = "res/stylesheet-win-linux.qss" stylesheet = open(resource_path(self.stylesheet_path)).read() self.setStyleSheet(stylesheet) self.standard_names = [] self.init_standard_names() self.setWindowTitle("Select A Region of Interest To Draw") self.setMinimumSize(350, 180) self.icon = QtGui.QIcon() self.icon.addPixmap( QtGui.QPixmap(resource_path("res/images/icon.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.setWindowIcon(self.icon) self.explanation_text = QLabel("Search for ROI:") self.input_field = QLineEdit() self.input_field.textChanged.connect(self.on_text_edited) self.button_area = QWidget() self.cancel_button = QPushButton("Cancel") self.cancel_button.clicked.connect(self.on_cancel_clicked) self.begin_draw_button = QPushButton("Begin Draw Process") self.begin_draw_button.clicked.connect(self.on_begin_clicked) self.button_layout = QHBoxLayout() self.button_layout.addWidget(self.cancel_button) self.button_layout.addWidget(self.begin_draw_button) self.button_area.setLayout(self.button_layout) self.list_label = QLabel() self.list_label.setText("Select a Standard Region of Interest") self.list_of_ROIs = QListWidget() for standard_name in self.standard_names: self.list_of_ROIs.addItem(standard_name) self.layout = QVBoxLayout() self.layout.addWidget(self.explanation_text) self.layout.addWidget(self.input_field) self.layout.addWidget(self.list_label) self.layout.addWidget(self.list_of_ROIs) self.layout.addWidget(self.button_area) self.setLayout(self.layout) self.list_of_ROIs.clicked.connect(self.on_roi_clicked)
def _get_icon(self): pixmap = QtGui.QPixmap(self._size, self._size) pixmap.fill(QtCore.Qt.transparent) painter = QtGui.QPainter(pixmap) color = QtCore.Qt.green brush = QtGui.QBrush(color) painter.setBrush(brush) painter.setPen(QtCore.Qt.NoPen) painter.drawEllipse(0, 0, self._size, self._size) painter.end() return QtGui.QIcon(pixmap)
def create_edit_button(self): """ Create Edit button. """ self.Edit_button = QtWidgets.QPushButton() self.Edit_button.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) icon_edit = QtGui.QIcon() icon_edit.addPixmap( QtGui.QPixmap(resource_path('res/images/btn-icons/draw_icon.png')), QtGui.QIcon.Normal, QtGui.QIcon.On) self.Edit_button.setIcon(icon_edit)
def __init__(self, clipboard): QPushButton.__init__(self) self.clipboard = clipboard self.prefix = '<< INITIAL PREFIX >>' self.players: PlayerListItem = [] self.mode = StatsType.ZONE self.fame = 0.0 self.clicked.connect(self.copy) self.setIcon(QtGui.QIcon(assets.path('copy.png'))) self.setToolTip("Copy to clipboard")
def createColorToolButtonIcon(self, imageFile, color): pixmap = QtGui.QPixmap(50, 80) pixmap.fill(QtCore.Qt.transparent) painter = QtGui.QPainter(pixmap) image = QtGui.QPixmap(imageFile) target = QtCore.QRect(0, 0, 50, 60) source = QtCore.QRect(0, 0, 42, 42) painter.fillRect(QtCore.QRect(0, 60, 50, 80), color) painter.drawPixmap(target, image, source) painter.end() return QtGui.QIcon(pixmap)
def retranslateUi(self, ui): _translate = QtCore.QCoreApplication.translate ui.setWindowTitle(_translate("isMsi", "LolMatches")) ui.setWindowIcon(QtGui.QIcon('icon.png')) self.isLpl.setText(_translate("isMsi", "LPL")) self.isLck.setText(_translate("isMsi", "LCK")) self.isLec.setText(_translate("isMsi", "LEC")) self.isWorlds.setText(_translate("isMsi", "Worlds")) self.isLcs.setText(_translate("isMsi", "LCS")) self.isMsi.setText(_translate("isMsi", "MSI")) self.submitButton.setText(_translate("isMsi", "Show Matches")) self.groupBox.setTitle(_translate("isMsi", "Matches"))
def __init__(self, parent, app: FastFlixApp): super(CommandList, self).__init__(parent) self.app = app self.video_options = parent layout = QtWidgets.QGridLayout() top_row = QtWidgets.QHBoxLayout() top_row.addWidget(QtWidgets.QLabel(t("Commands to execute"))) copy_commands_button = QtWidgets.QPushButton( QtGui.QIcon(get_icon("onyx-copy", self.app.fastflix.config.theme)), t("Copy Commands")) copy_commands_button.setToolTip( t("Copy all commands to the clipboard")) copy_commands_button.clicked.connect( lambda: self.copy_commands_to_clipboard()) save_commands_button = QtWidgets.QPushButton( QtGui.QIcon(get_icon("onyx-save", self.app.fastflix.config.theme)), t("Save Commands")) save_commands_button.setToolTip(t("Save commands to file")) save_commands_button.clicked.connect( lambda: self.save_commands_to_file()) top_row.addStretch() top_row.addWidget(copy_commands_button) top_row.addWidget(save_commands_button) layout.addLayout(top_row, 0, 0) self.inner_widget = QtWidgets.QWidget() self.scroll_area = QtWidgets.QScrollArea(self) self.scroll_area.setMinimumHeight(200) layout.addWidget(self.scroll_area) self.commands = [] self.setLayout(layout)
def setup(self): ''' self.header = [ "x", # [0] float "y", # [1] float "radius", # [2] float "enabled", # [3] checkbox "del", # [4] button ] ''' delegate = PyCutDoubleSpinBoxDelegate(self) self.setItemDelegateForColumn(0, delegate) delegate = PyCutDoubleSpinBoxDelegate(self) self.setItemDelegateForColumn(1, delegate) delegate = PyCutDoubleSpinBoxDelegate(self) self.setItemDelegateForColumn(2, delegate) delegate = PyCutCheckBoxDelegate(self) self.setItemDelegateForColumn(3, delegate) # Make the combo boxes / check boxes / others specials always displayed. for k in range(self.model().rowCount(None)): self.openPersistentEditor(self.model().index(k, 0)) # x self.openPersistentEditor(self.model().index(k, 1)) # y self.openPersistentEditor(self.model().index(k, 2)) # radius self.openPersistentEditor(self.model().index(k, 3)) # enabled for row in range(self.model().rowCount(None)): btn_del_tab = QtWidgets.QPushButton() btn_del_tab.setText("") btn_del_tab.setIcon( QtGui.QIcon(':/images/tango/22x22/actions/edit-clear.png')) btn_del_tab.setToolTip("DeleteTab") btn_del_tab.clicked.connect(self.cb_delete_tab) self.setIndexWidget(self.model().index(row, 4), btn_del_tab) # setup a right grid size vwidth = self.verticalHeader().width() hwidth = self.horizontalHeader().length() swidth = self.style().pixelMetric(QtWidgets.QStyle.PM_ScrollBarExtent) fwidth = self.frameWidth() * 2 #self.setFixedWidth(vwidth + hwidth + swidth + fwidth) #self.setMinimumWidth(vwidth + hwidth + swidth + fwidth) self.resizeColumnsToContents() # now! self.setColumnWidth(0, 70) # x self.setColumnWidth(1, 70) # y self.setColumnWidth(2, 60) # radius quite small
def __init__(self, config): super().__init__() self.name = config["name"] self.description = config["description"] self.values = config["values"].copy() self.options = [] self._init_options() self.init_gui() self.setWindowIcon(qtg.QIcon("img/app-block.png")) self.setWindowTitle("Настройка параметрів: {}".format(self.name))
def create_save_button(self): """ Create Save Button. """ self.Save_button = QtWidgets.QPushButton(self.scrollAreaWidgetContents) self.Save_button.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) icon_save = QtGui.QIcon() icon_save.addPixmap( QtGui.QPixmap(resource_path('res/images/btn-icons/save_icon.png')), QtGui.QIcon.Normal, QtGui.QIcon.On ) self.Save_button.setIcon(icon_save)
def _init_fullscreen_graph(self): """""" graph = self._init_graph_and_return() layout = qtw.QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(graph) self.dialog = qtw.QWidget() self.dialog.graph = graph self.dialog.setWindowIcon(qtg.QIcon("img/app-block.png")) self.dialog.setWindowTitle("Розширений перегляд") self.dialog.setLayout(layout)
def nicklist_refresh(self): """Refresh nicklist.""" self.widget.nicklist.clear() for group in sorted(self.nicklist): for nick in sorted(self.nicklist[group]['nicks'], key=lambda n: n['name']): prefix_color = { '': '', ' ': '', '+': 'yellow', } col = prefix_color.get(nick['prefix'], 'green') if col: icon = QtGui.QIcon( resource_filename( __name__, 'data/icons/bullet_%s_8x8.png' % col)) else: pixmap = QtGui.QPixmap(8, 8) pixmap.fill() icon = QtGui.QIcon(pixmap) item = QtWidgets.QListWidgetItem(icon, nick['name']) self.widget.nicklist.addItem(item) self.widget.nicklist.setVisible(True)
def create_app(): if not get_bool_env("FF_DPI_OFF"): if hasattr(QtCore.Qt, "AA_EnableHighDpiScaling"): QtWidgets.QApplication.setAttribute( QtCore.Qt.AA_EnableHighDpiScaling, True) if hasattr(QtCore.Qt, "AA_UseHighDpiPixmaps"): QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) main_app = FastFlixApp(sys.argv) main_app.setApplicationDisplayName("FastFlix") my_font = QtGui.QFont("helvetica", 9) main_app.setFont(my_font) main_app.setWindowIcon(QtGui.QIcon(main_icon)) return main_app
def _build_ui(self): # Main self.main_widget = QtWidgets.QFrame(self) self.main_layout = QtWidgets.QVBoxLayout(self.main_widget) self.main_layout.setContentsMargins(5, 5, 5, 5) # Search self.top_bar_frame = QtWidgets.QFrame(self) self.top_bar_layout = QtWidgets.QHBoxLayout(self.top_bar_frame) self.top_bar_layout.setContentsMargins(0, 0, 0, 0) self.search_lineedit = QtWidgets.QLineEdit(self.top_bar_frame) self.search_lineedit.setPlaceholderText("Search...") self.refresh_presets_button = QtWidgets.QPushButton(self.top_bar_frame) self.refresh_presets_button.setIcon(QtGui.QIcon(":TOP_BAR_REFRESH")) self.refresh_presets_button.setObjectName("refresh_button") self.refresh_presets_button.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.refresh_presets_button.setToolTip("Refresh Presets") # Tab widget self.tab_widget = QtWidgets.QTabWidget(self.main_widget) self.search_scroll = QtWidgets.QScrollArea(self.main_widget) self.search_scroll.setWidgetResizable(True) self.search_scroll.setVisible(False) self.search_tab_widget = QtWidgets.QTabWidget(self.search_scroll) self.search_scroll.setWidget(self.search_tab_widget) # Search Parts self.search_parts_scroll = QtWidgets.QScrollArea( self.search_tab_widget) self.search_parts_scroll.setWidgetResizable(True) self.search_parts_frame = QtWidgets.QFrame(self.search_parts_scroll) self.search_frame_layout = FlowLayout(parent=self.search_parts_frame) self.search_parts_scroll.setWidget(self.search_parts_frame) self.search_tab_widget.addTab(self.search_parts_scroll, "Parts") # Search presets self.search_presets_scroll = QtWidgets.QScrollArea( self.search_tab_widget) self.search_presets_scroll.setWidgetResizable(True) self.search_presets_frame = QtWidgets.QFrame( self.search_presets_scroll) self.search_presets_layout = QtWidgets.QVBoxLayout( self.search_presets_frame) self.search_presets_layout.setAlignment(QtCore.Qt.AlignTop) self.search_presets_scroll.setWidget(self.search_presets_frame) self.search_tab_widget.addTab(self.search_presets_scroll, "Presets")
def init_transfer_arrow_buttons(self): """ Initialize the layout for arrow buttons """ self.transfer_all_rois_to_patient_B_button = QPushButton() self.transfer_all_rois_to_patient_B_button.setObjectName( "ROITransferToBButton") transfer_all_rois_to_patient_B_icon = QtGui.QIcon() transfer_all_rois_to_patient_B_icon.addPixmap( QtGui.QPixmap( resource_path('res/images/btn-icons/forward_slide_icon.png')), QtGui.QIcon.Normal, QtGui.QIcon.On) self.transfer_all_rois_to_patient_B_button \ .setIcon(transfer_all_rois_to_patient_B_icon) self.transfer_all_rois_to_patient_B_button.clicked.connect( self.transfer_all_rois_to_patient_B_button_clicked) self.transfer_roi_window_grid_layout.addWidget( self.transfer_all_rois_to_patient_B_button, 1, 1) self.transfer_all_rois_to_patient_A_button = QPushButton() self.transfer_all_rois_to_patient_A_button.setObjectName( "ROITransferToAButton") self.transfer_all_rois_to_patient_A_button.setMaximumWidth(100) transfer_all_rois_to_patient_A_icon = QtGui.QIcon() transfer_all_rois_to_patient_A_icon.addPixmap( QtGui.QPixmap( resource_path('res/images/btn-icons/backward_slide_icon.png')), QtGui.QIcon.Normal, QtGui.QIcon.On) self.transfer_all_rois_to_patient_A_button \ .setIcon(transfer_all_rois_to_patient_A_icon) self.transfer_all_rois_to_patient_A_button.clicked.connect( self.transfer_all_rois_to_patient_A_button_clicked) self.transfer_roi_window_grid_layout.addWidget( self.transfer_all_rois_to_patient_A_button, 2, 1)
def createActions(self): self.toFrontAction = QtGui.QAction( QtGui.QIcon(':/images/bringtofront.png'), "Bring to &Front", self, shortcut="Ctrl+F", statusTip="Bring item to front", triggered=self.bringToFront) self.sendBackAction = QtGui.QAction( QtGui.QIcon(':/images/sendtoback.png'), "Send to &Back", self, shortcut="Ctrl+B", statusTip="Send item to back", triggered=self.sendToBack) self.deleteAction = QtGui.QAction(QtGui.QIcon(':/images/delete.png'), "&Delete", self, shortcut="Delete", statusTip="Delete item from diagram", triggered=self.deleteItem) self.exitAction = QtGui.QAction("E&xit", self, shortcut="Ctrl+X", statusTip="Quit Scenediagram example", triggered=self.close) self.boldAction = QtGui.QAction(QtGui.QIcon(':/images/bold.png'), "Bold", self, checkable=True, shortcut="Ctrl+B", triggered=self.handleFontChange) self.italicAction = QtGui.QAction(QtGui.QIcon(':/images/italic.png'), "Italic", self, checkable=True, shortcut="Ctrl+I", triggered=self.handleFontChange) self.underlineAction = QtGui.QAction( QtGui.QIcon(':/images/underline.png'), "Underline", self, checkable=True, shortcut="Ctrl+U", triggered=self.handleFontChange) self.aboutAction = QtGui.QAction("A&bout", self, shortcut="Ctrl+B", triggered=self.about)
def setup_ui(self, add_on_options, roi_line, roi_opacity, iso_line, iso_opacity, line_width): """ Create the window and the components for each option view. """ self.stylesheet_path = "" if platform.system() == 'Darwin': self.stylesheet_path = "res/stylesheet.qss" else: self.stylesheet_path = "res/stylesheet-win-linux.qss" stylesheet = open(resource_path(self.stylesheet_path)).read() add_on_options.setObjectName("Add_On_Options") add_on_options.setMinimumSize(960, 720) add_on_options.setStyleSheet(stylesheet) add_on_options.setWindowIcon( QtGui.QIcon( resource_path("res/images/btn-icons/onkodicom_icon.png"))) _translate = QtCore.QCoreApplication.translate add_on_options.setWindowTitle( _translate("Add_On_Options", "Add-On Options")) self.widget = QtWidgets.QWidget(add_on_options) self.init_user_options_header() self.windowing_options = WindowingOptions(self) self.standard_organ_options = StandardOrganOptions(self) self.standard_volume_options = StandardVolumeOptions(self) self.patient_hash_options = PatientHashId(self) self.line_fill_options = LineFillOptions(self, roi_line, roi_opacity, iso_line, iso_opacity, line_width) self.iso2roi_options = RoiFromIsodoseOptions(self) self.change_default_directory = ChangeDefaultDirectory(self) self.clinical_data_csv_dir_options = \ ClinicalDataCSVDirectoryOptions(self) self.image_fusion_add_on_options = ImageFusionOptions(self) self.create_cancel_button() self.create_apply_button() self.init_tree_list() self.set_layout() self.add_into_observer() add_on_options.setCentralWidget(self.widget) QtCore.QMetaObject.connectSlotsByName(add_on_options)
def __init__(self, parent=None): QtWidgets.QSystemTrayIcon.__init__(self, QtGui.QIcon(APP_ICON_PATH), parent) self.setToolTip(APP_NAME) self.mainDialog = MainAppDialog() menu = QtWidgets.QMenu(parent) open_app = menu.addAction("Open") open_app.triggered.connect(self.mainDialog.show) menu.addSeparator() exit_ = menu.addAction("Exit") exit_.triggered.connect(self._onExit) self.setContextMenu(menu) self.activated.connect(self._onTrayIconActivated)
def create_widgets(self): self.current_asset_wgt = QtWidgets.QLabel() self.asset_type_wgt = QtWidgets.QLabel() self.publish_type_cat_wgt = QtWidgets.QComboBox() self.publish_sub_cat_wgt = QtWidgets.QComboBox() self.filepath_le = QtWidgets.QLineEdit() self.select_file_path_btn = QtWidgets.QPushButton() self.select_file_path_btn.setIcon(QtGui.QIcon(":fileOpen.png")) self.output_log_wget = QtWidgets.QTextBrowser() self.publish_btn_wgt = QtWidgets.QPushButton('Publish') self.cancle_btn_wgt = QtWidgets.QPushButton('Cancle') self.statusBar_wgt = QtWidgets.QStatusBar()
def createBackgroundCellWidget(self, text, image): button = QtWidgets.QToolButton() button.setText(text) button.setIcon(QtGui.QIcon(image)) button.setIconSize(QtCore.QSize(50, 50)) button.setCheckable(True) self.backgroundButtonGroup.addButton(button) layout = QtWidgets.QGridLayout() layout.addWidget(button, 0, 0, QtCore.Qt.AlignHCenter) layout.addWidget(QtWidgets.QLabel(text), 1, 0, QtCore.Qt.AlignCenter) widget = QtWidgets.QWidget() widget.setLayout(layout) return widget
def __init__(self, *args, **kwargs): super(AssetBrowser, self).__init__(*args, **kwargs) self.setWindowTitle("No Man's Sky Base Builder :: Asset Browser") self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.WindowStaysOnTopHint) app_id = u"charliebanks.NMSBB.AssetBrowser.1" # arbitrary string ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id) self.setWindowTitle("No Man's Sky Blender Builder - Asset Browser") self.setWindowIcon(QtGui.QIcon(APP_ICON)) self.__search_buttons = [] self.__preset_search_buttons = [] self._build_ui() self._layout_ui() self._setup_ui() self.generate_contents() self.apply_style()
def __init__(self, parent, app: FastFlixApp): super().__init__(parent) self.app = app self.main = parent.main self.attachments = Box() self.updating = False self.only_int = QtGui.QIntValidator() self.layout = QtWidgets.QGridLayout() self.last_row = 0 self.init_fps() self.add_spacer() self.init_video_speed() self.add_spacer() self.init_eq() self.add_spacer() self.init_denoise() self.add_spacer() self.init_deblock() self.add_spacer() self.init_color_info() self.add_spacer() self.init_vbv() self.last_row += 1 self.layout.setRowStretch(self.last_row, True) # self.layout.setColumnStretch(6, True) self.last_row += 1 warning_label = QtWidgets.QLabel() ico = QtGui.QIcon(get_icon("onyx-warning", app.fastflix.config.theme)) warning_label.setPixmap(ico.pixmap(22)) self.layout.addWidget(warning_label, self.last_row, 0, alignment=QtCore.Qt.AlignRight) self.layout.addWidget( QtWidgets.QLabel( t("Advanced settings are currently not saved in Profiles")), self.last_row, 1, 1, 4) for i in range(6): self.layout.setColumnMinimumWidth(i, 155) self.setLayout(self.layout)
def __init__(self): super(Main, self).__init__() loader = QUiLoader() self.ui = loader.load('Assignment18/MessageBox/form.ui') self.ui.show() self.lightTheme = True self.ui.setWindowIcon(QtGui.QIcon('Assignment18/MessageBox/assets/img/icon.png')) self.ui.btn_light.setIcon(QIcon('Assignment18/MessageBox/assets/img/light_mode.png')) self.ui.btn_del_all.setIcon(QIcon('Assignment18/MessageBox/assets/img/delete.png')) self.ui.btn_send.clicked.connect(self.addNewMessage) self.ui.btn_del_all.clicked.connect(self.deleteAllMessage) self.ui.btn_light.clicked.connect(self.changeTheme) self.messages = self.readMessages() self.length = len(self.messages) self.ui.txt_message.installEventFilter(self)
def setup_app(): QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_DisableHighDpiScaling) app = QtWidgets.QApplication(sys.argv) pixmap = QtGui.QPixmap(os.path.join(QGRAIN_ROOT_PATH, "assets", "icon.png")) create_necessary_folders() app.setWindowIcon(QtGui.QIcon(pixmap)) app.setApplicationVersion(QGRAIN_VERSION) from qt_material import apply_stylesheet apply_stylesheet(app, theme=os.path.join(QGRAIN_ROOT_PATH, "assets", "default_theme.xml"), invert_secondary=True, extra=EXTRA) setup_matplotlib() setup_language(app, "en") return app
def createCellWidget(self, text, diagramType): item = DiagramItem(diagramType, self.itemMenu) icon = QtGui.QIcon(item.image()) button = QtWidgets.QToolButton() button.setIcon(icon) button.setIconSize(QtCore.QSize(50, 50)) button.setCheckable(True) self.buttonGroup.addButton(button, diagramType) layout = QtWidgets.QGridLayout() layout.addWidget(button, 0, 0, QtCore.Qt.AlignHCenter) layout.addWidget(QtWidgets.QLabel(text), 1, 0, QtCore.Qt.AlignCenter) widget = QtWidgets.QWidget() widget.setLayout(layout) return widget
def __init__(self): super().__init__() self.icon = QtGui.QIcon(umn_config.PATH_ICON) self.setWindowIcon(self.icon) self.setWindowTitle("uumail notification について") self.setFixedSize(600, 370) self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowStaysOnTopHint) self.label = QtWidgets.QLabel(self) self.label_style = """QLabel { font-size: 43px; /* 文字サイズ */ padding: 0px 40px; }""" self.font = QtGui.QFont() self.font.setPointSize(13) self.label.setStyleSheet(self.label_style) self.label.setText("uumail notification") self.label.setGeometry(QtCore.QRect(120, 0, 480, 120)) self.umnlogo_image = QtGui.QImage('icon\\uumail.png') self.umnlogo_pixmap = QtGui.QPixmap.fromImage( self.umnlogo_image.scaledToHeight(120)) self.umnlogo_label = QtWidgets.QLabel(self) self.umnlogo_label.setPixmap(self.umnlogo_pixmap) self.umnlogo_label.setGeometry(QtCore.QRect(0, 0, 120, 120)) self.varsion_txt = QtWidgets.QLabel(self) self.varsion_txt.setText("Version : 2.0") self.varsion_txt.setFont(self.font) self.varsion_txt.setGeometry(QtCore.QRect(40, 150, 500, 30)) self.github_txt = QtWidgets.QLabel(self) self.github_txt.setText( "Github : https://github.com/ikepggthb/uumail_notification") self.github_txt.setFont(self.font) self.github_txt.setGeometry(QtCore.QRect(40, 190, 500, 30)) self.licence_txt = QtWidgets.QLabel(self) self.licence_txt.setText( "オープンソースソフトウェア(OSS)であり、GPLv3の条件で許諾されます。\nこのソフトウェアを使用、複製、配布、ソースコードを修正することができます。" ) self.licence_txt.setFont(self.font) self.licence_txt.setGeometry(QtCore.QRect(40, 230, 500, 45)) self.cpn_txt = QtWidgets.QLabel(self) self.cpn_txt.setText( "© 2020 ikkei Yamada All Rights Reserved.\n Twitter : @idkaeti , Email : [email protected]" ) self.cpn_txt.setFont(self.font) self.cpn_txt.setGeometry(QtCore.QRect(40, 290, 500, 45))