diff options
Diffstat (limited to 'src/imports/bluetooth/plugin.cpp')
-rw-r--r-- | src/imports/bluetooth/plugin.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/imports/bluetooth/plugin.cpp b/src/imports/bluetooth/plugin.cpp index 9d3b816f..2311d6b8 100644 --- a/src/imports/bluetooth/plugin.cpp +++ b/src/imports/bluetooth/plugin.cpp @@ -56,13 +56,25 @@ class QBluetoothQmlPlugin : public QQmlExtensionPlugin public: void registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("QtBluetooth")); + // @uri QtBluetooth + + Q_ASSERT(uri == QStringLiteral("QtBluetooth")); int major = 5; int minor = 0; - qmlRegisterType<QDeclarativeBluetoothDiscoveryModel>(uri, major, minor, "BluetoothDiscoveryModel"); - qmlRegisterType<QDeclarativeBluetoothService>(uri, major, minor, "BluetoothService"); - qmlRegisterType<QDeclarativeBluetoothSocket>(uri, major, minor, "BluetoothSocket"); + + // Register the 5.0 types + //5.0 is silent and not advertised + qmlRegisterType<QDeclarativeBluetoothDiscoveryModel >(uri, major, minor, "BluetoothDiscoveryModel"); + qmlRegisterType<QDeclarativeBluetoothService >(uri, major, minor, "BluetoothService"); + qmlRegisterType<QDeclarativeBluetoothSocket >(uri, major, minor, "BluetoothSocket"); + + // Register the 5.2 types + minor = 2; + qmlRegisterType<QDeclarativeBluetoothDiscoveryModel >(uri, major, minor, "BluetoothDiscoveryModel"); + qmlRegisterType<QDeclarativeBluetoothService >(uri, major, minor, "BluetoothService"); + qmlRegisterType<QDeclarativeBluetoothSocket >(uri, major, minor, "BluetoothSocket"); + } }; |