文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

python程序界面

2023-01-31 07:40

关注
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'Main.ui'
#
# Created: Thu Jan 29 16:25:31 2015
#      by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
import sys,time

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class Ui_Dialog(QtGui.QDialog):
    def __init__(self):
        super(Ui_Dialog, self).__init__()
       
        self.setupUi(self)
        self.retranslateUi(self)
        self.flag0=True
        self.flag1=True
        timer=QtCore.QTimer(self)  
        QtCore.QObject.connect(timer,QtCore.SIGNAL("timeout()"),self.ScanCodeChange)
        timer.start(8000)  
        
        bannertimer=QtCore.QTimer(self)  
        QtCore.QObject.connect(bannertimer,QtCore.SIGNAL("timeout()"),self.BannerChange)
        bannertimer.start(5000)         
        
    #This is the scanCodePic changed operation.
    def ScanCodeChange(self):       
        if self.flag0==True:
            self.label_2.setPixmap(QtGui.QPixmap(_fromUtf8("D:/ADPic/scan01.jpg")))
            self.flag0=False
        else:
            self.label_2.setPixmap(QtGui.QPixmap(_fromUtf8("D:/ADPic/scan02.jpg")))
            self.flag0=True
            
    #This is the BannerPic changed operation.
    def BannerChange(self):       
        if self.flag1==True:
            self.label.setPixmap(QtGui.QPixmap(_fromUtf8("D:/ADPic/bank01.jpg")))
            self.flag1=False
        else:
            self.label.setPixmap(QtGui.QPixmap(_fromUtf8("D:/ADPic/bank02.jpg")))
            self.flag1=True     
            
    def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(1000, 1000)
        Dialog.setAutoFillBackground(True)
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(0, 0, 1500, 600))
        self.label.setText(_fromUtf8(""))
        self.label.setPixmap(QtGui.QPixmap(_fromUtf8("D:/ADPic/bank01.jpg")))
        self.label.setScaledContents(True)
        self.label.setObjectName(_fromUtf8("label"))
        self.textBrowser = QtGui.QTextBrowser(Dialog)
        self.textBrowser.setGeometry(QtCore.QRect(0, 600, 600,500))
        self.textBrowser.setObjectName(_fromUtf8("textBrowser"))
        #self.widget = QtGui.QWidget(Dialog)
        #self.widget.setGeometry(QtCore.QRect(399, 389, 371, 191))
        #self.widget.setObjectName(_fromUtf8("widget"))
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(600, 600, 850, 300))
        self.label_2.setText(_fromUtf8(""))
        self.label_2.setPixmap(QtGui.QPixmap(_fromUtf8("D:/ADPic/scan01.jpg")))
        self.label_2.setScaledContents(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        
    def retranslateUi(self, Dialog):
        self.textBrowser.setHtml(_translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:18pt; font-weight:600;\">说明:</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:18pt; font-weight:600;\">1.请按回车键输入手机接收到的验证码。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:18pt; font-weight:600;\">2.输入时请您仔细核实,按回车键进行输入,按ESC键进行退出。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:18pt; font-weight:600;\">3.输入完成后按回车键进行奖品领取。</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>", None))
      
    def keyPressEvent(self, event):      
        if event.key() == QtCore.Qt.Key_Return:
            dialog=CheckUi_dialog()
            dialog.show()
            dialog.setModal(False)
           
            dialog.exec_()
            #print 'showcheckdialog'
        else:
            #when the normal screen works it need to display(to avoid esc)!
            QtGui.QDialog.keyPressEvent(self, event)            
            
            
class CheckUi_dialog(QtGui.QDialog):
    def __init__(self):
        super(CheckUi_dialog, self).__init__() 
        self.checksetupUi(self)
        self.checkretranslateUi(self)
     
    def checksetupUi(self, dialog):
        dialog.setObjectName(_fromUtf8("dialog"))
        dialog.resize(456, 218)
        self.pushButton_2 = QtGui.QPushButton(dialog)
        self.pushButton_2.setGeometry(QtCore.QRect(300, 150, 111, 41))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.pushButton = QtGui.QPushButton(dialog)
        self.pushButton.setGeometry(QtCore.QRect(60, 150, 111, 41))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.label = QtGui.QLabel(dialog)
        self.label.setGeometry(QtCore.QRect(20, 70, 101, 31))
        self.label.setObjectName(_fromUtf8("label"))
        self.textEdit = QtGui.QLineEdit(dialog)
        self.textEdit.setGeometry(QtCore.QRect(130, 70, 291, 31))
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.textEdit.setFocus()
        QtCore.QObject.connect(self.textEdit, QtCore.SIGNAL("returnPressed()"), self.text)
        self.checkretranslateUi(dialog)         
        QtCore.QMetaObject.connectSlotsByName(dialog)
        dialog.setTabOrder(self.pushButton, self.pushButton_2) 
    def text(self):  
        if not self.textEdit.text():
            QtGui.QMessageBox.about(self,(_fromUtf8("提示!")), (_fromUtf8("请输入验证码!")))
        else:
            if (int(self.textEdit.text())==5):
                #print 'codesuccess'
                QtGui.QMessageBox.about(self,(_fromUtf8("恭喜您!")), (_fromUtf8("恭喜您,您的验证码通过,请您及时领取奖品!")))
            else:
                QtGui.QMessageBox.about(self,(_fromUtf8("很抱歉!")), (_fromUtf8("很抱歉,您的验证码输入不正确,请您再次验证核实")))
                #print 'codefailed'
    def checkretranslateUi(self, dialog):
        dialog.setWindowTitle(_translate("dialog", "输入验证码", None))
        self.pushButton_2.setText(_translate("dialog", "取 消", None))
        self.pushButton.setText(_translate("dialog", "确 定", None))
        self.label.setText(_translate("dialog", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">输入验证码:</span></p></body></html>", None))

      
                   

    
if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    win = Ui_Dialog()
    #win.show()
    win.showFullScreen()
    sys.exit(app.exec_())
#import 001_rc

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯