self.blog_categories_space.setObjectName("blog_categories_space") self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.blog_categories_space) self.retranslateUi(Create_Dialog) self.buttonBox.accepted.connect(Create_Dialog.accept) self.buttonBox.rejected.connect(Create_Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Create_Dialog) def retranslateUi(self, Create_Dialog): _translate = QtCore.QCoreApplication.translate Create_Dialog.setWindowTitle(_translate("Create_Dialog", "博文创建向导")) self.blog_file_name.setText(_translate("Create_Dialog", "文章文件名")) self.blog_file_name_space.setPlaceholderText(_translate("Create_Dialog", "此处输入什么都只会记录为一个值")) self.blog_title.setText(_translate("Create_Dialog", "文章标题")) self.blog_title_space.setPlaceholderText(_translate("Create_Dialog", "此处输入什么都只会记录为一个值")) self.blog_categories.setText(_translate("Create_Dialog", "文章分类")) self.blog_tags.setText(_translate("Create_Dialog", "博客标签")) self.blog_tags_space.setPlaceholderText(_translate("Create_Dialog", "此处输入什么都只会记录为一个值")) self.blog_categories_space.setPlaceholderText(_translate("Create_Dialog", "此处输入什么都只会记录为一个值")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Create_Dialog = QtWidgets.QDialog() ui = Ui_Create_Dialog() ui.setupUi(Create_Dialog) Create_Dialog.show() sys.exit(app.exec_())
class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(1004, 650) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.buttonBox.setGeometry(QtCore.QRect(230, 40, 101, 91)) self.buttonBox.setOrientation(QtCore.Qt.Vertical) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate Dialog.setWindowTitle(_translate("Dialog", "Dialog")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Dialog = QtWidgets.QDialog() ui = Ui_Dialog() ui.setupUi(Dialog) Dialog.show() sys.exit(app.exec_())
self.lineEdit.setMaxLength(20) self.lineEdit.setEchoMode(QtWidgets.QLineEdit.Password) self.lineEdit.setObjectName("lineEdit") self.horizontalLayout.addWidget(self.lineEdit) self.label_3 = QtWidgets.QLabel(Dialog) self.label_3.setGeometry(QtCore.QRect(190, 40, 121, 16)) self.label_3.setObjectName("label_3") self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate Dialog.setWindowTitle(_translate("Dialog", "Admin Access")) self.label_2.setText(_translate("Dialog", "Password:"******"Dialog", "Max Length: 20 char")) import resources_rc if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) PasswordDialog = QtWidgets.QDialog() ui = Ui_Dialog() ui.setupUi(PasswordDialog) PasswordDialog.show() sys.exit(app.exec_())
def import_hdf5(hdf5path, format): source = h5py.File(hdf5path, 'r') phases = [s for s in source.file.keys() if s.startswith('phase')] if not (bool(phases)): print('No phases in HDF5 file. Abort import.') return group = source[phases[0]] avail_datasets = [ f'{grp_name}/{dset_name}' for grp_name, grp in group.items() for dset_name, dset in grp.items() ] # Let user select dataset names for frame time and data dialog = QtWidgets.QDialog(gv.w) dialog.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) dialog.setLayout(QtWidgets.QGridLayout()) dialog.lbl_set = QLabel('Select datasets') dialog.lbl_set.setStyleSheet('font-weight:bold; text-alignment:center;') dialog.layout().addWidget(dialog.lbl_set, 0, 0, 1, 2) # Frame dataset name dialog.layout().addWidget(QLabel('Frames'), 1, 0) dialog.cb_frame_name = QtWidgets.QComboBox() dialog.cb_frame_name.addItems(avail_datasets) dialog.layout().addWidget(dialog.cb_frame_name, 1, 1) # Frame time name dialog.layout().addWidget(QLabel('Times'), 2, 0) dialog.cb_time_name = QtWidgets.QComboBox() dialog.cb_time_name.addItems(avail_datasets) dialog.layout().addWidget(dialog.cb_time_name, 2, 1) dialog.btn_submit = QtWidgets.QPushButton('Confirm') dialog.btn_submit.clicked.connect(dialog.accept) dialog.layout().addWidget(dialog.btn_submit, 3, 0, 1, 2) if not (dialog.exec_() == QtWidgets.QDialog.Accepted): raise Exception('Need to set frame dataset and time dataset names') frame_name = dialog.cb_frame_name.currentText() time_name = dialog.cb_time_name.currentText() if frame_name == time_name: print('ERROR: Frame time and frame data cannot be the same') return # Rotate/mirror dialog = QtWidgets.QDialog(gv.w) dialog.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) dialog.setLayout(QtWidgets.QGridLayout()) # Switch file references for viewer to work _h5f = gv.h5f gv.h5f = group # Set image view from gui import HDF5ImageView dialog.imview = HDF5ImageView(original_name=frame_name) # Set rotation/flip dialog.cb_rotation = QtWidgets.QComboBox() dialog.cb_rotation.addItems(['None', '90CCW', '180', '270CCW']) dialog.cb_rotation.currentIndexChanged.connect( lambda i: dialog.imview.set_rotation(i)) dialog.cb_rotation.currentIndexChanged.connect(dialog.imview.update_image) dialog.layout().addWidget(dialog.cb_rotation, 0, 0) dialog.check_flip_ud = QtWidgets.QCheckBox('Flip vertical') dialog.check_flip_ud.stateChanged.connect( lambda: dialog.imview.set_flip_ud(dialog.check_flip_ud.isChecked())) dialog.check_flip_ud.stateChanged.connect(dialog.imview.update_image) dialog.layout().addWidget(dialog.check_flip_ud, 0, 1) dialog.check_flip_lr = QtWidgets.QCheckBox('Flip horizontal') dialog.check_flip_lr.stateChanged.connect( lambda: dialog.imview.set_flip_lr(dialog.check_flip_lr.isChecked())) dialog.check_flip_lr.stateChanged.connect(dialog.imview.update_image) dialog.layout().addWidget(dialog.check_flip_lr, 0, 2) dialog.imview.setFixedSize(*[max(group[frame_name].shape)] * 2) dialog.layout().addWidget(dialog.imview, 1, 0) dialog.btn_submit = QtWidgets.QPushButton('Confirm') dialog.btn_submit.clicked.connect(dialog.accept) dialog.layout().addWidget(dialog.btn_submit, 2, 0) # Update dialog.imview.update_image() if not (dialog.exec_() == QtWidgets.QDialog.Accepted): raise Exception('Need to confirm rotation/flip') # Switch file reference back gv.h5f = _h5f # Import for j, phase_name in enumerate(phases): # Get time dimension size t_dim = source[phase_name][time_name].shape[0] gv.statusbar.start_progress( f'Import phase {j+1} of {len(phases)} from {hdf5path}', t_dim) # Create group gv.h5f = gv.h5f.file.create_group(phase_name) # Set time gv.h5f.create_dataset(gv.KEY_TIME, data=source[phase_name][time_name]) # Set frames for i, im in enumerate(source[phase_name][frame_name]): dset = gv.h5f.require_dataset(gv.KEY_ORIGINAL, shape=(t_dim, *im.shape), dtype=np.uint8, chunks=(1, *im.shape), compression='gzip', compression_opts=9) dset[i] = dialog.imview._rotate(dialog.imview._flip(im)) gv.statusbar.set_progress(i) gv.statusbar.end_progress() return dict()
item.setText(_translate("Dialog3", "KDV")) item = self.tableWidget_2.horizontalHeaderItem(4) item.setText(_translate("Dialog3", "Miktar")) item = self.tableWidget_2.horizontalHeaderItem(5) item.setText(_translate("Dialog3", "Birim Fiyat")) item = self.tableWidget_2.horizontalHeaderItem(6) item.setText(_translate("Dialog3", "Toplam")) self.pushButton.setText(_translate("Dialog3", "Kaydet")) self.pushButton_2.setText(_translate("Dialog3", "İptal")) self.label_4.setText(_translate("Dialog3", "Ara")) self.label_6.setText(_translate("Dialog3", "TextLabel")) self.pushButton_3.setText(_translate("Dialog3", "Satır Sil")) self.pushButton_4.setText(_translate("Dialog3", "Fiş Sil")) self.label_7.setText(_translate("Dialog3", "Vade")) self.label_8.setText(_translate("Dialog3", "Gün")) self.pushButton_5.setText(_translate("Dialog3", "Fiş Getir")) self.comboBox.setItemText(0, _translate("Dialog3", "ÖDEME YAP")) self.comboBox.setItemText(1, _translate("Dialog3", "Nakit Ödeme")) self.comboBox.setItemText(2, _translate("Dialog3", "Denizbank ")) self.comboBox.setItemText(3, _translate("Dialog3", "Yapı Kredi")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Dialog3 = QtWidgets.QDialog() ui = Ui_Dialog3() ui.setupUi(Dialog3) Dialog3.show() sys.exit(app.exec_())
def gui_sablonsil(self): Sas = QtWidgets.QDialog() ui = Ui_SablonDuzenle() ui.setupUi(Sas) Sas.show() Sas.exec_()
mass = self.mr.updatemass() elif sat_select == 'mars': xc = self.mm.state[mmc.st.XMA] yc = self.mm.state[mmc.st.YMA] vxc = self.mm.state[mmc.st.VXMA] vyc = self.mm.state[mmc.st.VYMA] mass = self.mm.const[mmc.cnst.MMARS] else: xc = 0.0 yc = 0.0 vxc = 0.0 vyc = 0.0 if sat_select != 'rocket': orbangle = mm.orbitalangle(self.mm.state[mmc.st.X], self.mm.state[mmc.st.Y], self.mm.state[mmc.st.VX], self.mm.state[mmc.st.VY], xc, yc, vxc, vyc) self.txted_sat.setText(sat_select) self.txted_angle.setText(str(format(orbangle, '.3f'))) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) OrbitalAngle = QtWidgets.QDialog() ui = Ui_OrbitalAngle() ui.setupUi(OrbitalAngle) OrbitalAngle.show() sys.exit(app.exec_())
"<html><head/><body><p><span style=\" font-size:11pt;\">The color of the axis the graph is plotted on</span></p></body></html>" )) self.axisColorLabel.setText( _translate("displaySettingsWindow", "Axis Color")) self.axisColorButton.setToolTip( _translate( "displaySettingsWindow", "<html><head/><body><p><span style=\" font-size:11pt;\">The color of the axis the graph is plotted on</span></p></body></html>" )) self.renderOffsetLabel.setToolTip( _translate( "displaySettingsWindow", "<html><head/><body><p><span style=\" font-size:11pt;\">Whether or not to show arrows for the eyeblink offsets</span></p></body></html>" )) self.renderOffsetLabel.setText( _translate("displaySettingsWindow", "Render Offset Arrows")) self.onsetArrowLabel.setText( _translate("displaySettingsWindow", "Onset Arrow Color")) self.offsetArrowLabel.setText( _translate("displaySettingsWindow", "Offset Arrow Color")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) displaySettingsWindow = QtWidgets.QDialog() ui = Ui_displaySettingsWindow() ui.setupUi(displaySettingsWindow) displaySettingsWindow.show() sys.exit(app.exec_())
self.buttonBox.setObjectName("buttonBox") self.label = QtWidgets.QLabel(InvalidLoginDialog) self.label.setGeometry(QtCore.QRect(100, 80, 261, 101)) font = QtGui.QFont() font.setPointSize(11) self.label.setFont(font) self.label.setObjectName("label") self.retranslateUi(InvalidLoginDialog) self.buttonBox.accepted.connect(InvalidLoginDialog.accept) self.buttonBox.rejected.connect(InvalidLoginDialog.reject) QtCore.QMetaObject.connectSlotsByName(InvalidLoginDialog) def retranslateUi(self, InvalidLoginDialog): _translate = QtCore.QCoreApplication.translate InvalidLoginDialog.setWindowTitle( _translate("InvalidLoginDialog", "InvalidLoginDialog")) self.label.setText( _translate("InvalidLoginDialog", "Invalid Info Was Entered")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) InvalidLoginDialog = QtWidgets.QDialog() ui = Ui_InvalidLoginDialog() ui.setupUi(InvalidLoginDialog) InvalidLoginDialog.show() sys.exit(app.exec_())
"UIMacDonaldMenuLunchNONPEAK", GetFoodORPrice("PNorthSpineCanteen", "MacDonald", "Lunch", 1))) self.Price3.setText( _translate( "UIMacDonaldMenuLunchNONPEAK", GetFoodORPrice("PNorthSpineCanteen", "MacDonald", "Lunch", 2))) self.Price4.setText( _translate( "UIMacDonaldMenuLunchNONPEAK", GetFoodORPrice("PNorthSpineCanteen", "MacDonald", "Lunch", 3))) self.InputLabel.setText( _translate("UIMacDonaldMenuLunchNONPEAK", "Input Customer in Queue:")) self.OutputLabel.setText( _translate("UIMacDonaldMenuLunchNONPEAK", "Estimated Waiting Time: ")) self.CalculateButton.setText( _translate("UIMacDonaldMenuLunchNONPEAK", "Calculate")) self.BackButton.setText( _translate("UIMacDonaldMenuLunchNONPEAK", "Back")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) UIMacDonaldMenuLunchNONPEAK = QtWidgets.QDialog() ui = Ui_UIMacDonaldMenuLunchNONPEAK() ui.setupUi(UIMacDonaldMenuLunchNONPEAK) UIMacDonaldMenuLunchNONPEAK.show() sys.exit(app.exec_())
self.gridLayoutWidget.setObjectName("gridLayoutWidget") self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") self.label = QtWidgets.QLabel(self.gridLayoutWidget) self.label.setFrameShape(QtWidgets.QFrame.StyledPanel) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.spinBox = QtWidgets.QSpinBox(self.gridLayoutWidget) self.spinBox.setObjectName("spinBox") self.gridLayout.addWidget(self.spinBox, 0, 1, 1, 1) self.retranslateUi(Dialog1) QtCore.QMetaObject.connectSlotsByName(Dialog1) def retranslateUi(self, Dialog1): _translate = QtCore.QCoreApplication.translate Dialog1.setWindowTitle(_translate("Dialog1", "Dialog1")) self.label.setText(_translate("Dialog1", "set lcd Number")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Dialog1 = QtWidgets.QDialog() dialog_ui1 = Ui_Dialog1() dialog_ui1.setupUi(Dialog1) Dialog1.show() sys.exit(app.exec_())
self.error_lbl = QtWidgets.QLabel(payment_dialog) self.error_lbl.setGeometry(QtCore.QRect(20, 112, 165, 16)) self.error_lbl.setText("") self.error_lbl.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.error_lbl.setObjectName("error_lbl") self.retranslateUi(payment_dialog) QtCore.QMetaObject.connectSlotsByName(payment_dialog) def retranslateUi(self, payment_dialog): _translate = QtCore.QCoreApplication.translate payment_dialog.setWindowTitle(_translate("payment_dialog", "Dialog")) self.cash_rb.setText(_translate("payment_dialog", "Cash")) self.credit_rb.setText(_translate("payment_dialog", "Credit Card")) self.check_rb.setText(_translate("payment_dialog", "Check")) self.print_btn.setText(_translate("payment_dialog", "Print Receipt")) self.total_lbl_2.setText(_translate("payment_dialog", "Total")) self.total_lbl.setText(_translate("payment_dialog", "$")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) payment_dialog = QtWidgets.QDialog() ui = Ui_payment_dialog() ui.setupUi(payment_dialog) payment_dialog.show() sys.exit(app.exec_())
self.chooseJobSubmit = QtWidgets.QComboBox(submitJob) self.chooseJobSubmit.setGeometry(QtCore.QRect(10, 10, 291, 22)) self.chooseJobSubmit.setObjectName("chooseJobSubmit") self.submitJobOK = QtWidgets.QPushButton(submitJob) self.submitJobOK.setGeometry(QtCore.QRect(10, 40, 75, 23)) self.submitJobOK.setObjectName("submitJobOK") self.pushButton_2 = QtWidgets.QPushButton(submitJob) self.pushButton_2.setGeometry(QtCore.QRect(100, 40, 75, 23)) self.pushButton_2.setObjectName("pushButton_2") self.retranslateUi(submitJob) self.pushButton_2.clicked.connect(submitJob.reject) QtCore.QMetaObject.connectSlotsByName(submitJob) def retranslateUi(self, submitJob): _translate = QtCore.QCoreApplication.translate submitJob.setWindowTitle(_translate("submitJob", "选择一个配置文件用以提交任务或连接服务器")) self.submitJobOK.setText(_translate("submitJob", "OK")) self.pushButton_2.setText(_translate("submitJob", "Cancle")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) submitJob = QtWidgets.QDialog() ui = Ui_submitJob() ui.setupUi(submitJob) submitJob.show() sys.exit(app.exec_())
def quick_reference(self): help1 = [ ("F1", _("Emergency stop")), ("F2", _("Turn machine on")), ("", ""), ("X", _("Activate first axis")), ("Y", _("Activate second axis")), ("Z", _("Activate third axis")), ("A", _("Activate fourth axis")), ("` or 0,1..8", _("Activate first through ninth joint <br>if joints radiobuttons visible")), ("", _("")), ("`,1..9,0", _("Set Feed Override from 0% to 100%")), ("", _("if axes radiobuttons visible")), (_(", and ."), _("Select jog speed")), (_("< and >"), _("Select angular jog speed")), (_("I, Shift-I"), _("Select jog increment")), ("C", _("Continuous jog")), (_("Home"), _("Send active joint home")), (_("Ctrl-Home"), _("Home all joints")), (_("Shift-Home"), _("Zero G54 offset for active axis")), (_("End"), _("Set G54 offset for active axis")), (_("Ctrl-End"), _("Set tool offset for loaded tool")), ("-, =", _("Jog active axis or joint")), (";, '", _("Select Max velocity")), ("", ""), (_("Left, Right"), _("Jog first axis or joint")), (_("Up, Down"), _("Jog second axis or joint")), (_("Pg Up, Pg Dn"), _("Jog third axis or joint")), (_("Shift+above jogs"), _("Jog at traverse speed")), ("[, ]", _("Jog fourth axis or joint")), ("", ""), ("D", _("Toggle between Drag and Rotate mode")), (_("Left Button"), _("Pan, rotate or select line")), (_("Shift+Left Button"), _("Rotate or pan")), (_("Right Button"), _("Zoom view")), (_("Wheel Button"), _("Rotate view")), (_("Rotate Wheel"), _("Zoom view")), (_("Control+Left Button"), _("Zoom view")), ] help2 = [ ("F3", _("Manual control")), ("F5", _("Code entry (MDI)")), (_("Control-M"), _("Clear MDI history")), (_("Control-H"), _("Copy selected MDI history elements")), ("", _("to clipboard")), (_("Control-Shift-H"), _("Paste clipboard to MDI history")), ("L", _("Override Limits")), ("", ""), ("O", _("Open program")), (_("Control-R"), _("Reload program")), (_("Control-S"), _("Save g-code as")), ("R", _("Run program")), ("T", _("Step program")), ("P", _("Pause program")), ("S", _("Resume program")), ("ESC", _("Stop running program, or")), ("", _("stop loading program preview")), ("", ""), ("F7", _("Toggle mist")), ("F8", _("Toggle flood")), ("B", _("Spindle brake off")), (_("Shift-B"), _("Spindle brake on")), ("F9", _("Turn spindle clockwise")), ("F10", _("Turn spindle counterclockwise")), ("F11", _("Turn spindle more slowly")), ("F12", _("Turn spindle more quickly")), (_("Control-K"), _("Clear live plot")), ("V", _("Cycle among preset views")), ("F4", _("Cycle among preview, DRO, and user tabs")), ("@", _("toggle Actual/Commanded")), ("#", _("toggle Relative/Machine")), (_("Ctrl-Space"), _("Clear notifications")), (_("Alt-F, M, V"), _("Open a Menu")), ] help = zip(help1,help2) msg = QtWidgets.QDialog() msg.setWindowTitle("Quick Reference") button = QtWidgets.QPushButton("Ok") button.clicked.connect(lambda: msg.close()) edit = QtWidgets.QTextEdit() edit.setLineWrapMode(0) mess = '''<TABLE border="1"><COLGROUP> <COL><COL align="char" char="."><THEAD> <TR><TH>Key <TH>Command<TH>Key <TH>Command <TBODY>''' for i,j in help: m='<TR><TD><b>%s</b> <TD>%s<TD><b>%s</b> <TD>%s'%(i[0],i[1],j[0],j[1]) mess += m mess += '</TABLE' edit.setText(mess) edit.setReadOnly(True) layout = QtWidgets.QVBoxLayout() layout.addWidget(edit) layout.addWidget(button) msg.setLayout(layout) msg.setMinimumSize(700,800) msg.show() retval = msg.exec_()
def gui_settings(self): Sett = QtWidgets.QDialog() ui = Ui_Settings() ui.setupUi(Sett) Sett.show() Sett.exec_()
self.close_btn.clicked.connect(ProjTempl.close) QtCore.QMetaObject.connectSlotsByName(ProjTempl) def retranslateUi(self, ProjTempl): _translate = QtCore.QCoreApplication.translate ProjTempl.setWindowTitle(_translate("ProjTempl", "Project from template creator")) self.label_3.setText(_translate("ProjTempl", "Origins: ")) self.url_check.setText(_translate("ProjTempl", "Url")) self.localFiles_check.setText(_translate("ProjTempl", "Loca files")) self.localDir_check.setText(_translate("ProjTempl", "Local dir")) self.label_2.setText(_translate("ProjTempl", "Templates info path: ")) self.templatesInfoPath_btn.setText(_translate("ProjTempl", "...")) self.loadData_btn.setText(_translate("ProjTempl", "Load")) self.label_5.setText(_translate("ProjTempl", "Project: ")) self.label.setText(_translate("ProjTempl", "Templates info location: ")) self.infoLocation_comboBox.setItemText(0, _translate("ProjTempl", "URL")) self.infoLocation_comboBox.setItemText(1, _translate("ProjTempl", "Local")) self.create_btn.setText(_translate("ProjTempl", "Create")) self.close_btn.setText(_translate("ProjTempl", "Close")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) ProjTempl = QtWidgets.QDialog() ui = Ui_ProjTempl() ui.setupUi(ProjTempl) ProjTempl.show() sys.exit(app.exec_())
def gui_sablonekle(self): Saek = QtWidgets.QDialog() ui = Ui_SablonEkle() ui.setupUi(Saek) Saek.show() Saek.exec_()
self.lblAmount.setText(str(row[0][0])) model.setQuery(q) model.setHeaderData(0, QtCore.Qt.Horizontal, "ID") model.setHeaderData(1, QtCore.Qt.Horizontal, "Customer") model.setHeaderData(2, QtCore.Qt.Horizontal, "Product Name") model.setHeaderData(4, QtCore.Qt.Horizontal, "Quantity") model.setHeaderData(3, QtCore.Qt.Horizontal, "Amount Paid") model.setHeaderData(5, QtCore.Qt.Horizontal, "Date") self.allSalesView.setModel(model) self.btlTotal.setText(str(model.rowCount())) self.allSalesView.horizontalHeader().setMinimumHeight(40) self.allSalesView.horizontalHeader().setDefaultSectionSize(180) self.allSalesView.setColumnHidden(0, True) self.allSalesView.setColumnHidden(6, True) self.allSalesView.setSelectionBehavior( QtWidgets.QTableView.SelectRows) self.allSalesView.setShowGrid(True) self.allSalesView.show() if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) ViewSales = QtWidgets.QDialog() ui = Ui_ViewSales() ui.setupUi(ViewSales) ViewSales.show() sys.exit(app.exec_())
self.comboBox.setItemText(0, _translate("window_anp", "Kg")) self.comboBox.setItemText(1, _translate("window_anp", "gm")) self.comboBox.setItemText(2, _translate("window_anp", "L")) self.comboBox.setItemText(3, _translate("window_anp", "ml")) self.comboBox.setItemText(4, _translate("window_anp", "units")) self.label_11.setText(_translate("window_anp", "Product ID :")) self.label_7.setText(_translate("window_anp", "SGST : ")) self.label_3.setText(_translate("window_anp", "UOM :")) self.label_2.setText(_translate("window_anp", "Product Name :")) self.button_add.setText(_translate("window_anp", "Add")) self.button_add.setShortcut(_translate("window_anp", "Ctrl+S")) self.button_clear.setText(_translate("window_anp", "Clear")) self.button_clear.setShortcut(_translate("window_anp", "Alt+C")) self.button_new.setText(_translate("window_anp", "New")) self.button_find.setText(_translate("window_anp", "Load")) self.button_find.setShortcut(_translate("window_anp", "Ctrl+F")) self.button_delete.setText(_translate("window_anp", "Delete")) self.button_delete.setShortcut(_translate("window_anp", "Del")) self.button_edit.setText(_translate("window_anp", "Edit")) self.button_edit.setShortcut(_translate("window_anp", "Alt+E")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) window_anp = QtWidgets.QDialog() ui = Ui_window_anp() ui.setupUi(window_anp) window_anp.show() sys.exit(app.exec_())
self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) self.retranslateUi(TreeTypeDialog) QtCore.QMetaObject.connectSlotsByName(TreeTypeDialog) def retranslateUi(self, TreeTypeDialog): _translate = QtCore.QCoreApplication.translate TreeTypeDialog.setWindowTitle( _translate("TreeTypeDialog", "Tree Type Dialog")) self.pushButtonLarch.setText(_translate("TreeTypeDialog", "Larch")) self.pushButtonAlder.setText(_translate("TreeTypeDialog", "Alder")) self.pushButtonPoplar.setText(_translate("TreeTypeDialog", "Poplar")) self.pushButtonAsh.setText(_translate("TreeTypeDialog", "Ash")) self.pushButtonSpruce.setText(_translate("TreeTypeDialog", "Spruce")) self.pushButtonBeech.setText(_translate("TreeTypeDialog", "Beech")) self.pushButtonPine.setText(_translate("TreeTypeDialog", "Pine")) self.pushButtonOak.setText(_translate("TreeTypeDialog", "Oak")) self.pushButtonBirch.setText(_translate("TreeTypeDialog", "Birch")) self.pushButtonCancel.setText(_translate("TreeTypeDialog", "Cancel")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) TreeTypeDialog = QtWidgets.QDialog() ui = Ui_TreeTypeDialog() ui.setupUi(TreeTypeDialog) TreeTypeDialog.show() sys.exit(app.exec_())
def import_file(): """Import a new video/image sequence-type file and create mem-mapped file """ # TODO: add rotate ON import # do NOT do rotations AFTER importing, it's not worth the trouble fileinfo = QtWidgets.QFileDialog.getOpenFileName( gv.w, 'Open file...', gv.open_dir, '[HDF] Container (*.h5; *.hdf5);;' '[Monochrome] Video Files (*.avi; *.mp4);;' '[RGB] Video Files (*.avi; *.mp4);;') if fileinfo == ('', ''): return close_file() videopath = fileinfo[0] videoformat = fileinfo[1] ### Get video file info path_parts = videopath.split(os.path.sep) gv.open_dir = os.path.join(videopath[:-1]) filename = path_parts[-1] ext = filename.split('.')[-1] ### Set file path and handle gv.filepath = os.path.join(gv.open_dir, f'{filename[:-(len(ext) + 1)]}.{gv.EXT_ANNOT}') print('Import file {} to {}'.format(videopath, gv.filepath)) if os.path.exists(gv.filepath): confirm_dialog = QtWidgets.QMessageBox.question( gv.w, 'Overwrite file?', 'This file has already been imported. Do you want to re-import and overwrite?', QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Cancel, QtWidgets.QMessageBox.No) if confirm_dialog == QtWidgets.QMessageBox.No: open_file() return elif confirm_dialog == QtWidgets.QMessageBox.Cancel: return # Open file gv.h5f = h5py.File(gv.filepath, 'w') # IMPORT props = dict() if ext.lower() in ['avi']: props = import_avi(videopath, videoformat) elif ext.lower() in ['mp4']: pass elif ext.lower() in ['h5', 'hdf5']: props = import_hdf5(videopath, videoformat) else: close_file() return if not (bool(props)): # Add ATTRIBUTES dialog = QtWidgets.QDialog(gv.w) dialog.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) dialog.setLayout(QtWidgets.QGridLayout()) dialog.lbl_set = QLabel('Set metadata') dialog.lbl_set.setStyleSheet( 'font-weight:bold; text-alignment:center;') dialog.layout().addWidget(dialog.lbl_set, 0, 0, 1, 2) dialog.fields = dict() for i, (key, val) in enumerate(props.items()): dialog.layout().addWidget(QLabel(key), i + 1, 0) if isinstance(val, (float, np.float32, np.float64)): field = QtWidgets.QDoubleSpinBox() field.setValue(val) elif isinstance(val, (int, np.uint)): field = QtWidgets.QSpinBox() field.setValue(val) else: field = QtWidgets.QLineEdit() field.setText(val) dialog.fields[key] = field dialog.layout().addWidget(field, i + 1, 1) dialog.btn_submit = QtWidgets.QPushButton('Save') dialog.btn_submit.clicked.connect(dialog.accept) dialog.layout().addWidget(dialog.btn_submit, len(props) + 2, 0, 1, 2) if not (dialog.exec_() == QtWidgets.QDialog.Accepted): raise Exception('No scale for limits set.') for key, field in dialog.fields.items(): if hasattr(field, 'value'): gv.h5f.attrs[key] = field.value() elif hasattr(field, 'text'): gv.h5f.attrs[key] = field.text() # Set indices and timepoints if gv.KEY_FRAME_IDCS not in gv.h5f: gv.h5f.create_dataset(gv.KEY_FRAME_IDCS, data=np.arange(gv.h5f[gv.KEY_ORIGINAL].shape[0]), dtype=np.uint64) if gv.KEY_TIME not in gv.h5f: gv.h5f.create_dataset(gv.KEY_TIME, data=gv.h5f[gv.KEY_FRAME_IDCS], dtype=np.float64) if gv.KEY_ATTR_FPS in gv.h5f.attrs: gv.h5f[gv.KEY_TIME][:] = gv.h5f[gv.KEY_TIME][:] / gv.h5f.attrs[ gv.KEY_ATTR_FPS] # Set video gv.w.set_title(gv.filepath) gv.w.viewer.slider.setValue(0) gv.w.update_ui() gv.w.rpanel.setEnabled(True)
self.label = QtWidgets.QLabel(self.Info_Text) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.verticalLayout_2.addWidget(self.Info_Text) self.textEdit = QtWidgets.QTextEdit(self.Info_Area) self.textEdit.setObjectName("textEdit") self.verticalLayout_2.addWidget(self.textEdit) self.verticalLayout_3.addWidget(self.Info_Area) self.horizontalLayout.addWidget(self.Infowidget) self.retranslateUi(LoadTestWindow) QtCore.QMetaObject.connectSlotsByName(LoadTestWindow) def retranslateUi(self, LoadTestWindow): _translate = QtCore.QCoreApplication.translate LoadTestWindow.setWindowTitle( _translate("LoadTestWindow", "Load Test Set")) self.Loadbtn.setText(_translate("LoadTestWindow", "Load")) self.label.setText(_translate("LoadTestWindow", "Information")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) LoadTestWindow = QtWidgets.QDialog() ui = Ui_LoadTestWindow() ui.setupUi(LoadTestWindow) LoadTestWindow.show() sys.exit(app.exec_())
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(1175, 640) self.pushButton = QtWidgets.QPushButton(Dialog) self.pushButton.setGeometry(QtCore.QRect(260, 420, 80, 25)) self.pushButton.setObjectName("pushButton") self.retranslateUi(Dialog) # self.pushButton.clicked.connect(Dialog.close) self.pushButton.clicked.connect(slot=self.test) QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate Dialog.setWindowTitle(_translate("Dialog", "Dialog")) self.pushButton.setText(_translate("Dialog", "PushButton")) def test(self): print("123123") if __name__ == '__main__': import sys app = QtWidgets.QApplication(sys.argv) formObj = QtWidgets.QDialog() # 注意,这里和我们一开始创建窗体时使用的界面类型相同 ui = Ui_Dialog() ui.setupUi(formObj) formObj.show() sys.exit(app.exec_())
def gui_uzlastirmaci_ekle(self): UzlastirmaciEkle = QtWidgets.QDialog() ui = Ui_UzlastirmaciEkle() ui.setupUi(UzlastirmaciEkle) UzlastirmaciEkle.show() UzlastirmaciEkle.exec_()
for j in player: self.players_lw.addItem(j[0]) z = matchcur.execute("SELECT value from teams WHERE name='" + t + "';") value = z.fetchall() for k in value: self.scores_lw.addItem(str(k[0])) def final_score(self): total_score = 0 t = self.selectteam_cb.currentText() # current teamname # print(t) z = matchcur.execute("SELECT value from teams WHERE name='" + t + "';") value = z.fetchall() # print('value', value) for k in value: total_score += k[0] self.score_screen.finalscore.setText(str( total_score)) # opening score dialog box and setting final score self.scoreDialog.show() if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) evaluate_team = QtWidgets.QDialog() ui = Ui_evaluate_team() ui.setupUi(evaluate_team) evaluate_team.show() sys.exit(app.exec_())
def gui_uzlastirmaci_sil(self): UzlastirmaciSil = QtWidgets.QDialog() ui = Ui_UzlasmaciSil() ui.setupUi(UzlastirmaciSil) UzlastirmaciSil.show() UzlastirmaciSil.exec_()
self.label_2.setText(_translate("Dialog", "昵称:")) self.label_3.setText(_translate("Dialog", "性别:")) self.pushButton.setText(_translate("Dialog", "添加好友")) self.pushButton.clicked.connect(self.addFriendButton) '''def setName(self, name): self.textBrowser_2.clear() self.textBrowser_2.setText(name)''' '''def add(self,name): print(name) self.textBrowser_2.setText(name)''' '''def getDialogSignal(self, connect): self.textBrowser_2.setText(connect) print(self.textBrowser_2.toPlainText())''' def addFriendButton(self): '''添加好友功能''' def exit(self): self.dialog.close() if __name__ == '__main__': app = QApplication(sys.argv) widget = QtWidgets.QDialog() aui = AddFriend_Dialog() aui.setupUi(widget) widget.show() sys.exit(app.exec_())
def gui_dosya_sil(self): DosyaSil = QtWidgets.QDialog() ui = Ui_DosyaSil() ui.setupUi(DosyaSil) DosyaSil.show() DosyaSil.exec_()
QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_cancel.setIcon(icon3) self.pushButton_cancel.setObjectName("pushButton_cancel") self.horizontalLayout_2.addWidget(self.pushButton_cancel) self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1) self.retranslateUi(nexViewer) QtCore.QMetaObject.connectSlotsByName(nexViewer) def retranslateUi(self, nexViewer): _translate = QtCore.QCoreApplication.translate nexViewer.setWindowTitle(_translate("nexViewer", "Nexus File Viewer")) self.label.setText( _translate("nexViewer", "Remember save your changes")) self.toolButton.setToolTip(_translate("nexViewer", "Use Wraps")) self.pushButton_2.setText(_translate("nexViewer", "Save and Run")) self.pushButton.setText(_translate("nexViewer", "Save to File")) self.pushButton_cancel.setText(_translate("nexViewer", "Cancel")) from uifiles import myRes_rc if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) nexViewer = QtWidgets.QDialog() ui = Ui_nexViewer() ui.setupUi(nexViewer) nexViewer.show() sys.exit(app.exec_())
self.lineEdit_2 = QtWidgets.QLineEdit(Sign_up) self.lineEdit_2.setGeometry(QtCore.QRect(170, 60, 191, 31)) self.lineEdit_2.setEchoMode(QtWidgets.QLineEdit.Password) self.lineEdit_2.setObjectName("lineEdit_2") self.lineEdit_3 = QtWidgets.QLineEdit(Sign_up) self.lineEdit_3.setGeometry(QtCore.QRect(170, 100, 191, 31)) self.lineEdit_3.setEchoMode(QtWidgets.QLineEdit.Password) self.lineEdit_3.setObjectName("lineEdit_3") self.retranslateUi(Sign_up) QtCore.QMetaObject.connectSlotsByName(Sign_up) def retranslateUi(self, Sign_up): _translate = QtCore.QCoreApplication.translate Sign_up.setWindowTitle(_translate("Sign_up", "New User")) self.username.setText(_translate("Sign_up", "Username")) self.password.setText(_translate("Sign_up", "Password")) self.confirm.setText(_translate("Sign_up", "Confirm password")) self.c_password.setText(_translate("Sign_up", "Confirm")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Sign_up = QtWidgets.QDialog() ui = Ui_Sign_up() ui.setupUi(Sign_up) Sign_up.show() sys.exit(app.exec_())