Re: Problem with QSystemTrayIcon.showMessage

Kálmán Viktor <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CA+sJfQz1LEPdfJNkeQoK+A_GJ7T9MWLawkpJEf8msAQm=Upf-Q@mail.gmail.com>
It displays the application name there, I don't think you can hide that, at
least Qt doesn't have an option for it (
https://doc.qt.io/qt-5/qsystemtrayicon.html#showMessage).
It display Python because you are running it via the python interpreter,
once you have built your application for it will display a proper name.
As for the 2nd message it's on Windows, it's either a cache issue (it
usually resolves after a while) or a bug in Windows:
https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/what-does-this-mean/104c2e8a-fb3b-4ef9-8ae8-8471e8ebe3f8

Zdenko Podobny <[email protected]> ezt írta (időpont: 2019. ápr. 1., H,
18:40):

> Hello,
>
> I try to create systemtray application and I have some issue
> with showMessage function:
> When message is shown (e.g. when calling settings or exit function) -
> message is show but with additional information like "python" or
> "Microsoft.Exploror.....":
>
>    1. [image: image.png]
>    [image: image.png]
>
> How to hide is?
>
> Here is my code:
>
> import sys
> from PyQt5 import QtCore, QtGui, QtWidgets
>
>
> class SystemTrayIcon(QtWidgets.QSystemTrayIcon):
>
>     def __init__(self, icon, parent=None):
>         QtWidgets.QSystemTrayIcon.__init__(self, icon, parent)
>         self.menu = QtWidgets.QMenu(parent)
>         settingsAction = self.menu.addAction(self.tr("Settings..."))
>         settingsAction.triggered.connect(self.settings)
>         exitAction = self.menu.addAction(self.tr("Exit"))
>         exitAction.triggered.connect(self.exit)
>         self.setContextMenu(self.menu)
>         self.show()
>         self.showMessage("My app", "App started!", msecs=1000)
>
>     def exit(self):
>         QtCore.QCoreApplication.exit()
>         self.showMessage("My app", "Quitting...", msecs=1000)
>         self.hide()
>
>     def settings(self):
>         self.showMessage("My app", "Not implemented yet...", msecs=1000)
>
>
> app = QtWidgets.QApplication(sys.argv)
> widget = QtWidgets.QWidget()
> trayIcon = SystemTrayIcon(QtGui.QIcon('logo.ico'), widget)
> sys.exit(app.exec_())
>
>
> I use PyQt5-5.12.1-5.12.2-cp35.cp36.cp37.cp38-none-win_amd64.whl (on
> Windows 10)
>
> Zdenko
> _______________________________________________
> PyQt mailing list    [email protected]
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
image.png (image/png, 37.9 KB) - not displayed
image.png (image/png, 46 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.