[英]How do I make the taskbar show my progress bar in PyQt4?
I'm using PyQt4 to display a progress bar in my application, but I want it to also be seen on the taskbar, just like many programs such as winRAR and google chrome do. 我正在使用PyQt4在我的应用程序中显示进度条,但是我希望它也可以在任务栏上看到,就像winRAR和google chrome这样的许多程序一样。 Is there a way to make that happen?
有没有办法做到这一点?
是的,您需要设置QProgressBar(而不是QProgressBarDialog)并使用insertWidget()插入QStatusBar(或QMainWindow.statusBar() ) ,然后在完成后使用removeWidget将其删除。
in PyQT5 you must use addWidget() 在PyQT5中,您必须使用addWidget()
class ExampleApp(QtWidgets.QMainWindow, mainwindow_test.Ui_MainWindow):
def __init__(self):
super().__init__()
self.statusbar.addWidget(self.progressBar)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.