本文整理汇总了Python中PyQt5.QtWidgets.QStatusBar.addWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QStatusBar.addWidget方法的具体用法?Python QStatusBar.addWidget怎么用?Python QStatusBar.addWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QStatusBar
的用法示例。
在下文中一共展示了QStatusBar.addWidget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mainWindow
# 需要导入模块: from PyQt5.QtWidgets import QStatusBar [as 别名]
# 或者: from PyQt5.QtWidgets.QStatusBar import addWidget [as 别名]
class mainWindow(QMainWindow):
def __init__(self,obj):
super().__init__()
self.setObjectName('Window1')
self.obj=obj
self.set=0
self.initUI()
def initUI(self):
self.resize(850,500)
self.setWindowTitle('Moodly 1.0 Beta - Configure')
self.setWindowIcon(QIcon(':/Assets/moodly.gif'))
self.setFixedSize(830,500)
self.center()
self.sysTray=QWidget()
self.tray = SystemTrayIcon(QIcon(':/Assets/moodly.gif'),self.sysTray)
self.tray.show()
self.tray.trigger.connect(self.showApp)
self.tray.qtrigger.connect(self.closeApp)
self.tray.uptrigger.connect(self.updateNow)
self.setWidget()
self.show()
def setWidget(self):
if self.obj.configured==0:
self.setCentralWidget(configureWidget(self))
elif self.obj.configured==1:
self.setCentralWidget(setupWidget(self))
elif self.obj.configured==2:
self.setStyleSheet('''#Window1{background-color: light gray;}''')
self.setWindowTitle('Moodly 1.0 Beta')
self.setMenuBar()
self.tabWidget = tabWidget(self)
self.setCentralWidget(self.tabWidget)
self.tray.updateAction.setEnabled(True)
self.statusBar = QStatusBar()
self.setStatusBar(self.statusBar)
self.statusBar.hide()
self.statusLbl1 = QLabel()
self.statusLbl2 = QLabel()
self.statusLbl2.setAlignment(QtCore.Qt.AlignRight)
self.statusBar.addWidget(self.statusLbl1)
self.statusBar.addWidget(self.statusLbl2,QtCore.Qt.AlignRight)
self.updateTimer()
self.notifTimer()
self.i_thread = {}
self.nt=0
def showApp(self):
if self.isMinimized():
self.showNormal()
self.show()
self.activateWindow()
def closeApp(self):
self.tray.hide()
qApp.quit()
def showStatus(self,msg,id_):
if id_ == 0:
self.statusLbl1.setText(msg)
else:
self.statusLbl2.setText(msg)
self.statusBar.show()
def hideStatus(self,id_):
if id_==0:
self.statusLbl1.setText('')
else:
self.statusLbl2.setText('')
if self.statusLbl1.text() == '' and self.statusLbl2.text()=='':
self.statusBar.hide()
def updateTimer(self):
self.current_timer = QTimer()
delay = int(re.findall(r'\d+', self.obj.upIntval)[0])
delay = delay*60*60*1000
self.current_timer.timeout.connect(self.updater)
self.current_timer.setSingleShot(True)
if self.set==0:
self.updater()
else:
self.current_timer.start(delay)
def notifTimer(self):
#.........这里部分代码省略.........