Skip to content

BluetoothPermission

Base classes

Name Children Inherits
QBluetoothPermission
PySide6.QtCore
QBluetoothPermission(self, /) -> None

⋔ Inheritance diagram

graph TD
  2170898932["core.BluetoothPermission"]
  1648736680["QtCore.QBluetoothPermission"]
  37984305["Shiboken.Object"]
  2751680898["builtins.object"]
  1648736680 --> 2170898932
  37984305 --> 1648736680
  2751680898 --> 37984305

🛈 DocStrings

Bases: QBluetoothPermission

Access Bluetooth peripherals.

Source code in prettyqt/core/bluetoothpermission.py
class BluetoothPermission(QtCore.QBluetoothPermission):
    """Access Bluetooth peripherals."""

    def set_communication_modes(
        self,
        modes: CommunicationModeStr | QtCore.QBluetoothPermission.CommunicationMode,
    ):
        """Set the Bluetooth communication modes.

        Args:
            modes: communication modes to set
        """
        self.setCommunicationModes(COMMUNICATION_MODE.get_enum_value(modes))

    def get_communication_modes(self) -> list[CommunicationModeStr]:
        """Return the active Bluetooth communication modes.

        Returns:
            list of communication modes
        """
        modes = self.communicationModes()
        return [k for k, v in COMMUNICATION_MODE.items() if v.value & modes.value]

get_communication_modes() -> list[CommunicationModeStr]

Return the active Bluetooth communication modes.

Source code in prettyqt/core/bluetoothpermission.py
def get_communication_modes(self) -> list[CommunicationModeStr]:
    """Return the active Bluetooth communication modes.

    Returns:
        list of communication modes
    """
    modes = self.communicationModes()
    return [k for k, v in COMMUNICATION_MODE.items() if v.value & modes.value]

set_communication_modes(modes: CommunicationModeStr | QtCore.QBluetoothPermission.CommunicationMode)

Set the Bluetooth communication modes.

Parameters:

Name Type Description Default
modes CommunicationModeStr | CommunicationMode

communication modes to set

required
Source code in prettyqt/core/bluetoothpermission.py
def set_communication_modes(
    self,
    modes: CommunicationModeStr | QtCore.QBluetoothPermission.CommunicationMode,
):
    """Set the Bluetooth communication modes.

    Args:
        modes: communication modes to set
    """
    self.setCommunicationModes(COMMUNICATION_MODE.get_enum_value(modes))

:fa-brands-github: Show source on GitHub