这是简单系统托盘 PyQt 应用程序的代码示例 。
import sys
from PyQt4 import QtGui
def main():
app = QtGui.QApplication(sys.argv)
trayIcon = QtGui.QSystemTrayIcon(QtGui.QIcon( test.png ), app)
menu = QtGui.QMenu()
exitAction = menu.addAction("Exit")
trayIcon.setContextMenu(menu)
# I d like to show picture in tooltip, BUT IT S NOT WORK IN WINDOWS
trayIcon.setTooltip( <img src="SomePicture.png" width="48" height="48"/> )
trayIcon.show()
sys.exit(app.exec_())
if __name__ == __main__ :
main()
In this code I d like to show balloon tooltip with a some picture and some kind of text formating. For this purpose I use RichText tags formatting. As the result for Ubuntu Linux system (Gnome desktop) everything is Ok. But when I try use RichText formatting for tooltip in Windows XP system, nothing works. Tooltip text equals source string: . Python version on Windows 2.7, on Linux 2.6 but I think that problem is not in different versions.
在 Windows OS RichText 中, 如果 Windows OS RichText 没有解析, 我如何制作相同的图形界面?