123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @文件 :statusbar.py
- @时间 :2022/01/22 09:55:34
- @作者 :None
- @版本 :1.0
- @说明 :状态栏页面
- '''
- from utils.qt import QStatusBar, QLabel, QFrame, QMetaObject, QCoreApplication
- class UiStatusBar(object):
- def setupUi(self, pcs_status):
- self.statusbar = QStatusBar()
- # pcs连接状态
- self.label_pcs_connect = QLabel()
- self.label_pcs_connect.setFrameStyle(QFrame.Panel | QFrame.Raised)
- self.label_pcs_connect.setLineWidth(3)
- self.label_pcs_connect.setMidLineWidth(3)
- # pcs发送状态
- self.label_pcs_send = QLabel()
- self.label_pcs_send.setFrameStyle(QFrame.Panel | QFrame.Raised)
- self.label_pcs_send.setLineWidth(3)
- self.label_pcs_send.setMidLineWidth(3)
- # pcs发送状态
- self.label_pcs_received = QLabel()
- self.label_pcs_received.setFrameStyle(QFrame.Panel | QFrame.Raised)
- self.label_pcs_received.setLineWidth(3)
- self.label_pcs_received.setMidLineWidth(3)
- # pcs软件版本号
- self.label_pcs_version = QLabel()
- self.label_pcs_version.setFrameStyle(QFrame.Panel | QFrame.Raised)
- self.label_pcs_version.setLineWidth(3)
- self.label_pcs_version.setMidLineWidth(3)
- # 往状态栏中添加组件(stretch应该是拉伸组件宽度)
- self.statusbar.addWidget(self.label_pcs_connect, stretch=0)
- self.statusbar.addWidget(self.label_pcs_send, stretch=0)
- self.statusbar.addWidget(self.label_pcs_received, stretch=0)
- self.statusbar.addPermanentWidget(self.label_pcs_version, stretch=0)
- self.statusbar.setSizeGripEnabled(False)
- self.retranslateUi(pcs_status)
- QMetaObject.connectSlotsByName(pcs_status)
- def retranslateUi(self, pcs_status):
- _translate = QCoreApplication.translate
- self.label_pcs_connect.setText(_translate("pcs_status", "未连接"))
- self.label_pcs_send.setText(_translate("pcs_status", "发送未启动"))
- self.label_pcs_received.setText(_translate("pcs_status", "接收未启动"))
|