zoukankan      html  css  js  c++  java
  • MyQMainWindowDemo

    # coding=utf-8
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *
    from MyQThread import *
    import sys
    from SocketFromServer import SocketFromServer
    import img
    
    class MyQMainWindowDemo(QMainWindow):
        def __init__(self, parent=None):
            super(MyQMainWindowDemo, self).__init__(parent)
            mycode = 'utf-8'
            code = QTextCodec.codecForName(mycode)
            QTextCodec.setCodecForLocale(code)
            QTextCodec.setCodecForTr(code)
            QTextCodec.setCodecForCStrings(code)
            title = ['     事件监控平台
    下面是相应未处理的事件', '事件ID   :', '责任人   :', 'eSpace已通知']
            label_0 = QLabel(title[0])
    
            ft = QFont()
            ft.setPointSize(20)
            ft.setBold(True)
            label_0.setFont(ft)
    
            input_box = QGridLayout()
            Title_Layout = QVBoxLayout()
            Content_Layout = QHBoxLayout()
    
            Title_Layout.addWidget(label_0, alignment=Qt.AlignCenter)
    
            input_box.setColumnStretch(0, 1)
            input_box.setColumnStretch(1, 2)
            input_box.setColumnStretch(2, 1)
    
            self.eSpaceTextEdit = QTextBrowser()
            input_box.addWidget(self.eSpaceTextEdit, 0, 0, 4, 7)
            self.initMenu()
            self.socket = SocketFromServer()
    
            a = QWidget()
            self.thread = MyQThread()
            self.MyThread_30 = MyQThread_30()
    
            self.btnStart = QPushButton('Start')
            h_box = QVBoxLayout()
    
            h_box.addLayout(Title_Layout, 1)
            h_box.addLayout(input_box, 5)
    
            a.setLayout(h_box)
            self.setCentralWidget(a)
            self.resize(QSize(550, 300))
            self.setWindowTitle(u'eSpace监控外呼工具')
            self.row = 1
            self.connect(self.thread, SIGNAL('output(QString)'), self.AutoRefreshData)  # 10S获取新的
            self.connect(self.MyThread_30, SIGNAL('output(QString)'), self.AutoRefreshAndSend)  # 1min更新界面
    
            self.thread.start()
            self.MyThread_30.start()
            self.warning_thread = MyQThread_Warning()
            self.warning_thread.start()
            self.delay_thread = MyQThreadDelay()
            self.setWindowIcon(QIcon(':img/background.ico'))
            self.music_warning_status = 0
            self.lock_delay_status = 0
    
    
            self.setAutoFillBackground(True)
    
        
    
    
    if __name__ == "__main__":
        try:
            app = QApplication(sys.argv)
            myWindow = MyQMainWindowDemo()
            myWindow.show()
            sys.exit(app.exec_())
        except Exception, e:
            print e
    
    
    
  • 相关阅读:
    VFP获取 SQL Server 的数据表、触发器、存储过程、视图等脚本
    VFP控制Excel操作集
    MS SqlServer 的日期格式化函数 Convert
    VFP 图形文件与剪切板互换的API解决方法
    VFP中OCX控件注册检测及自动注册
    VFP检测SQL Server的五个实例代码
    缓存方案笔记
    windows访问控制列表 --ACL(Access Control List)
    cnblog排版
    GIT常用命令
  • 原文地址:https://www.cnblogs.com/jian-pan/p/6934846.html
Copyright © 2011-2022 走看看