Skip to content

PythonQt.QtNetwork.QNetworkSession · declarations 002

Back to PythonQt.QtNetwork.QNetworkSession

state

state() -> Any

X.state()

Supplemental documentation: Qt 5 reference:

QNetworkSession::State QNetworkSession::state() const

Returns the state of the session.

If the session is based on a single access point configuration the state of the session is the same as the state of the associated network interface. Therefore a network session object can be used to monitor network interfaces.

A QNetworkConfiguration::ServiceNetwork based session summarizes the state of all its children and therefore returns the Connected state if at least one of the service network's children() configurations is active.

Note that it is not required to hold an open session in order to obtain the network interface state. A connected but closed session may be used to monitor network interfaces whereas an open and connected session object may prevent the network interface from being shut down.

See also error() and stateChanged().

Upstream PySide2 reference signatures (binding differences may apply):

state(self) -> PySide2.QtNetwork.QNetworkSession.State

Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html#state

stateChanged

stateChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkSession.stateChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkSession::stateChanged(QNetworkSession::State state)

This signal is emitted whenever the state of the network session changes. The state parameter is the new state.

See also state().

Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html#stateChanged

stop

stop() -> None

X.stop()

Supplemental documentation: Qt 5 reference:

[slot] void QNetworkSession::stop()

Invalidates all open sessions against the network interface and therefore stops the underlying network interface. This function always changes the session's state() flag to Disconnected.

See also open() and close().

Upstream PySide2 reference signatures (binding differences may apply):

stop(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html#stop

usagePolicies

usagePolicies() -> Any

X.usagePolicies()

Supplemental documentation: Qt 5 reference:

QNetworkSession::UsagePolicies QNetworkSession::usagePolicies() const

Returns the network usage policies currently in force by the system.

Upstream PySide2 reference signatures (binding differences may apply):

usagePolicies(self) -> PySide2.QtNetwork.QNetworkSession.UsagePolicies

Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html#usagePolicies

usagePoliciesChanged

usagePoliciesChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkSession.usagePoliciesChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkSession::usagePoliciesChanged(QNetworkSession::UsagePolicies usagePolicies)

This signal is emitted when the usagePolicies in force are changed by the system.

This function was introduced in Qt 5.0.

Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html#usagePoliciesChanged

waitForOpened

waitForOpened(msecs: int) -> bool

X.waitForOpened(msecs) -> bool

Supplemental documentation: Qt 5 reference:

bool QNetworkSession::waitForOpened(int msecs \= 30000)

Waits until the session has been opened, up to msecs milliseconds. If the session has been opened, this function returns true; otherwise it returns false. In the case where it returns false, you can call error() to determine the cause of the error.

The following example waits up to one second for the session to be opened:

    session->open();
    if (session->waitForOpened(1000))
        qDebug("Open!");

If msecs is -1, this function will not time out.

See also open() and error().

Upstream PySide2 reference signatures (binding differences may apply):

waitForOpened(self, msecs: int=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html#waitForOpened