def about(self): QMessageBox.about( self, "About Dock Widgets", "The <b>Dock Widgets</b> example demonstrates how to use " "Qt's dock widgets. You can enter your own text, click a " "customer to add a customer name and address, and click " "standard paragraphs to add them.")
def help_about(self): year = datetime.date.today().year year = "2020-{}".format(str(year)[-2:]) if year != 2020 else "2020" TEMPLATE = ('Python {}.{}.{} <br> {} <br> {}' '<br>APSW {} <br> SQLite {}<br>{}<br>{}') BINDING = f'PySide2 {PySide2.__version__}' QT = f'Qt {PySide2.QtCore.qVersion()}' info = TEMPLATE.format(sys.version_info.major, sys.version_info.minor, sys.version_info.micro, BINDING, QT, apsw.apswversion(), apsw.sqlitelibversion(), QSysInfo.prettyProductName(), platform.platform()) QMessageBox.about(self, f'About — {APPNAME}', f'''<p> <font color=navy><b>{APPNAME} {VERSION}</b></font></p> <p> <font color=navy>{APPNAME} is an easy to learn and use GUI application for viewing, creating, editing, and updating SQLite and {APPNAME} databases. </font> </p> <p><a href="https://github.com/mark-summerfield/songbird">Source Code</a> </p> <p>Copyright © {year} Mark Summerfield.<br> All Rights Reserved.</p> <p> This software is Free Open Source Software (FOSS) licensed under the GNU Public License version 3 (GPLv3). </p> <hr> <p><font color=teal>{info}</font></p> '''.format(year=year, info=info)) # noqa
def aboutDialog(self): """ Exibir informações sobre o programa """ QMessageBox.about( self, "Sobre Notepad", "Bloco de notas adaptado do Guia prático para iniciantes no PyQt")
def File_path(self): self.dialog = QFileDialog(self) self.path = self.dialog.getExistingDirectory() with open("config.txt", "a", encoding="utf-8") as file: file.write("Path " + str(self.path)) QMessageBox.about(self, 'Успешно', 'Папка для сохранения альбомов изменена')
def handleCalc(self): info = self.textEdit.toPlainText() salary_above_20k = '' salary_below_20k = '' for line in info.splitlines(): if not line.strip(): continue pass parts = line.split(' ') print(type(parts)) parts = [p for p in parts if p] name, salary, age = parts if int(salary) >= 20000: salary_above_20k += name + '\n' pass else: salary_below_20k += name + '\n' pass pass QMessageBox.about( self.window, '统计结果', f'''薪资20000 以上的有:\n{salary_above_20k} \n薪资20000 以下的有:\n{salary_below_20k}''') pass
def __init__(self, instance, addr=None): super(ShowStrategy, self).__init__() # initialization self.instance = instance self.workspace = instance.workspace self.symexec_view = self.workspace.view_manager.first_view_in_category( "symexec") self.simgr = self.symexec_view.current_simgr if self.simgr.am_none(): QMessageBox.about(self, 'Error', f"No simulation manager selected.") return self.strategies = self.simgr.strategies self.state = None # output self._addr = addr self._selected = None self._ok_button = None self.setWindowTitle('Change function exploration strategy') self.main_layout = QVBoxLayout() self._init_widgets() self.setLayout(self.main_layout)
def _menu_dispatch(self, action: QAction): if action.text() == "Exit": self.close() elif action.text() == "&Save": self._content.binder.save() elif action.text() == "New Notebook": name, ok = QInputDialog.getText( self, "New Notebook", "New Notebook Name:", QLineEdit.Normal, "" ) if ok: success = self._content.binder.new_notebook(name) if not success: QMessageBox(self).warning( self, "Notebook Name Already Exists", "Another notebook with the name {} already exists in your workspace.".format(name) ) elif action.text() == "About": QMessageBox.about(self, "FreeNote", "Free Note is note taking software, developed by Zach Bullough. " "For more information, please visit github.com/qmuloadmin/freenote") elif action.text() == "S&ettings": SettingsDialog(self).show()
def handleUrl(self): url = self.ui.urlEdit.text().strip() try: if self.check(url): reqInfos = '' reqInfos += 'GET ' reqInfos += url reqInfos += '\n' reqInfos += str(time.localtime(time.time())) reqInfos += '\n' reqInfos += 'Content-Length:0\n' self.ui.reqTextEdit.setText(reqInfos) resp = requests.get(url) # pprint.pprint(dict(resp.headers)) respHeader = dict(resp.headers) respInfos = '' for item in respHeader: # print(item, respHeader[item]) info = '{}:{}'.format(item, respHeader[item]) print(info) respInfos += info respInfos += '\n' pass self.ui.respTextEdit.setText(respInfos) print(respInfos) pass else: raise UrlExcrption() pass except UrlExcrption as res: QMessageBox.about(res) pass
def show_about(self): message = '<h2>{} {}</h2>'.format(QApplication.applicationName(), QApplication.applicationVersion()) message += '<h3>A digital image forensic toolkit</h3>' message += '<p>author: <a href="{}">{}</a></p>'.format( QApplication.organizationDomain(), QApplication.organizationName()) message += '<p>source: <a href="https://github.com/GuidoBartoli/sherloq">GitHub repository</a></p>' QMessageBox.about(self, self.tr('About'), message)
def onShowMACAdress(self): state, rawdata = self.clientProgram.MakeRequest("INFO MACADDRESS") macAdd = rawdata.decode("utf-8") if state == ClientState.SUCCEEDED: QMessageBox.about(self, "", "MAC Address: " + macAdd) else: QMessageBox.about(self, "", "Thao tác thất bại")
def onShutdown(self): state, _ = self.clientProgram.MakeRequest("SHUTDOWN S") if state == ClientState.SUCCEEDED: QMessageBox.about(self, "", "Sau 3s máy tính sẽ tắt") self.clientProgram.Disconnect() else: QMessageBox.about(self, "", "Thao tác thất bại")
def savefilebutton(self): filepath = QFileDialog.getSaveFileName( self.ui, "请选择需要打开的文件", r'c:/', '文件 (*.xls);;文件 (*.csv);;文件 (*.txt)') if filepath[0]: self.file.to_excel(filepath[0], header=None, index=False) QMessageBox.about(self.ui, '文件保存成功', '请进行下一步操作')
def about(self): QMessageBox.about( self, "About Shape", "<h2>Brint Monitor 1.0</h2>" "<p>Copyright © 2020 Panaxtos Inc." "<p>Shape is a small application that " "demonstrates QAction, QMainWindow, QMenuBar, " "QStatusBar, QToolBar, and many other ")
def _show_about(self): QMessageBox.about( self, 'About', '<p><b>PowerTamil Dictionary V1.0</b></p>' '<p>Copyright © 2020 Rajkumar Palani</p>' '<p>Power Tamil dictionary is free to use and distribute. </p>' '<p><a href="http://www.rajkumarpalani.com/software">www.rajkumarpalani.com/software</a></p>' )
def show_current_page(self): try: global g_current_data self.current_page_inticator() self.last_page_indicator() if len(g_current_data) != 0: for row_number, row_value in enumerate(g_current_data): for item_number, item_value in enumerate(row_value): self.table_csv.setItem( row_number, item_number, QTableWidgetItem( list(row_value.values())[item_number]) ) roww = list(row_value.values()) if roww[4].isspace() or roww[4] == "" or \ roww[12] != str(0): self.paint(row_number, item_number) self.table_csv.setHorizontalHeaderLabels(backend.headers) self.table_csv.horizontalHeaderItem( item_number).setTextAlignment(QtCore.Qt.AlignHCenter) self.table_csv.resizeColumnsToContents() else: QMessageBox.about( self, "Предупреждение", "Файл пуст") except Lil_error as e: QMessageBox.about( self, "Предупреждение", str(e))
def start(self): if self.ui.text_selectPic.text(): filename = self.ui.text_selectPic.text() print(filename) disable_smoothing = False no_resize = False width = int(self.ui.text_width.text()) height = None invert = self.ui.button_invert.isChecked() if no_resize: resize_size = size_max elif width and not height: resize_size = size_from_width_ratio(width) elif height and not width: resize_size = size_from_height_ratio(height) else: resize_size = size_from_width_ratio(30) # !!!设置宽度, print(self.ui.spin_bsize.value()) result = img2braille(filename=filename, bsize=int(self.ui.spin_bsize.value()), resize_size=resize_size, smoothing=not disable_smoothing, invert=invert) try: res = "" for c in result: res += c self.ui.text_ouput.setPlainText(res) except BrokenPipeError: pass else: # 输出文本框 QMessageBox.about(self.ui, 'error', 'select image first!')
def about(self): """Called by the about action. """ from PySide2 import __version__ as pyside2_version QMessageBox.about( self, "About IDF+", """<b>IDF+</b> v{0} <p>This is an enhanced editor for EnergyPlus simulation input files. For more information please see <a href="https://github.com/mattdoiron/idfplus/"> https://github.com/mattdoiron/idfplus/ </a></p> <p>Copyright © 2014-2017 Matt Doiron ([email protected]). All rights reserved.</p> <p>IDF+ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p> <p>IDF+ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a> for more details.</p> <p>Built with: Python {1}, Qt {2} and PySide {3} on {4}</p>""". format(__version__, platform.python_version(), qVersion(), pyside2_version, platform.system()))
def _read_input(self, working_length): num_of_rows = self.input_table.rowCount() items_length = list() items_qty = list() for i in range(num_of_rows): if ( self.input_table.item(i, 0) is None or self.input_table.item(i, 1) is None or not self._validation(self.input_table.item(i, 0).text()) > 0 or not self._validation(self.input_table.item(i, 1).text()) > 0 ): continue else: if self._validation(self.input_table.item(i, 0).text()) <= ( working_length ): items_length.append( self._validation(self.input_table.item(i, 0).text()) ) items_qty.append( self._validation(self.input_table.item(i, 1).text()) ) else: QMessageBox.about( self, 'too long', f'{self.input_table.item(i, 0).text()}' ' will not be used in the calculation.\n', ) return (items_length, items_qty)
def paint(self, row, col): try: self.table_csv.item(row, col).setBackground( QtGui.QColor(106, 188, 183)) except Lil_error as e: QMessageBox.about( self, "Предупреждение", str(e))
def hikdef(self): chue_nod_kho_nok = None chue_nod_poly = self.cbb_poly.currentText() if (mc.objExists(chue_nod_poly)): if (mc.objExists(chue_nod_poly + '_sentaa')): chue_nod_kho_nok = chue_nod_poly + '_sentaa' elif (mc.objExists(chue_nod_poly + '_subetenooya')): chue_nod_kho_nok = chue_nod_poly + '_subetenooya' if (not chue_nod_kho_nok): QMessageBox.about(self, '何か間違いかも', '該当のジョイントが見つかりません') return self.wdg.setFixedSize(600, 2000) self.btn_hikdef.setEnabled(False) self.cbb_poly.setEnabled(False) dic_chue = {} if (chue_nod_kho_nok[0] != '|'): chue_nod_kho_nok = '|' + chue_nod_kho_nok set_hik = set(mc.ls(type='HIKCharacterNode')) mel.eval('hikCreateDefinition') chue_nod_hik = (set(mc.ls(type='HIKCharacterNode')) - set_hik).pop() chue_nod_hik = mc.rename(chue_nod_hik, 'HIK_' + chue_nod_poly) lis_chue_nod_kho = [chue_nod_kho_nok] + mc.listRelatives( chue_nod_kho_nok, allDescendents=True, fullPath=True) for lek in dic_hik: hbl = QHBoxLayout() self.vbl.addLayout(hbl) lb = QLabel(dic_hik[lek][0]) hbl.addWidget(lb) lb.setFixedWidth(80) for chue_nod_kho in lis_chue_nod_kho: khonha = re.findall(r'\|%s$' % dic_hik[lek][1], chue_nod_kho) if (khonha): dic_chue[lek] = chue_nod_kho mel.eval('hikSetCharacterObject %s %s %d 0' % (chue_nod_kho, chue_nod_hik, lek)) btn = QPushButton('選択') hbl.addWidget(btn) btn.setFixedSize(50, 30) le = QLineEdit(chue_nod_kho) hbl.addWidget(le) btn.clicked.connect((lambda x: (lambda: mc.select(x.text())))(le)) le.setFixedWidth(400) le.setStyleSheet('font-size: 12px; color: #ffe;') break else: lb = QLabel('見つかりません') hbl.addWidget(lb) lb.setFixedWidth(400) lb.setStyleSheet('color: #fab;') hbl.addStretch() kangkhaen(dic_chue) self.vbl.addStretch() self.btn_sang_hik.setEnabled(True)
def changeInput(self, action, force = False, changeCurrent = False): #Get currency selected currency1 = self.currentCurrency['select'].currentText() currency2 = self.targetCurrency['select'].currentText() #Get amount selected amount1 = self.currentCurrency['input'].text() amount2 = self.targetCurrency['input'].text() if amount1 == "": self.targetCurrency['input'].setText(str('')) if action == 'targetUpdated' and (force or parseFloat(amount1, -1) != parseFloat(1) and amount1 != ""): #Display pop-up error if (parseFloat(amount1, -1) < 0) and changeCurrent != True: QMessageBox.about(self, "Title", "Enter a valid value please") self.targetCurrency['input'].setText(str('')) self.currentCurrency['input'].setText(str('')) return nextValue = parseFloat(self.c.convert(parseFloat(amount1, -1), currency1, currency2)) self.currentCurrency['amount'] = parseFloat(amount1, -1) self.targetCurrency['amount'] = nextValue self.targetCurrency['input'].setText(str(nextValue)) if action == 'currentUpdated' and (force or parseFloat(amount2, -1) != parseFloat(self.targetCurrency['amount'])): if parseFloat(amount2, -1) < 0: self.currentCurrency['input'].setText(str('')) return nextValue = parseFloat(self.c.convert(parseFloat(amount2, -1), currency2, currency1)) self.targetCurrency['amount'] = parseFloat(amount2, -1) self.currentCurrency['amount'] = nextValue self.currentCurrency['input'].setText(str(nextValue))
def connect_db(self): """ MySQL数据库连接 """ try: file = open('my.ini', 'r') L = [] while True: d = file.readline() if not d: file.close() # 关闭文件 break cc = d.split('=')[1].strip() L.append(cc) # # 建立数据库连接 db = pymysql.connect( host=L[0], # 'localhost', # "192.168.202.1""127.0.0.1" port=int(L[1]), # 3306 user=L[2], # 'root' password=L[3], # '080420' db=L[4], # 'mysql' charset=str(L[5])) # 字体设置"utf8" return db except IOError: QMessageBox.about(self, '提示信息', '服务器链接失败')
def save_Data(self): self.locker() header = [ 'begin', 'end', 'time interval', 'login', 'mac ab', 'ULSK1', 'BRAS ip', 'start count', 'alive count', 'stop count', 'incoming', 'outcoming', 'error_count', 'code 0', 'code 1011', 'code 1100', 'code -3', 'code -52', 'code -42', 'code -21', 'code -40', ' code -44', 'code -46', ' code -38' ] rowCount = self.ui.tableWidget.rowCount() columCount = 24 d = QFileDialog.getSaveFileName(self, "Сохранение", "/analized_table", "Файл Microsoft Excel (*.csv)") if d[0] == '': QMessageBox.about(self, 'Ошибка', 'Вы отменили сохранение') self.unlocker() return 1 value = 0 step = 100 / rowCount with open(d[0], 'w', newline='') as file_csv: writher = csv.writer(file_csv) writher.writerow(header) for i in range(rowCount): save = [] value += step self.callback_obj.progressBarUpdated.emit(value) for j in range(columCount): p = self.ui.tableWidget.item(i, j).text() save.append(p) writher.writerow(save) self.callback_obj.progressBarUpdated.emit(0) self.unlocker()
def denglu_clicked(self): zhanghao = self.ui.zhanghao.text() mima = self.ui.mima.text() db = self.connect_db() # 获取游标 cur = db.cursor(pymysql.cursors.DictCursor) # 使用字典类型输出 sql_renyuan = "select * FROM 人员信息 WHERE 工号 = %s" rows = cur.execute(sql_renyuan, zhanghao) # 条数 results = cur.fetchall() # 查询到的字典组数 jieguo = results[rows - 1] # 提取最后一个字典 mm = jieguo['密码'] # 获取字典里的‘密码’对应值 if mm == mima: QMessageBox.about(self, '提示信息', '登录成功') cur.close() # 关闭游标 db.close() # 关闭连接 self.main_window = zhujiemian() file = open('../my.ini', 'a') file.write('工号 = ' + self.ui.zhanghao.text()) file.write('\n') file.close() self.close() self.main_window.show() else: QMessageBox.about(self, '提示信息', '用户名或密码错误') return
def save_Data(self): if self.chek: self.locker() header = ['№', 'name', 'fname', 'phone', 'uid', 'nik', 'wo'] rowCount = self.ui.tableWidget.rowCount() columCount = 7 d = QFileDialog.getSaveFileName(self, "Сохранение", "/analized_table", "Файл Microsoft Excel (*.csv)") if d[0] == '': QMessageBox.about(self, 'Ошибка', 'Вы отменили сохранение') self.unlocker() return 1 value = 0 step = 100 / rowCount with open(d[0], 'w', newline='') as file_csv: writher = csv.writer(file_csv, delimiter='|') writher.writerow(header) for i in range(rowCount): save = [] value += step self.callback_obj.progressBarUpdated.emit(value) for j in range(columCount): p = self.ui.tableWidget.item(i, j).text() save.append(p) writher.writerow(save) self.callback_obj.progressBarUpdated.emit(0) self.unlocker() else: QMessageBox.about(self, 'Ошибка', 'Проанализируйте файл.')
def get_folder_name(self): try: return QFileDialog.getExistingDirectory( self, "Файловый менеджер") except Lil_error as e: QMessageBox.about( self, "Предупреждение", str(e))
def pushButton_Click(self): self.reflash_filename() if (self.checkBox_1.isChecked() or self.checkBox_3.isChecked() or self.checkBox_5.isChecked() or self.checkBox_7.isChecked() or self.checkBox_9.isChecked() or self.checkBox_51.isChecked()) == 0: QMessageBox.about(self, "Warning", "please checked Eload channel in the GUI") else: loadlist = gpib.ComboEload() Iout_max = int(self.lineEdit_2.text()) Iout_step = int(self.lineEdit_3.text()) Delay = int(self.lineEdit_4.text()) gpibaddr1 = int(self.comboBox.currentText()) gpibaddr2 = int(self.comboBox_2.currentText()) if self.checkBox_1.isChecked(): load1 = gpib.ChromaEload(gpibaddr1, 1, int(self.lineEdit_L1.text()), 0) loadlist.addEload(load1) if self.checkBox_3.isChecked(): load3 = gpib.ChromaEload(gpibaddr1, 3, int(self.lineEdit_L3.text()), 0) loadlist.addEload(load3) if self.checkBox_5.isChecked(): load5 = gpib.ChromaEload(gpibaddr1, 5, int(self.lineEdit_L5.text()), 0) loadlist.addEload(load5) if self.checkBox_7.isChecked(): load7 = gpib.ChromaEload(gpibaddr1, 7, int(self.lineEdit_L7.text()), 0) loadlist.addEload(load7) if self.checkBox_9.isChecked(): load9 = gpib.ChromaEload(gpibaddr1, 9, int(self.lineEdit_L9.text()), 0) loadlist.addEload(load9) if self.checkBox_51.isChecked(): load51 = gpib.ChromaEload(gpibaddr2, 1, int(self.lineEdit_L51.text()), 0) loadlist.addEload(load51) #df=measure.measureEfficiency(loadlist,Iout_max,Iout_step,Delay) if self.checkBox.isChecked(): df = measure.measureEfficiency(loadlist, Iout_max, Iout_step, Delay, 1) else: df = measure.measureEfficiency(loadlist, Iout_max, Iout_step, Delay, 0) #self.textBrowser.setText("Efficiency finish") self.showdf(df) self.df = df self.pushButton_2.setEnabled(True) self.df.to_csv(self.lineEdit.text())
def __call__(self, *args, **kwargs): self._func(*args, **kwargs) if self._func.hasResult: # try except? outputMessage = self._func.result.get('outputMessage') if outputMessage is not None: QMessageBox.about(None, self._title, outputMessage) return self._func.result
def about(self): QMessageBox.about( self, self.t('About Face Masker'), self. t("""This program will help you mask out faces in a video to make it anonymous for future use. This is done by extracting every frame from a video, finding faces in the current frame and mask them out using various methods like pixelating the area, filling it with random noise (recomended) or just simply painting a block box over the face. You can also skip over step one of inputting a video, and provide alreadt extracted frames or independant images you want to mask faces on""" ))
def about(self): QMessageBox.about( self, "WD Wrapper", f"WD Wrapper {__version__} <br/>" "Authors: <ul> " "<li>Mikołaj Kałuszyński</li>" "</ul>" "Created by <a href='https://akond.com'>Akond Lab</a> for The Araucaria Project" )
def onAbout(self): q = QWidget() icon = QtGui.QIcon(":/icon.ico") q.setWindowIcon(icon) QMessageBox.about(q, "About MyTerm", appInfo.aboutme)
def about(self): QMessageBox.about(self, "About MDI", "The <b>MDI</b> example demonstrates how to write multiple " "document interface applications using Qt.")