Skip to content

NetworkAddressEntry

Qt Base Class: QNetworkAddressEntry

Signature: QNetworkAddressEntry(self) -> None QNetworkAddressEntry(self, other: PySide6.QtNetwork.QNetworkAddressEntry) -> None

Base classes

Name Children Inherits
QNetworkAddressEntry
PySide6.QtNetwork
QNetworkAddressEntry(self) -> None

⋔ Inheritance diagram

graph TD
  1473574012448["network.NetworkAddressEntry"]
  1473573771376["QtNetwork.QNetworkAddressEntry"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473573771376 --> 1473574012448
  1473291690208 --> 1473573771376
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QNetworkAddressEntry

Stores one IP address supported by a network interface.

Source code in prettyqt\network\networkaddressentry.py
class NetworkAddressEntry(network.QNetworkAddressEntry):
    """Stores one IP address supported by a network interface."""

    def get_dns_eligibility(self) -> DnsEligibilityStatusStr:
        """Return whether this address is eligible for publication in the DNS.

        Returns:
            DNS eligibility
        """
        return DNS_ELIGIBILITY_STATUS.inverse[self.dnsEligibility()]

    def set_dns_eligibility(
        self,
        status: DnsEligibilityStatusStr
        | network.QNetworkAddressEntry.DnsEligibilityStatus,
    ):
        """Set the DNS eligibility flag for this address to status.

        Args:
            status: DNS eligibility status
        """
        self.setDnsEligibility(DNS_ELIGIBILITY_STATUS.get_enum_value(status))

    def get_ip(self) -> network.HostAddress:
        return network.HostAddress(self.ip())

    def set_ip(self, ip: network.QHostAddress | str):
        self.setIp(network.HostAddress(ip))

    def get_netmask(self) -> network.HostAddress:
        return network.HostAddress(self.netmask())

    def set_netmask(self, netmask: network.QHostAddress | str):
        self.setNetmask(network.HostAddress(netmask))

    def get_preferred_lifetime(self) -> core.DeadlineTimer:
        return core.DeadlineTimer(self.preferredLifetime())

    def get_validity_lifetime(self) -> core.DeadlineTimer:
        return core.DeadlineTimer(self.validityLifetime())

get_dns_eligibility() -> DnsEligibilityStatusStr

Return whether this address is eligible for publication in the DNS.

Source code in prettyqt\network\networkaddressentry.py
def get_dns_eligibility(self) -> DnsEligibilityStatusStr:
    """Return whether this address is eligible for publication in the DNS.

    Returns:
        DNS eligibility
    """
    return DNS_ELIGIBILITY_STATUS.inverse[self.dnsEligibility()]

set_dns_eligibility(status: DnsEligibilityStatusStr | network.QNetworkAddressEntry.DnsEligibilityStatus)

Set the DNS eligibility flag for this address to status.

Parameters:

Name Type Description Default
status DnsEligibilityStatusStr | DnsEligibilityStatus

DNS eligibility status

required
Source code in prettyqt\network\networkaddressentry.py
def set_dns_eligibility(
    self,
    status: DnsEligibilityStatusStr
    | network.QNetworkAddressEntry.DnsEligibilityStatus,
):
    """Set the DNS eligibility flag for this address to status.

    Args:
        status: DNS eligibility status
    """
    self.setDnsEligibility(DNS_ELIGIBILITY_STATUS.get_enum_value(status))