• PySide 模块
  • PySide.QtNetwork
  • 内容表

    上一话题

    QNetworkInterface

    下一话题

    QHostAddress

    QNetworkAddressEntry

    概要

    函数

    详细描述

    PySide.QtNetwork.QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address.

    每个网络接口可以包含零个或多个 IP 地址,可以依次关联 Netmask (网络掩码) 和/或广播地址 (取决于操作系统是否支持)。

    此类表示一个这样的组。

    class PySide.QtNetwork. QNetworkAddressEntry
    class PySide.QtNetwork. QNetworkAddressEntry ( other )
    参数: other PySide.QtNetwork.QNetworkAddressEntry

    构造空 PySide.QtNetwork.QNetworkAddressEntry 对象。

    构造 PySide.QtNetwork.QNetworkAddressEntry object that is a copy of the object other .

    PySide.QtNetwork.QNetworkAddressEntry. broadcast ( )
    返回类型: PySide.QtNetwork.QHostAddress

    Returns the broadcast address associated with the IPv4 address and netmask. It can usually be derived from those two by setting to 1 the bits of the IP address where the netmask contains a 0. (In other words, by bitwise-OR'ing the IP address with the inverse of the netmask)

    This member is always empty for IPv6 addresses, since the concept of broadcast has been abandoned in that system in favor of multicast. In particular, the group of hosts corresponding to all the nodes in the local network can be reached by the “all-nodes” special multicast group (address FF02::1).

    PySide.QtNetwork.QNetworkAddressEntry. ip ( )
    返回类型: PySide.QtNetwork.QHostAddress

    This function returns one IPv4 or IPv6 address found, that was found in a network interface.

    PySide.QtNetwork.QNetworkAddressEntry. netmask ( )
    返回类型: PySide.QtNetwork.QHostAddress

    Returns the netmask associated with the IP address. The netmask is expressed in the form of an IP address, such as 255.255.0.0.

    For IPv6 addresses, the prefix length is converted to an address where the number of bits set to 1 is equal to the prefix length. For a prefix length of 64 bits (the most common value), the netmask will be expressed as a PySide.QtNetwork.QHostAddress holding the address FFFF:FFFF:FFFF:FFFF:

    .. seealso::  :meth:`PySide.QtNetwork.QNetworkAddressEntry.setNetmask`  :meth:`PySide.QtNetwork.QNetworkAddressEntry.prefixLength`
    										
    PySide.QtNetwork.QNetworkAddressEntry. __ne__ ( other )
    参数: other PySide.QtNetwork.QNetworkAddressEntry
    返回类型: PySide.QtCore.bool

    Returns true if this network address entry is different from other .

    PySide.QtNetwork.QNetworkAddressEntry. __eq__ ( other )
    参数: other PySide.QtNetwork.QNetworkAddressEntry
    返回类型: PySide.QtCore.bool

    Returns true if this network address entry is the same as other .

    PySide.QtNetwork.QNetworkAddressEntry. prefixLength ( )
    返回类型: PySide.QtCore.int

    Returns the prefix length of this IP address. The prefix length matches the number of bits set to 1 in the netmask (see PySide.QtNetwork.QNetworkAddressEntry.netmask() ). For IPv4 addresses, the value is between 0 and 32. For IPv6 addresses, it's contained between 0 and 128 and is the preferred form of representing addresses.

    This function returns -1 if the prefix length could not be determined (i.e., PySide.QtNetwork.QNetworkAddressEntry.netmask() returns a null QHostAddress()).

    PySide.QtNetwork.QNetworkAddressEntry. setBroadcast ( newBroadcast )
    参数: newBroadcast PySide.QtNetwork.QHostAddress

    Sets the broadcast IP address of this PySide.QtNetwork.QNetworkAddressEntry 对象到 newBroadcast .

    PySide.QtNetwork.QNetworkAddressEntry. setIp ( newIp )
    参数: newIp PySide.QtNetwork.QHostAddress

    Sets the IP address the PySide.QtNetwork.QNetworkAddressEntry object contains to newIp .

    PySide.QtNetwork.QNetworkAddressEntry. setNetmask ( newNetmask )
    参数: newNetmask PySide.QtNetwork.QHostAddress

    Sets the netmask that this PySide.QtNetwork.QNetworkAddressEntry object contains to newNetmask . Setting the netmask also sets the prefix length to match the new netmask.

    PySide.QtNetwork.QNetworkAddressEntry. setPrefixLength ( length )
    参数: length PySide.QtCore.int

    Sets the prefix length of this IP address to length . The value of length must be valid for this type of IP address: between 0 and 32 for IPv4 addresses, between 0 and 128 for IPv6 addresses. Setting to any invalid value is equivalent to setting to -1, which means “no prefix length”.

    Setting the prefix length also sets the netmask (see PySide.QtNetwork.QNetworkAddressEntry.netmask() ).