Issue with QNetworkInformation
Detlev Offenbach
detlev at die-offenbachs.de
Sat Sep 4 18:50:39 BST 2021
Hello,
I am facing an issue with QNetworkInformation. Trying to connect to the
signal 'reachabilityChanged' fails with an error. Please see below for a
console example. According to the error printed, no such signal exists
but looking at the sip file shows, that it should. Please help me solve it.
------------------------------------------------------------------------
>>> from PyQt6.QtCore import pyqtSlot
>>> from PyQt6.QtNetwork import QNetworkInformation
>>> @pyqtSlot(QNetworkInformation.Reachability)
... def reachabilityChanged(reach):
... print(reach)
...
>>> QNetworkInformation.load(QNetworkInformation.Feature.Reachability)
True
>>> QNetworkInformation.instance().reachability()
<Reachability.Online: 4>
>>>
QNetworkInformation.instance().reachabilityChanged.connect(reachabilityChanged)
StdErr: qt.core.qobject.connect: QObject::connect: No such signal
QNetworkInformation::reachabilityChanged(QNetworkInformation::Reachability)
neptun/12848/main: Traceback (innermost last):
File "<stdin>", line 1, in <module>
TypeError: connect() failed between
reachabilityChanged(QNetworkInformation::Reachability) and unislot()
>>>
------------------------------------------------------------------------
Regards
Detlev
--
Detlev Offenbach
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210904/8a1b0772/attachment.htm>
More information about the PyQt
mailing list