如何让任务栏在 PyQt4 中显示我的进度条? [英] How do I make the taskbar show my progress bar in PyQt4?

查看:66
本文介绍了如何让任务栏在 PyQt4 中显示我的进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PyQt4 在我的应用程序中显示进度条,但我希望它也能在任务栏上看到,就像许多程序(如 winRAR 和 google chrome)所做的那样.有没有办法做到这一点?

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. Is there a way to make that happen?

推荐答案

是的,您需要设置 QProgressBar(而不是 QProgressBarDialog)并使用 insertWidget(),然后使用 removeWidget 删除它搞定了.

Yes, you'll want to setup your QProgressBar (not QProgressBarDialog) and insert into QStatusBar (or QMainWindow.statusBar()) with the insertWidget(), then use removeWidget to remove it when you're done with it.

这篇关于如何让任务栏在 PyQt4 中显示我的进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆