def __init__(self): SettingsTabBase.__init__(self, "Core") self.le_working_folder = Qt.QLineEdit() self.pb_working_browse = Qt.QPushButton(Qt.QIcon(":/folder.png"), "") self.pb_working_reset = Qt.QPushButton(Qt.QIcon(":/reset.png"), "") self.pb_working_browse.clicked.connect(self.browse_working_folder) self.pb_working_reset.clicked.connect(self.reset_working_folder) self.pb_always_on_top = Qt.QPushButton("Window always on top") self.pb_always_on_top.setCheckable(True) self.pb_check_for_updates = Qt.QPushButton("Check for updates") self.pb_check_for_updates.setCheckable(True) work_layout = Qt.QHBoxLayout() work_layout.addWidget(Qt.QLabel("File Folder: "), 0) work_layout.addWidget(self.le_working_folder, 1) work_layout.addWidget(self.pb_working_browse, 0) work_layout.addWidget(self.pb_working_reset, 0) bottom_layout = Qt.QHBoxLayout() bottom_layout.addWidget(self.pb_always_on_top) bottom_layout.addWidget(self.pb_check_for_updates) bottom_layout.addStretch() layout = Qt.QVBoxLayout() layout.addLayout(work_layout) layout.addLayout(bottom_layout) self.set_layout(layout)
def __init__(self, parent, mapping): qt.QWidget.__init__(self, parent) self.layout = qt.QHBoxLayout(self) # Add the table. self.table = ShelfTagMappingTableWidget(self, mapping) self.layout.addWidget(self.table) # Add buttons next to the tag table to add/remove tags. self.button_layout = qt.QVBoxLayout() self.layout.addLayout(self.button_layout) # Button to add a new mapping. add_mapping_button = QtGui.QToolButton(self) add_mapping_button.setToolTip('Add mapping') add_mapping_button.setIcon(qt.QIcon(I('plus.png'))) add_mapping_button.clicked.connect(self.add_mapping) self.button_layout.addWidget(add_mapping_button) # Button to remove a mapping. remove_mapping_button = QtGui.QToolButton(self) remove_mapping_button.setToolTip('Remove mapping') remove_mapping_button.setIcon(qt.QIcon(I('minus.png'))) remove_mapping_button.clicked.connect(self.delete_mapping) self.button_layout.addWidget(remove_mapping_button) # Button to reset the mappings to the default set. reset_defaults_button = QtGui.QToolButton(self) reset_defaults_button.setToolTip('Reset to default mappings') reset_defaults_button.setIcon(qt.QIcon(I('edit-undo.png'))) reset_defaults_button.clicked.connect(self.reset_to_defaults) self.button_layout.addWidget(reset_defaults_button) # Add stretch to position the buttons at the top. self.button_layout.addStretch()
def arayuzOlustur(self,veri): gridalan=QtWidgets.QGridLayout() gridalan.setVerticalSpacing(10) logo=QtWidgets.QLabel() img=QtGui.QPixmap("images/uygulama_logo.png") img=img.scaledToWidth(180) logo.setPixmap(img) logo.setFixedSize(200,200) logo.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(logo,0,0,alignment=QtCore.Qt.AlignCenter) baslik1=QtWidgets.QLabel("<h2 style= color:#FF5050>Merhaba "+veri+"</h2>") gridalan.addWidget(baslik1,1,0,alignment=QtCore.Qt.AlignCenter) cikisbuton=QtWidgets.QPushButton(Qt.QIcon("images/logout_icon.png"),"ÇIKIŞ") gridalan.addWidget(cikisbuton,2,0,alignment=QtCore.Qt.AlignCenter) cikisbuton.clicked.connect(lambda:self.anaEkranFonk()) baslik2=QtWidgets.QLabel("<h3><p> </p>Rehberinize ister şifre ekleyin, isterseniz şifrelerinizi görüntüleyin</h3>") gridalan.addWidget(baslik2,3,0,alignment=QtCore.Qt.AlignCenter) sifrekaydetbuton=QtWidgets.QPushButton(Qt.QIcon("images/sifrekaydet_icon.png"), "YENİ ŞİFRE KAYDET") sifrekaydetbuton.setFixedWidth(200) gridalan.addWidget(sifrekaydetbuton,5,0,alignment=QtCore.Qt.AlignCenter) sifrekaydetbuton.clicked.connect(lambda:self.sifreKaydetFonk(veri)) sifrelerigosterbuton=QtWidgets.QPushButton(Qt.QIcon("images/sifregoster_icon.png"), "ŞİFRELERİMİ GÖSTER") sifrelerigosterbuton.setFixedWidth(200) gridalan.addWidget(sifrelerigosterbuton,6,0,alignment=QtCore.Qt.AlignCenter) sifrelerigosterbuton.clicked.connect(lambda: self.passViewFonk(veri)) gridalan.setAlignment(QtCore.Qt.AlignCenter) self.setLayout(gridalan)
def _compose_icon(bottom_left=None, top_right=None): base = _load_pixmap("base.png") if bottom_left is None and top_right is None: return Qt.QIcon(base) if bottom_left is not None: bottom_left = _load_pixmap(bottom_left).toImage() if top_right is not None: top_right = _load_pixmap(top_right).toImage() base = base.toImage() painter = Qt.QPainter() painter.begin(base) if bottom_left is not None: y = base.height() - bottom_left.height() painter.drawImage( Qt.QPoint(0, y), bottom_left ) if top_right is not None: x = base.width() - top_right.width() painter.drawImage( Qt.QPoint(x, 0), top_right ) painter.end() return Qt.QIcon(Qt.QPixmap.fromImage(base))
def __init__(self): SettingsTabBase.__init__(self, "Presets") self.lw_directory = Qt.QListWidget() self.lw_directory.setMaximumHeight(100) self.pb_add = Qt.QPushButton(Qt.QIcon(":/add.png"), "") self.pb_remove = Qt.QPushButton(Qt.QIcon(":/remove.png"), "") self.pb_browse = Qt.QPushButton(Qt.QIcon(":/folder.png"), "") self.pb_reset = Qt.QPushButton(Qt.QIcon(":/reset.png"), "") self.pb_add.clicked.connect(self.add) self.pb_remove.clicked.connect(self.remove) self.pb_reset.clicked.connect(self.reset) self.pb_browse.clicked.connect(self.browse) bottom_layout = Qt.QHBoxLayout() bottom_layout.addWidget(self.pb_add) bottom_layout.addWidget(self.pb_remove) bottom_layout.addWidget(self.pb_browse) bottom_layout.addStretch() bottom_layout.addWidget(self.pb_reset) layout = Qt.QVBoxLayout() layout.addWidget(Qt.QLabel("Additionnal presets directory:")) layout.addWidget(self.lw_directory) layout.addLayout(bottom_layout) self.set_layout(layout)
def arayuzOlustur(self): gridalan=Qt.QGridLayout(self) logo=QtWidgets.QLabel() logo.setPixmap(QtGui.QPixmap("images/register_icon.png")) logo.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(logo, 0, 0, 1, 0) baslik1=QtWidgets.QLabel("<h3 style= color:#FF5050>KAYIT OL EKRANI</h3><p></p>") baslik1.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(baslik1, 1, 0, 2, 0) baslik2=QtWidgets.QLabel("<h4>Kayıt olabilmek için lütfen gerekli bilgileri doldurunuz.<p></p></h4>") baslik2.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(baslik2, 2, 0, 3, 0) kullaniciadi_label=QtWidgets.QLabel("<h4>Kullanıcı Adı:</h4>") gridalan.addWidget(kullaniciadi_label, 5, 0) kullaniciadi_text = QtWidgets.QLineEdit() kullaniciadi_text.setPlaceholderText("Kullanıcı adınızı yazınız") gridalan.addWidget(kullaniciadi_text, 5, 1) kullaniciadi_text.textChanged.connect(lambda: self.kullaniciadicalisti(kullaniciadi_text.text())) parola_label=QtWidgets.QLabel("<h4>Parola:</h4>") gridalan.addWidget(parola_label, 6, 0) parola_text=QtWidgets.QLineEdit() parola_text.setPlaceholderText("Parolanızı yazınız") parola_text.setEchoMode(QtWidgets.QLineEdit.Password) gridalan.addWidget(parola_text, 6, 1) parola_text.textChanged.connect(lambda: self.parolacalisti(parola_text.text())) parola_onay_label=QtWidgets.QLabel("<h4>Parola(tekrar):</h4>") gridalan.addWidget(parola_onay_label, 7, 0) parola_onay_text=QtWidgets.QLineEdit() parola_onay_text.setPlaceholderText("Parolanızı tekrar yazınız") parola_onay_text.setEchoMode(QtWidgets.QLineEdit.Password) gridalan.addWidget(parola_onay_text, 7, 1) parola_onay_text.textChanged.connect(lambda:self.parolaonaycalisti(parola_onay_text.text())) bosluk = QtWidgets.QLabel("<h4> </h4>") gridalan.addWidget(bosluk, 8, 1) kaydetbuton = QtWidgets.QPushButton(Qt.QIcon("images/save_icon.png"), "KAYDET") gridalan.addWidget(kaydetbuton, 9, 1) kaydetbuton.clicked.connect(lambda:self.kaydetFonk()) anaekranbuton=QtWidgets.QPushButton(Qt.QIcon("images/home_icon.png"), "ANA EKRAN") gridalan.addWidget(anaekranbuton, 10, 1) anaekranbuton.clicked.connect(lambda:self.anaEkranFonk()) gridalan.setAlignment(QtCore.Qt.AlignCenter) self.setLayout(gridalan)
def __init__(self, text, back_function, main_function): super().__init__() back_button = Qt.QPushButton(Qt.QIcon(common.LEFT), '', self) back_button.setObjectName('Flat') back_button.setCursor(Qt.Qt.PointingHandCursor) back_button.setIconSize(Qt.QSize(35, 35)) back_button.setFixedSize(Qt.QSize(55, 55)) back_button.clicked.connect(lambda _: back_function()) confirm_title = Qt.QLabel('Подтвердите действие', self) confirm_title.setFont(Qt.QFont('Arial', 30)) confirm_label = Qt.QLabel(text, self) confirm_label.setFont(Qt.QFont('Arial', 25)) confirm_label.setAlignment(Qt.Qt.AlignCenter) confirm_label.setWordWrap(True) confirm_label.setStyleSheet('color: red') yes_button = Qt.QPushButton(Qt.QIcon(common.TICK), 'Да, продолжить', self) yes_button.setObjectName('Button') yes_button.setIconSize(Qt.QSize(35, 35)) yes_button.setFont(Qt.QFont('Arial', 20)) yes_button.clicked.connect(lambda _: main_function()) no_button = Qt.QPushButton(Qt.QIcon(common.CROSS), 'Нет, отменить', self) no_button.setObjectName('Button') no_button.setIconSize(Qt.QSize(35, 35)) no_button.setFont(Qt.QFont('Arial', 20)) no_button.clicked.connect(lambda _: back_function()) upper_layout = Qt.QHBoxLayout() upper_layout.addWidget(back_button) upper_layout.addStretch(1) upper_layout.addWidget(confirm_title) upper_layout.addStretch(1) button_layout = Qt.QHBoxLayout() button_layout.addStretch(1) button_layout.addWidget(yes_button) button_layout.addSpacerItem(Qt.QSpacerItem(20, 0)) button_layout.addWidget(no_button) button_layout.addStretch(1) layout = Qt.QVBoxLayout() layout.addLayout(upper_layout) layout.addStretch(1) layout.addWidget(confirm_label) layout.addSpacerItem(Qt.QSpacerItem(0, 30)) layout.addLayout(button_layout) layout.addStretch(1) self.setLayout(layout)
def init_qapplication(icon_resource_path=None): global QAPPLICATION if QAPPLICATION is None: # It seems to work even if there is an already-extant QApplication # instance (e.g. started by matplotlib or whatnot). So maybe the below # test isn't needed? TODO: verify that this is the case on all platforms... # assert Qt.QApplication.instance() is None pre_qapp_initialization() QAPPLICATION = Qt.QApplication([]) if icon_resource_path is not None: ICON = Qt.QIcon( pkg_resources.resource_filename(*icon_resource_path)) QAPPLICATION.setWindowIcon(ICON) try: # are we running in IPython? import IPython ipython = IPython.get_ipython( ) # None if IPython is not currently running except ModuleNotFoundError: ipython = None if ipython is not None: # If iPython is running, turn on the GUI integration ipython.enable_gui('qt5') # QApplication.aboutToQuit is not emitted when exiting via IPython # so register a handler to do so atexit.register(_emit_about_to_quit)
def __init__(self): # qt stuff super(genLibrary, self).__init__() uic.loadUi('library_prompt.ui', self) self.setWindowTitle('Generate Library') self.setWindowIcon(Qt.QIcon('cas9image.png')) # button connections self.cancel_button.clicked.connect(self.cancel_function) self.BrowseButton.clicked.connect(self.browse_function) self.submit_button.clicked.connect(self.submit_data) self.progressBar.setValue(0) # variables self.anno_data = dict() self.cspr_file = '' self.parser = CSPRparser('') self.kegg_nonKegg = '' self.gen_lib_dict = dict() self.S = SeqTranslate() self.cspr_data = dict() self.Output = dict() self.off_tol = .05 self.off_max_misMatch = 4 self.off_target_running = False # set the numbers for the num genes combo box item for i in range(10): self.numGenescomboBox.addItem(str(i + 1)) # set the numbers for the minOn combo box for i in range(19, 70): self.minON_comboBox.addItem(str(i + 1))
def initUI(self): exitAction = Qt.QAction('Exit', self) exitAction.setShortcut('Ctrl+Q') exitAction.triggered.connect(Qt.qApp.quit) #Restart icon and function ri = Qt.QPixmap() ri.load( os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data', 'restart.png'), 'PNG') restart = Qt.QAction(Qt.QIcon(ri), 'New Game', self) restart.setShortcut('Ctrl+N') restart.triggered.connect(self.b.resetGame) #Grid layout self.gridContainer = Qt.QWidget() self.grid = Qt.QGridLayout() self.grid.addWidget(self.tmr, 0, 0) self.grid.addWidget(self.mc, 0, 1) self.grid.addWidget(self.b, 1, 0, 20, 2) self.gridContainer.setLayout(self.grid) #self.grid.setRowMinimumHeight(1, 400) #self.grid.setColumnMinimumWidth(0, self.size().width()) self.setCentralWidget(self.gridContainer) self.toolbar = self.addToolBar('Tooooooooools') self.toolbar.addAction(restart) #self.toolbar.addAction(exitAction) self.resize(self.b.w * 50, self.b.h * 50 + 200) self.setWindowTitle('Python Minesweeper') self.show()
def __init__(self): super().__init__() resolution = Qt.QDesktopWidget().screenGeometry() self.resize(resolution.width() // 1.5, resolution.height() // 1.5) self.setWindowIcon(Qt.QIcon('pythonlogo.png')) self.setWindowTitle("Spectr") self.mode = 'Dual beam mode' self.exporters = exporters self.old_val_bar = False self.q_stop = Queue() self.q_bar = Queue() self.q_str = Queue() self.speed_nm = 128 work_data = '\data' self.start = False path = os.getcwd() self.work_space = path + work_data print(path) try: os.mkdir(self.work_space) except OSError: print ("Creation of the directory %s failed" % path) print(self.work_space) # print('data'in work_space) self.j = 0 self.init_gui()
def load_icon(*args, **kwargs): """ Load icon from resource files. Default pixmap can be provided via the *default* keyword argument. Note: Icon files are searched in the application's resource directory. Arguments: *args: Icon file names. **kwargs: Keyword arguments. Returns: QIcon: Icon object. The following named parameters can be passed via `**kwargs`: - *default* (QIcon): Default pixmap. See also: `load_pixmap()`, `load_icon_set()` """ if Q.QApplication.instance() is None: return kwargs.get('default', None) return Q.QIcon(load_pixmap(*args, **kwargs))
def __init__(self): # qt stuff super(cspr_chromesome_selection, self).__init__() uic.loadUi("cspr_chromesome_selection.ui", self) self.setWindowTitle("Choose which chromesomes to pull data from!") self.setWindowIcon(Qt.QIcon("cas9image.png")) # button connections self.cancel_button.clicked.connect(self.cancel_function) self.submit_button.clicked.connect(self.submit_function) self.select_button.clicked.connect(self.load_chrom_names) # chrom_table stuff self.chromesome_table.setColumnCount(1) self.chromesome_table.setShowGrid(True) self.chromesome_table.setHorizontalHeaderLabels("Chromesome;".split(";")) self.chromesome_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.chromesome_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.chromesome_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) # cspr_files_available_table self.cspr_files_available_table.setColumnCount(1) self.cspr_files_available_table.setShowGrid(True) self.cspr_files_available_table.setHorizontalHeaderLabels("Files;".split(";")) self.cspr_files_available_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.cspr_files_available_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.cspr_files_available_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) # variables self.cspr_file = '' self.gene = '' self.misc = '' self.avail_cspr = dict() self.myParser = CSPRparser(self.cspr_file) self.orgName = ''
def arayuzOlustur(self,kuladi,aranan): gridalan=QtWidgets.QGridLayout() gridalan.setVerticalSpacing(10) tablewidget=QtWidgets.QTableWidget(len(aranan),2) tablewidget.setFont(QtGui.QFont("Times",weight=QtGui.QFont.Bold)) tablewidget.setFixedWidth(380) tablewidget.setColumnWidth(0,180) tablewidget.setColumnWidth(1,180) tablewidget.setHorizontalHeaderItem(0,QtWidgets.QTableWidgetItem("Uygulama Adı")) tablewidget.setHorizontalHeaderItem(1,QtWidgets.QTableWidgetItem("Uygulama Şifresi")) for i in range(len(aranan)): if aranan[i]!="": tablewidget.setItem(i,0,QtWidgets.QTableWidgetItem(aranan[i][1])) tablewidget.setItem(i,1,QtWidgets.QTableWidgetItem(aranan[i][2])) else: break gridalan.addWidget(tablewidget,0,0,alignment=QtCore.Qt.AlignCenter) geributon=QtWidgets.QPushButton(Qt.QIcon("images/geri_icon.png"),"GERİ") gridalan.addWidget(geributon,2,0,alignment=QtCore.Qt.AlignCenter) geributon.clicked.connect(lambda:self.passViewFonk(kuladi)) gridalan.setAlignment(QtCore.Qt.AlignCenter) self.setLayout(gridalan)
def main(): app = QtWidgets.QApplication(sys.argv) # Новый экземпляр QApplication window = FooQt(app) # Создаём объект класса ExampleApp window.setWindowIcon(Qt.QIcon('musical-note.png')) window.show() # Показываем окно app.exec_() # и запускаем приложение
def __init__(self, baslik, genislik=900, yukseklik=700): super().__init__() self.setWindowTitle(baslik) self.resize(genislik, yukseklik) self.setWindowIcon(Qt.QIcon("images/uygulama_icon.png")) self.arayuzOlustur() self.show()
def _initToolbar(self, fig): """ Add our icons to the toolbar """ self._actions={} self._active=None #tb=fig.canvas.manager.toolbar tb=EditMatplotlibToolbar(fig) tb.addSeparator() a=tb.addAction(Qt.QIcon(packagepath[0]+"/images/select_roi.png"), "roi", self._select_roi) a.setCheckable(True) self._actions["roi"]=a a.setToolTip("Select region of interest") a=tb.addAction(Qt.QIcon(packagepath[0]+"/images/save_histo.png"), "saveh", self._save_histo) #a.setCheckable(True) self._actions["saveh"]=a a.setToolTip("Save histo data to file")
def __init__(self): ZlmCollapsableWidget.__init__(self, "Presets: ") self.cb_preset_file = Qt.QComboBox() self.cb_layer_presets = Qt.QComboBox() self.pb_activate = Qt.QPushButton('Activate') self.pb_activate.clicked.connect(self.on_preset_activated) self.pb_add_file = Qt.QPushButton(Qt.QIcon(':/add.png'), '') self.pb_add_file.clicked.connect(self.pb_add_file_clicked) self.pb_rem_file = Qt.QPushButton(Qt.QIcon(':/remove.png'), '') self.pb_rem_file.clicked.connect(self.pb_rem_file_clicked) self.pb_add_preset = Qt.QPushButton(Qt.QIcon(':/add.png'), '') self.pb_add_preset.clicked.connect(self.pb_add_preset_clicked) self.pb_rem_preset = Qt.QPushButton(Qt.QIcon(':/remove.png'), '') self.pb_rem_preset.clicked.connect(self.pb_rem_preset_clicked) self.pb_save_preset = Qt.QPushButton(Qt.QIcon(':/save.png'), '') self.pb_save_preset.clicked.connect(self.pb_save_preset_clicked) layout1 = Qt.QHBoxLayout() layout1.addWidget(self.cb_preset_file, 1) layout1.addWidget(self.pb_add_file, 0) layout1.addWidget(self.pb_rem_file, 0) layout2 = Qt.QHBoxLayout() layout2.addWidget(self.cb_layer_presets, 1) layout2.addWidget(self.pb_save_preset, 0) layout2.addWidget(self.pb_add_preset, 0) layout2.addWidget(self.pb_rem_preset, 0) mainLayout = Qt.QVBoxLayout() mainLayout.addLayout(layout1) mainLayout.addLayout(layout2) mainLayout.addWidget(self.pb_activate) self.set_layout(mainLayout) self.presets = {} self._app_index = 0 self._user_index = 0 self.build_presets() self.cb_preset_file.currentIndexChanged.connect( self.preset_file_changed)
def __init__(self): super().__init__() resolution = Qt.QDesktopWidget().screenGeometry() self.resize(resolution.width() // 2, resolution.height() // 2) self.setWindowTitle("Spectr") self.setWindowIcon( Qt.QIcon('C:\\Users\\FRostNOva\\Desktop\\Python\\pythonlogo.png')) self.init_gui()
def spawn_notification(self, data): eventTitle = data['eventTitle'] eventDescription = data['eventDescription'] app = Qt.QApplication(sys.argv) systemtray_icon = Qt.QSystemTrayIcon(Qt.QIcon("df")) systemtray_icon.show() systemtray_icon.showMessage(eventTitle, eventDescription)
def arayuzOlustur(self,gelen): gridalan=Qt.QGridLayout(self) logo=QtWidgets.QLabel() logo.setPixmap(QtGui.QPixmap("images/sifrekaydet_icon.png")) logo.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(logo, 0, 0, 1, 0) baslik1=QtWidgets.QLabel("<h3 style= color:#FF5050>REHBERE ŞİFRE KAYDET EKRANI</h3><p></p>") baslik1.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(baslik1, 1, 0, 2, 0) baslik2=QtWidgets.QLabel("<h4>Şifre kaydı için lütfen gerekli bilgileri doldurunuz.<p></p></h4>") baslik2.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(baslik2, 2, 0, 3, 0) uygulamaadi_label=QtWidgets.QLabel("<h4>Uygulama Adı:</h4>") gridalan.addWidget(uygulamaadi_label, 5, 0) uygulamaadi_text = QtWidgets.QLineEdit() uygulamaadi_text.setPlaceholderText("Yeni uygulama adını yazınız") gridalan.addWidget(uygulamaadi_text, 5, 1) uygulamaadi_text.textChanged.connect(lambda: self.uygulamaadicalisti(uygulamaadi_text.text())) uygulamasifresi_label=QtWidgets.QLabel("<h4>Uygulama Şifresi:</h4>") gridalan.addWidget(uygulamasifresi_label, 6, 0) uygulamasifresi_text=QtWidgets.QLineEdit() uygulamasifresi_text.setPlaceholderText("Yeni uygulama şifresini yazınız") uygulamasifresi_text.setEchoMode(QtWidgets.QLineEdit.Password) gridalan.addWidget(uygulamasifresi_text, 6, 1) uygulamasifresi_text.textChanged.connect(lambda: self.uygulamasifresicalisti(uygulamasifresi_text.text())) bosluk = QtWidgets.QLabel("<h4> </h4>") gridalan.addWidget(bosluk, 8, 1) passkaydetbuton = QtWidgets.QPushButton(Qt.QIcon("images/save_icon.png"), "KAYDET") gridalan.addWidget(passkaydetbuton, 9, 1) passkaydetbuton.clicked.connect(lambda:self.passKaydetFonk(gelen)) anaekranbuton=QtWidgets.QPushButton(Qt.QIcon("images/geri_icon.png"), "GERİ") gridalan.addWidget(anaekranbuton, 10, 1) anaekranbuton.clicked.connect(lambda:self.geriFonk(gelen)) gridalan.setAlignment(QtCore.Qt.AlignCenter) self.setLayout(gridalan)
def arayuzOlustur(self,data): gridalan=QtWidgets.QGridLayout() gridalan.setVerticalSpacing(10) gelen2=self.vericek(data) tablewidget=QtWidgets.QTableWidget(len(gelen2),2) tablewidget.setFont(QtGui.QFont("Times",weight=QtGui.QFont.Bold)) tablewidget.setFixedWidth(380) tablewidget.setColumnWidth(0,180) tablewidget.setColumnWidth(1,180) tablewidget.setHorizontalHeaderItem(0,QtWidgets.QTableWidgetItem("Uygulama Adı")) tablewidget.setHorizontalHeaderItem(1,QtWidgets.QTableWidgetItem("Uygulama Şifresi")) gelen=self.vericek(data) for i in range(len(gelen)): if gelen[i]!="": tablewidget.setItem(i,0,QtWidgets.QTableWidgetItem(gelen[i][0])) tablewidget.setItem(i,1,QtWidgets.QTableWidgetItem(gelen[i][1])) else: break gridalan.addWidget(tablewidget,0,0,alignment=QtCore.Qt.AlignCenter) baslik1=QtWidgets.QLabel("<h2 style= color:#FF5050>Merhaba "+data+"</h2>") gridalan.addWidget(baslik1,1,0,alignment=QtCore.Qt.AlignCenter) geributon=QtWidgets.QPushButton(Qt.QIcon("images/geri_icon.png"),"GERİ") gridalan.addWidget(geributon,2,0,alignment=QtCore.Qt.AlignCenter) geributon.clicked.connect(lambda:self.userViewFonk(data)) baslik2=QtWidgets.QLabel("<h3><p> </p>Rehberinizde bulunan uygulama adı ve şifreleri arayabilirsiniz</h3>") gridalan.addWidget(baslik2,3,0,alignment=QtCore.Qt.AlignCenter) aramatext=QtWidgets.QLineEdit() aramatext.setFixedWidth(200) aramatext.setPlaceholderText("Aramak istediğiniz uygulama adını yazınız") aramatext.textChanged.connect(lambda: self.aramatextgonder(aramatext.text())) gridalan.addWidget(aramatext,5,0,alignment=QtCore.Qt.AlignCenter) sifrearabuton=QtWidgets.QPushButton(Qt.QIcon("images/sifreara_icon.png"), "ARA") sifrearabuton.setFixedWidth(200) sifrearabuton.clicked.connect(lambda: self.sifreAraFonk(data)) gridalan.addWidget(sifrearabuton,6,0,alignment=QtCore.Qt.AlignCenter) gridalan.setAlignment(QtCore.Qt.AlignCenter) self.setLayout(gridalan)
def arayuzOlustur(self): gridalan=QtWidgets.QGridLayout(self) logo=QtWidgets.QLabel() logo.setPixmap(QtGui.QPixmap("images/login_icon.png")) logo.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(logo, 0, 0, 1, 0) #0.0 da başlayıp 1.0 da span yapıyor. baslik1=QtWidgets.QLabel("<h3 style= color:#FF5050>GİRİŞ YAP EKRANI</h3><p></p>") baslik1.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(baslik1, 1, 0, 2, 0) baslik2=QtWidgets.QLabel("<h4>Giriş yapabilmek için lütfen gerekli bilgileri doldurunuz.<p></p></h4>") baslik2.setAlignment(QtCore.Qt.AlignCenter) gridalan.addWidget(baslik2, 2, 0, 3, 0) kullaniciadi_label=QtWidgets.QLabel("<h4>Kullanıcı Adı:</h4>") gridalan.addWidget(kullaniciadi_label, 5, 0) kullaniciadi_text = QtWidgets.QLineEdit() kullaniciadi_text.setPlaceholderText("Kullanıcı adınızı yazınız") gridalan.addWidget(kullaniciadi_text, 5, 1) kullaniciadi_text.textChanged.connect(lambda: self.kullaniciadigonder(kullaniciadi_text.text())) parola_label=QtWidgets.QLabel("<h4>Parola:</h4>") gridalan.addWidget(parola_label, 6, 0) parola_text=QtWidgets.QLineEdit() parola_text.setPlaceholderText("Parolanızı yazınız") parola_text.setEchoMode(QtWidgets.QLineEdit.Password) gridalan.addWidget(parola_text, 6, 1) parola_text.textChanged.connect(lambda: self.parolagonder(parola_text.text())) bosluk =QtWidgets.QLabel("<h4> </h4>") gridalan.addWidget(bosluk, 7, 1) girisyapbuton=QtWidgets.QPushButton(Qt.QIcon("images/login_icon2.png"), "GİRİŞ YAP") gridalan.addWidget(girisyapbuton,8,1) girisyapbuton.clicked.connect(lambda: self.girisyapFonk()) anaekranbuton=QtWidgets.QPushButton(Qt.QIcon("images/home_icon.png"), "ANA EKRAN") gridalan.addWidget(anaekranbuton, 9, 1) anaekranbuton.clicked.connect(lambda:self.anaEkranFonk()) gridalan.setAlignment(QtCore.Qt.AlignCenter) self.setLayout(gridalan)
def __init__(self): try: super(OffTarget, self).__init__() uic.loadUi(GlobalSettings.appdir + 'off_target.ui', self) self.setWindowIcon( Qt.QIcon(GlobalSettings.appdir + "cas9image.ico")) self.setWindowTitle("Off-Target Analysis") self.progressBar.setMinimum(0) self.progressBar.setMaximum(100) self.progressBar.setValue(0) self.Run.clicked.connect(self.run_analysis) # self.tolerancehorizontalSlider.valueChanged.connect(self.tol_change) # self.tolerancehorizontalSlider.setMaximum(100) # self.tolerancehorizontalSlider.setMinimum(0) self.tolerance = 0.0 self.cancelButton.clicked.connect(self.exit) self.fill_data_dropdown() self.perc = False self.bool_temp = False self.running = False self.process = QtCore.QProcess() # make sure to intialize the class variable in init. That way elsewhere and other classes can access it self.output_path = '' groupbox_style = """ QGroupBox:title{subcontrol-origin: margin; left: 10px; padding: 0 5px 0 5px;} QGroupBox#Step1{border: 2px solid rgb(111,181,110); border-radius: 9px; font: bold 14pt 'Arial'; margin-top: 10px;}""" self.Step1.setStyleSheet(groupbox_style) self.Step2.setStyleSheet(groupbox_style.replace("Step1", "Step2")) self.Step3.setStyleSheet(groupbox_style.replace("Step1", "Step3")) #scale UI self.scaleUI() except Exception as e: logger.critical("Error initializing OffTarget class.") logger.critical(e) logger.critical(traceback.format_exc()) msgBox = QtWidgets.QMessageBox() msgBox.setStyleSheet("font: " + str(self.fontSize) + "pt 'Arial'") msgBox.setIcon(QtWidgets.QMessageBox.Icon.Critical) msgBox.setWindowTitle("Fatal Error") msgBox.setText( "Fatal Error:\n" + str(e) + "\n\nFor more information on this error, look at CASPER.log in the application folder." ) msgBox.addButton(QtWidgets.QMessageBox.StandardButton.Close) msgBox.exec() exit(-1)
def __init__(self, *args): super().__init__(*args) self.setupUi(self) self.prj_create.clicked.connect(self.create_project) self.prj_browse.clicked.connect(self.select_dir) self._project = None # Populate the type selection list dgs_airborne = Qt.QListWidgetItem( Qt.QIcon(':images/assets/flight_icon.png'), 'DGS Airborne', self.prj_type_list) dgs_airborne.setData(QtCore.Qt.UserRole, 'dgs_airborne') self.prj_type_list.setCurrentItem(dgs_airborne) dgs_marine = Qt.QListWidgetItem( Qt.QIcon(':images/assets/boat_icon.png'), 'DGS Marine', self.prj_type_list) dgs_marine.setData(QtCore.Qt.UserRole, 'dgs_marine')
def notificar(self, app): systemtray_icon = Qt.QSystemTrayIcon(Qt.QIcon('/path/to/image'), app) systemtray_icon.show() if citas == 1: systemtray_icon.showMessage( 'Citas de hoy', 'Tiene ' + str(citas) + ' cita con un paciente para hoy') else: systemtray_icon.showMessage( 'Citas de hoy', 'Tiene ' + str(citas) + ' citas para el día de hoy')
def alert_high_diff(): # df = ts.get_realtime_quotes('600196') df = ts.get_realtime_quotes(['600196', '600519', '300482']) print((df[['code', 'name', 'price', 'b1_v', 'b1_p', 'a1_v', 'a1_p']])) for index, row in df.iterrows(): # 差价超过0.1%就预警 if ((float(row['a1_p'])-float(row['b1_p']))/float(row['price'])) >= 0.001: print((row["name"], row["b1_p"])) app = Qt.QApplication(sys.argv) systemtray_icon = Qt.QSystemTrayIcon(Qt.QIcon('/path/to/image')) systemtray_icon.show() systemtray_icon.showMessage('Title', row["name"])
def __init__(self, app, exam_data, cnt_questions): super().__init__() info_str = ('Продолжительность - ' + str(exam_data['duration']) + ' минут\n' + 'Количество заданий - ' + str(cnt_questions)) back_button = Qt.QPushButton(Qt.QIcon(common.LEFT), '', self) back_button.setObjectName('Flat') back_button.setCursor(Qt.Qt.PointingHandCursor) back_button.setIconSize(Qt.QSize(35, 35)) back_button.setFixedSize(Qt.QSize(55, 55)) back_button.clicked.connect(lambda _: app.display_home_page()) exam_title = Qt.QLabel(exam_data['name'], self) exam_title.setFont(Qt.QFont('Arial', 30)) exam_title.setAlignment(Qt.Qt.AlignCenter) exam_title.setWordWrap(True) info_title = Qt.QLabel('Информация', self) info_title.setFont(Qt.QFont('Arial', 25)) info_label = Qt.QLabel(info_str, self) info_label.setFont(Qt.QFont('Arial', 20)) info_label.setWordWrap(True) start_button = Qt.QPushButton('Начать экзамен', self) start_button.setObjectName('Button') start_button.setFont(Qt.QFont('Arial', 20)) start_button.clicked.connect( lambda: app.start_exam(exam_data['rowid'])) upper_layout = Qt.QHBoxLayout() upper_layout.addWidget(back_button) upper_layout.addWidget(exam_title) info_layout = Qt.QHBoxLayout() info_layout.addSpacerItem(Qt.QSpacerItem(20, 0)) info_layout.addWidget(info_label) button_layout = Qt.QHBoxLayout() button_layout.addWidget(start_button) button_layout.addStretch(1) layout = Qt.QVBoxLayout() layout.addLayout(upper_layout) layout.addSpacerItem(Qt.QSpacerItem(0, 40)) layout.addWidget(info_title) layout.addSpacerItem(Qt.QSpacerItem(0, 20)) layout.addLayout(info_layout) layout.addSpacerItem(Qt.QSpacerItem(0, 30)) layout.addLayout(button_layout) layout.addStretch(1) self.setLayout(layout)
def __init__(self, item, mode=ZlmLayerMode.off): Qt.QWidget.__init__(self) self.item = item layout = Qt.QHBoxLayout() self.pb_on = Qt.QPushButton(Qt.QIcon(":/eye.png"), "") self.pb_on.setCheckable(True) self.pb_on.setMaximumSize(QtCore.QSize(32, 32)) self.pb_rect = Qt.QPushButton(Qt.QIcon(":/record.png"), "") self.pb_rect.setCheckable(True) self.pb_rect.setMaximumSize(QtCore.QSize(32, 32)) layout.addWidget(self.pb_on) layout.addWidget(self.pb_rect) self.setLayout(layout) self.setMode(mode) self.pb_on.toggled.connect(self.pb_on_toggled) self.pb_rect.toggled.connect(self.pb_rect_toggled)
def __init__(self, app, exam_id): super().__init__() self.app = app self.exam_id = exam_id self.question_id = None self.question_number = None self.question_result = None self.exam_data = None self.question_data = None self.questions_ids = [] self.questions_results = [] back_button = Qt.QPushButton(Qt.QIcon(common.LEFT), '', self) back_button.setObjectName('Flat') back_button.setCursor(Qt.Qt.PointingHandCursor) back_button.setIconSize(Qt.QSize(35, 35)) back_button.setFixedSize(Qt.QSize(55, 55)) back_button.clicked.connect(lambda _: app.display_home_page()) scroll_area = Qt.QScrollArea() scroll_area.setWidgetResizable(True) scroll_area.setFrameShape(Qt.QFrame.NoFrame) scroll_area.setSizePolicy(Qt.QSizePolicy.Minimum, Qt.QSizePolicy.Minimum) self.questions_layout = Qt.QHBoxLayout() self.questions_layout.setSpacing(0) self.widget = Qt.QWidget(self) scroll_layout = Qt.QHBoxLayout() scroll_layout.setSpacing(0) scroll_layout.setContentsMargins(0, 0, 0, 0) scroll_layout.setSizeConstraint(Qt.QLayout.SetMinimumSize) scroll_layout.addStretch(1) scroll_layout.addLayout(self.questions_layout) scroll_layout.addStretch(1) scroll_widget = Qt.QWidget(self) scroll_widget.setLayout(scroll_layout) scroll_area.setWidget(scroll_widget) upper_layout = Qt.QHBoxLayout() upper_layout.addWidget(back_button) upper_layout.addSpacerItem(Qt.QSpacerItem(10, 0)) upper_layout.addWidget(scroll_area) layout = Qt.QVBoxLayout() layout.addLayout(upper_layout) layout.addSpacerItem(Qt.QSpacerItem(0, 10)) layout.addWidget(Qt.QWidget()) layout.addWidget(self.widget) self.setLayout(layout)