PyQt4设置Windows任务栏图标

编程入门 行业动态 更新时间:2024-10-23 15:32:17
本文介绍了PyQt4设置Windows任务栏图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Python的PyQt4中的applcation,但无法找到如何更改任务栏图标。我在Qt的Designer中制作了我的.ui文件,我可以在这里更改 windowIcon 属性。但这不是我想要的。我想在Windows任务栏中更改应用程序图标的外观。现在它是一个窗口图标中的Python徽标。

我在SO上找到了一些信息:了解详情,以及解决方法唱 ctypes 。

I'm working on an applcation in Python's PyQt4 and cannot find how to change the taskbar icon. I made my .ui files in Qt's Designer, where I can change the windowIcon properties. But that is not what I am looking for. I want to change the look of the application's icon in windows taskbar. For now it is Python logo in a window icon.

I found some information on SO: link but it's not helping me much.

I tryed:

app = QtGui.QApplication([]) app.setWindowIcon(QtGui.QIcon('chip_icon_normal.png')) app.exec_()

But the icon remains unchanged.

What i want to change, showing the picture: (This is done calling the setWindowIcon on main window/ dialog, or the application, as shown above.)

解决方案

This problem is caused by some peculiarities in how taskbar icons are handled on the Windows platform.

See this answer for details, along with a workaround using ctypes.

更多推荐

PyQt4设置Windows任务栏图标

本文发布于:2023-11-07 05:20:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565655.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:任务栏   图标   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!