diff options
author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-03-02 13:10:49 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-05-19 16:31:15 +0200 |
commit | 5580b0a273a2a7967bafbd3a065b43ed0463e214 (patch) | |
tree | 5c167924893ba6eafc703d552e692f2bda457366 | |
parent | 544bba22070ccb9e13320e252ecebf31c34d1b8d (diff) |
Add initial Support for QtBluetooth
Task-number: PYSIDE-1570
Change-Id: I37aa89f31b96caedb0de7343392d5e530239ed8e
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | sources/cmake_helpers/helpers.cmake | 3 | ||||
-rw-r--r-- | sources/pyside6/PySide6/QtBluetooth/CMakeLists.txt | 53 | ||||
-rw-r--r-- | sources/pyside6/PySide6/QtBluetooth/typesystem_bluetooth.xml | 130 | ||||
-rw-r--r-- | sources/pyside6/tests/QtBluetooth/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sources/pyside6/tests/QtBluetooth/localdevice.py | 49 | ||||
-rw-r--r-- | tools/missing_bindings/config.py | 1 |
6 files changed, 236 insertions, 1 deletions
diff --git a/sources/cmake_helpers/helpers.cmake b/sources/cmake_helpers/helpers.cmake index b80c14bb8..2af3c75ab 100644 --- a/sources/cmake_helpers/helpers.cmake +++ b/sources/cmake_helpers/helpers.cmake @@ -37,7 +37,8 @@ set(ALL_OPTIONAL_MODULES Charts Svg SvgWidgets - DataVisualization) + DataVisualization + Bluetooth) find_package(Qt${QT_MAJOR_VERSION}UiTools) if(Qt${QT_MAJOR_VERSION}UiTools_FOUND) list(APPEND ALL_OPTIONAL_MODULES UiTools) diff --git a/sources/pyside6/PySide6/QtBluetooth/CMakeLists.txt b/sources/pyside6/PySide6/QtBluetooth/CMakeLists.txt new file mode 100644 index 000000000..88db016b6 --- /dev/null +++ b/sources/pyside6/PySide6/QtBluetooth/CMakeLists.txt @@ -0,0 +1,53 @@ +project(QtBluetooth) + +set(QtBluetooth_OPTIONAL_SRC ) +set(QtBluetooth_DROPPED_ENTRIES ) + +set(QtBluetooth_SRC + ${QtBluetooth_GEN_DIR}/qbluetooth_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothaddress_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothdevicediscoveryagent_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothdeviceinfo_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothhostinfo_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothlocaldevice_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothserver_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothservicediscoveryagent_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothserviceinfo_wrapper.cpp + # ${QtBluetooth_GEN_DIR}/qbluetoothserviceinfo_alternative_wrapper.cpp + # ${QtBluetooth_GEN_DIR}/qbluetoothserviceinfo_sequence_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothsocket_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qbluetoothuuid_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergyadvertisingdata_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergyadvertisingparameters_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergyadvertisingparameters_addressinfo_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergycharacteristic_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergycharacteristicdata_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergyconnectionparameters_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergycontroller_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergydescriptor_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergydescriptordata_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergyservice_wrapper.cpp + ${QtBluetooth_GEN_DIR}/qlowenergyservicedata_wrapper.cpp +# module is always needed + ${QtBluetooth_GEN_DIR}/qtbluetooth_module_wrapper.cpp +) + +set(QtBluetooth_include_dirs ${QtBluetooth_SOURCE_DIR} + ${QtBluetooth_BINARY_DIR} + ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} + ${Qt${QT_MAJOR_VERSION}Bluetooth_INCLUDE_DIRS} + ${libpyside_SOURCE_DIR} + ${QtCore_GEN_DIR}) + +set(QtBluetooth_libraries pyside6 + ${Qt${QT_MAJOR_VERSION}Bluetooth_LIBRARIES}) + +set(QtBluetooth_deps QtCore) + +create_pyside_module(NAME QtBluetooth + INCLUDE_DIRS QtBluetooth_include_dirs + LIBRARIES QtBluetooth_libraries + DEPS QtBluetooth_deps + TYPESYSTEM_PATH QtBluetooth_SOURCE_DIR + SOURCES QtBluetooth_SRC + DROPPED_ENTRIES QtBluetooth_DROPPED_ENTRIES) diff --git a/sources/pyside6/PySide6/QtBluetooth/typesystem_bluetooth.xml b/sources/pyside6/PySide6/QtBluetooth/typesystem_bluetooth.xml new file mode 100644 index 000000000..add1c414b --- /dev/null +++ b/sources/pyside6/PySide6/QtBluetooth/typesystem_bluetooth.xml @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide6.QtBluetooth"> + <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> + <namespace-type name="QBluetooth"> + <enum-type name="AttAccessConstraint" flags="AttAccessConstraints"/> + <enum-type name="Security" flags="SecurityFlags"/> + </namespace-type> + <value-type name="QBluetoothAddress"/> + <value-type name="QBluetoothHostInfo"/> + <object-type name="QBluetoothLocalDevice"> + <enum-type name="Error"/> + <enum-type name="HostMode"/> + <enum-type name="Pairing"/> + </object-type> + <object-type name="QBluetoothDeviceDiscoveryAgent"> + <enum-type name="DiscoveryMethod" flags="DiscoveryMethods"/> + <enum-type name="Error"/> + <enum-type name="InquiryType"/> + </object-type> + <value-type name="QBluetoothDeviceInfo"> + <enum-type name="CoreConfiguration" flags="CoreConfigurations"/> + <enum-type name="DataCompleteness"/> + <enum-type name="Field" flags="Fields"/> + <enum-type name="MajorDeviceClass"/> + <enum-type name="MinorAudioVideoClass"/> + <enum-type name="MinorComputerClass"/> + <enum-type name="MinorHealthClass"/> + <enum-type name="MinorImagingClass"/> + <enum-type name="MinorMiscellaneousClass"/> + <enum-type name="MinorNetworkClass"/> + <enum-type name="MinorPeripheralClass"/> + <enum-type name="MinorPhoneClass"/> + <enum-type name="MinorToyClass"/> + <enum-type name="MinorWearableClass"/> + <enum-type name="ServiceClass" flags="ServiceClasses"/> + </value-type> + <object-type name="QBluetoothServiceDiscoveryAgent"> + <enum-type name="DiscoveryMode"/> + <enum-type name="Error"/> + </object-type> + <object-type name="QBluetoothServer"> + <enum-type name="Error"/> + </object-type> + <value-type name="QBluetoothServiceInfo"> + <enum-type name="AttributeId"/> + <enum-type name="Protocol"/> + </value-type> + <object-type name="QBluetoothSocket"> + <enum-type name="SocketError"/> + <enum-type name="SocketState"/> + </object-type> + <value-type name="QBluetoothUuid"> + <enum-type name="CharacteristicType"/> + <enum-type name="DescriptorType"/> + <enum-type name="ProtocolUuid"/> + <enum-type name="ServiceClassUuid"/> + </value-type> + <value-type name="QLowEnergyAdvertisingData"> + <enum-type name="Discoverability"/> + </value-type> + <value-type name="QLowEnergyAdvertisingParameters"> + <value-type name="AddressInfo"/> + <enum-type name="FilterPolicy"/> + <enum-type name="Mode"/> + </value-type> + <object-type name="QLowEnergyCharacteristic"> + <enum-type name="PropertyType" flags="PropertyTypes"/> + </object-type> + <object-type name="QLowEnergyCharacteristicData"/> + <value-type name="QLowEnergyConnectionParameters"/> + <object-type name="QLowEnergyController"> + <enum-type name="ControllerState"/> + <enum-type name="Error"/> + <enum-type name="RemoteAddressType"/> + <enum-type name="Role"/> + </object-type> + <object-type name="QLowEnergyDescriptor"> + </object-type> + <object-type name="QLowEnergyDescriptorData"> + </object-type> + <object-type name="QLowEnergyService"> + <enum-type name="ServiceError"/> + <enum-type name="ServiceState"/> + <enum-type name="ServiceType" flags="ServiceTypes"/> + <enum-type name="WriteMode"/> + </object-type> + <value-type name="QLowEnergyServiceData"> + <enum-type name="ServiceType"/> + </value-type> +</typesystem> diff --git a/sources/pyside6/tests/QtBluetooth/CMakeLists.txt b/sources/pyside6/tests/QtBluetooth/CMakeLists.txt new file mode 100644 index 000000000..d68aec0a5 --- /dev/null +++ b/sources/pyside6/tests/QtBluetooth/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(localdevice.py) diff --git a/sources/pyside6/tests/QtBluetooth/localdevice.py b/sources/pyside6/tests/QtBluetooth/localdevice.py new file mode 100644 index 000000000..29872315d --- /dev/null +++ b/sources/pyside6/tests/QtBluetooth/localdevice.py @@ -0,0 +1,49 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2021 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of Qt for Python. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QBluetoothLocalDevice''' + +import os +import sys +import unittest + +from pathlib import Path +sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) +from init_paths import init_test_paths +init_test_paths(False) + +from PySide6.QtBluetooth import QBluetoothLocalDevice + +class QBluetoothLocalDeviceTest(unittest.TestCase): + def testInitialization(self): + device = QBluetoothLocalDevice() + +if __name__ == '__main__': + unittest.main() diff --git a/tools/missing_bindings/config.py b/tools/missing_bindings/config.py index 23a733463..3419dfdb1 100644 --- a/tools/missing_bindings/config.py +++ b/tools/missing_bindings/config.py @@ -77,6 +77,7 @@ modules_to_test = { #'QtDataVisualization': 'qtdatavisualization-module.html', # 6.2 + 'QtBluetooth': 'qtbluetooth-module.html', #'QtPositioning': 'qtpositioning-module.html', #'QtMultimedia': 'qtmultimedia-module.html', #'QtRemoteObjects': 'qtremoteobjects-module.html', |