def click2(self): name = self.input_zh.toPlainText() pwd = self.input_zh_4.toPlainText() Form2 = QtWidgets.QDialog() self.ui1 = Dialog1.Ui_Dialog1() self.ui1.setupUi(Form2) flag = load(name, pwd) if flag == 0: information = "账号不存在" Form2.show() self.ui1.label.setText(information) elif flag == 3: information = "密码错误" Form2.show() self.ui1.label.setText(information) elif flag == 2: information = "输入不能为空" Form2.show() self.ui1.label.setText(information) else: Form2.close() self.form.close() Form1 = QtWidgets.QMainWindow() self.ui = Mine.Ui_Mine() self.ui.setupUi(Form1) Form1.show()
def __init__(self, parent): self._init_ctrls(parent) self.CaseTitle.SetFocus() self.CaseList = [] self.CaseDisplay = [] self.dlg1 = Dialog1.Dialog1(self) current = self.dlg1.CurrentProject
def click3(self): pygame.mixer.music.load(r"page2_1.mp3") pygame.mixer.music.play() Form1 = QtWidgets.QDialog() self.ui = Dialog1.Ui_Dialog1() self.ui.setupUi(Form1) Form1.show() information = "不再联系—冯提莫!" self.ui.label.setText(information)
def jump_to_demo1( self ): #这一块注意,是重点从主界面跳转到Demo1界面,主界面隐藏,如果关闭Demo界面,主界面进程会触发self.form.show()会再次显示主界面 self.form.hide() #如果没有self.form.show()这一句,关闭Demo1界面后就会关闭程序 form1 = QtWidgets.QDialog() ui = Dialog1.Ui_Dialog1() ui.setupUi(form1) form1.show() form1.exec_() self.form.show()
def OnButton1Button(self, event): try: if self.login_text.GetLabelText() == "-": Dialog1.create(None).Show() else: user_id = self.login_text.GetLabelText() url = HOST + "/output/?user_id=" + user_id r = urllib2.urlopen(url) code = r.read() if "alert" in code: wx.MessageBox("暂时没有未导出的记录") else: filename = PATH + r.url.split("/")[-1] open(filename, "wb").write(code) wx.MessageBox("已成功导出至 " + filename) os.popen("explorer d:\\data") except: wx.MessageBox("请检查网络连接是否正常") event.Skip()
def click_open(self): Dialog = QtWidgets.QDialog() ui = Dialog1.Ui_Dialog() ui.setupUi(Dialog) Dialog.show() #Dialog.exec_() rsp = Dialog.exec_() #print(rsp) if rsp == QtWidgets.QDialog.Accepted: #表示的是对话框的接收事件 self.label.setText("点击了OK") else: self.label.setText("点击了Cannel")
def OnMenu2Items0Menu(self, event): """Option 按钮 """ dlg = Dialog1.create(self) dlg.ShowModal() dlg.Destroy() try: self.cfg.read(self.cfg_file) ## 重读设置 self.OfflinePath = self.cfg.get('path', 'Offline') #self.ExportPath = self.cfg.get('path','Export') self.OnlinePath = self.cfg.get('path', 'Online') #self.OfflineTdx._setpath(self.OfflinePath) #self.OnlineTdxMin._setpath(self.OnlinePath) except: pass
def OnMenu2Items0Menu(self, event): """Option 按钮 """ dlg = Dialog1.create(self) dlg.ShowModal() dlg.Destroy() try: self.cfg.read(self.cfg_file) ## 重读设置 self.OfflinePath = self.cfg.get("path", "Offline") # self.ExportPath = self.cfg.get('path','Export') self.OnlinePath = self.cfg.get("path", "Online") # self.OfflineTdx._setpath(self.OfflinePath) # self.OnlineTdxMin._setpath(self.OnlinePath) except: pass
def click2(self): Form1 = QtWidgets.QDialog() self.ui = Dialog1.Ui_Dialog1() self.ui.setupUi(Form1) Form1.show() name = self.input_zh.toPlainText() pwd1 = self.Input_mm.toPlainText() pwd2 = self.input_qrmm.toPlainText() if regisster_(name,pwd1,pwd2) == 0: information = "两次密码不一致" elif regisster_(name,pwd1,pwd2) == 10: information = "输入不能为空" else: information = "注册成功" self.ui.label.setText(information)
def OnButton2Button(self, event): try: if self.login_text.GetLabelText() == "-": Dialog1.create(None).Show() else: user_id = self.login_text.GetLabelText() url = HOST + "/output_img/?user_id=" + user_id r = urllib2.urlopen(url) code = r.read() if "alert" in code: wx.MessageBox("暂时没有未导出的图片") else: filename = PATH + r.url.split("/")[-1] open(filename, "wb").write(code) f = zipfile.ZipFile(filename, 'r') for file in f.namelist(): f.extract(file, PATH) f.close() wx.MessageBox("已将图片成功导出至 " + PATH) os.popen("explorer d:\\data") os.remove(filename) except: wx.MessageBox("请检查网络连接是否正常") event.Skip()
def OnMenuHelpAboutMenu(self, event): dlg = Dialog1.Dialog1(self) try: dlg.ShowModal() finally: dlg.Destroy()
def OpenDialog(self): self.dlg = Dialog1.Dialog1(self) try: self.dlg.ShowModal() finally: pass