[PyQt] SystemTrayIcon activated signal

Kálmán Viktor viktorvector at gmail.com
Wed Aug 23 15:34:36 BST 2017


Hello,

I'm trying to connect a signal to SystemTrayIcon's activated.

The relevant part looks like this:
        self.qwindow.load(qml_url)
        first = self.qwindow.rootObjects()[0]
        tray = first.findChild(QObject, "anyadszerete")  # in the qml file
objectName is set

        @pyqtSlot(QObject, name="activated")
        def activated(reason):
            print(reason)

        tray.activated.connect(activated)

The error I get: TypeError: C++ type
'QPlatformSystemTrayIcon::ActivationReason' is not supported as a signal
argument type

What would be the correct way to do this?

Also I'm not entirely sure if this is PyQt related but the reason I'm
trying to do it this way (and not in my QtQuick QML file) is because
`onActivated: { console.log(reason); }` always prints undefined in the
app.qml (but im not sure if it's a Qt or PyQt issue)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170823/91fbd584/attachment.html>


More information about the PyQt mailing list