有没有办法用 Qt 访问 windows 7 进度条?我目前正在使用 Qt 4.7.0 和 Qt Creator。
我已经找到了 Q7Goodies 但不幸的是它不是免费的。所以这似乎是可能的 - 我如何手动访问进度条(没有 Visual Studio)?
Is there a way to access the windows 7 progress bar with Qt? I'm currently using Qt 4.7.0 with Qt Creator.
I already found Q7Goodies but unfortunately it is not free. So it seems to be possible - how can I access to the progress bar by hand (without Visual Studio)?
发布评论
评论(2)
我认为他们使用了Win7 API函数并将它们封装在他们的库中。您可以手动包含这些标头并使用它们。您可以在这里找到帮助主题和演示项目:codeproject.com/KB/vista/SevenGoodiesTaskbarStatus。 aspx
但它只适用于win7。不跨平台。祝你好运
2014 年 3 月 5 日更新
这个问题很久以前就被提出了,从那以后很多事情都发生了变化。对于今天(2014 年初)问自己同样问题的人来说,我个人的答案是 Qt 5 完全支持任务栏进度和不同类型的漂亮附加功能。请参阅 QWinTaskbarProgress(2016 年 11 月 28 日更新 )了解详情
I think they used Win7 API functions and encapsulated them in their library. You can include by hand those headers and use them too. Here you can find a help topic and demo project: codeproject.com/KB/vista/SevenGoodiesTaskbarStatus.aspx
But its only for win7. Not crossplatform. Good luck
update mar 05, 2014
This question was asked a long time ago and many things have changed since. For those asking themselves the same question today (beginnings of 2014) then my personal answer is that Qt 5 fully supports progress in taskbar and different kind of beautiful extras. See QWinTaskbarProgress (upd nov 28, 2016) for details
您可以使用
QWinTaskbarProgress
类。要使用此类,您需要在 .pro 文件中添加win32:QT += wineextras
。以下示例代码展示了如何在 Windows 任务栏中显示
QProgressBar
的值 (受此示例启发):You can use the
QWinTaskbarProgress
class. To use this class, you need to addwin32:QT += winextras
in your .pro file.Here is an example code showing how to show the value of a
QProgressBar
in the Windows task bar (inspired from this example):