Using QtHostinfo.lookupHost in PySide

I am working on a project where I want to confirm the presence of a host on the local network. In the QtNetwork package in Qt, a method QHostInfo::lookupHostis a convenient way to search for a host without having to make any request or hang from a ping system call. Its asynchronous call allows you to create a dialog that is waiting for the call to be returned using the slot in the dialog box or the main program for processing the return.

From the Qt documentation for QHostInfo:

To asynchronously search for host IP addresses, call lookupHost (), which takes the host name or IP address, the recipient object, and the slot signature as arguments and returns the identifier. You can abort a search by calling abortHostLookup () with a search id ...

The slot is called when the results are ready. Results are stored in the QHostInfo object. Call addresses () to get a list of IP addresses for the host, and hostName () to get the name of the host that was viewed.


The documentation from PySide for QHostInfodetails describes the use lookupHost, but I think that it can be automatically generated from the Qt documentation by default, the method is lookupHostdeclared as a private method in the type definition for QtNetwork .

Is there a special reason that this method is declared private in the PySide implementation? Does this relate to the asynchronous nature of the call and the Python GIL?

+5
source share
1 answer

, PySide, PySide QtNetwork, :

<modify-function signature="lookupHost(QString,QObject*,const char*)" access="public"/>

PySide

+1

All Articles