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 = ['     事件监控平台\n下面是相应未处理的事件', '事件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

转载于:https://www.cnblogs.com/jian-pan/p/6934846.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值