diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sensors/accelbubble/android/AndroidManifest.xml | 8 | ||||
-rw-r--r-- | examples/sensors/grue/lib/lib.pri | 3 | ||||
-rw-r--r-- | examples/sensors/grue/lib/lib.pro | 1 | ||||
-rw-r--r-- | examples/sensors/maze/android/AndroidManifest.xml | 8 | ||||
-rw-r--r-- | examples/sensors/sensor_explorer/import/explorer.cpp | 2 | ||||
-rw-r--r-- | examples/sensors/sensor_explorer/import/import.pro | 1 | ||||
-rw-r--r-- | examples/sensors/sensor_explorer/import/main.cpp | 28 | ||||
-rw-r--r-- | examples/sensors/sensor_explorer/import/main.h | 64 | ||||
-rw-r--r-- | examples/sensors/sensor_explorer/import/sensoritem.cpp | 2 |
9 files changed, 85 insertions, 32 deletions
diff --git a/examples/sensors/accelbubble/android/AndroidManifest.xml b/examples/sensors/accelbubble/android/AndroidManifest.xml index 4627978e..5229333f 100644 --- a/examples/sensors/accelbubble/android/AndroidManifest.xml +++ b/examples/sensors/accelbubble/android/AndroidManifest.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> - <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --"> - <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTop"> + <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:allowBackup="true" android:fullBackupOnly="false"> + <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTop" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> @@ -18,12 +18,10 @@ <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> <!-- Deploy Qt libs as part of package --> <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> - <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> - <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> <!-- Run with local libs --> <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> - <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> + <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/> <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> <!-- Used to specify custom system library path to run with local system libs --> diff --git a/examples/sensors/grue/lib/lib.pri b/examples/sensors/grue/lib/lib.pri index 0e3da252..675914bc 100644 --- a/examples/sensors/grue/lib/lib.pri +++ b/examples/sensors/grue/lib/lib.pri @@ -3,4 +3,5 @@ INCLUDEPATH += $$PWD macos: LIBS += -L$$OUT_PWD/../grue_app.app/Contents/Frameworks else: LIBS += -L$$OUT_PWD/.. -LIBS += -lgruesensor +android: LIBS += -lgruesensor_$${QT_ARCH} +else: LIBS += -lgruesensor diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro index cc10e5c4..197d91c8 100644 --- a/examples/sensors/grue/lib/lib.pro +++ b/examples/sensors/grue/lib/lib.pro @@ -1,5 +1,6 @@ TEMPLATE = lib TARGET = gruesensor +android: TARGET = gruesensor_$${QT_ARCH} macos: DESTDIR = ../grue_app.app/Contents/Frameworks else: DESTDIR = $$OUT_PWD/.. diff --git a/examples/sensors/maze/android/AndroidManifest.xml b/examples/sensors/maze/android/AndroidManifest.xml index bfb126a6..ea72572f 100644 --- a/examples/sensors/maze/android/AndroidManifest.xml +++ b/examples/sensors/maze/android/AndroidManifest.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> - <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --"> - <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTop"> + <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:allowBackup="true" android:fullBackupOnly="false"> + <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTop" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> @@ -13,12 +13,10 @@ <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> <!-- Deploy Qt libs as part of package --> <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> - <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> - <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> <!-- Run with local libs --> <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> - <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> + <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/> <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> <!-- Messages maps --> diff --git a/examples/sensors/sensor_explorer/import/explorer.cpp b/examples/sensors/sensor_explorer/import/explorer.cpp index 4773ee18..0665a98f 100644 --- a/examples/sensors/sensor_explorer/import/explorer.cpp +++ b/examples/sensors/sensor_explorer/import/explorer.cpp @@ -117,7 +117,7 @@ void QSensorExplorer::loadSensors() */ QQmlListProperty<QSensorItem> QSensorExplorer::availableSensors() { - return QQmlListProperty<QSensorItem>(this,_availableSensors); + return QQmlListProperty<QSensorItem>(this, &_availableSensors); } /* diff --git a/examples/sensors/sensor_explorer/import/import.pro b/examples/sensors/sensor_explorer/import/import.pro index 49a437e8..48509214 100644 --- a/examples/sensors/sensor_explorer/import/import.pro +++ b/examples/sensors/sensor_explorer/import/import.pro @@ -15,6 +15,7 @@ SOURCES = \ propertyinfo.cpp HEADERS = \ + main.h \ explorer.h \ sensoritem.h \ propertyinfo.h diff --git a/examples/sensors/sensor_explorer/import/main.cpp b/examples/sensors/sensor_explorer/import/main.cpp index b43ea339..4199b2f4 100644 --- a/examples/sensors/sensor_explorer/import/main.cpp +++ b/examples/sensors/sensor_explorer/import/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtSensors module of the Qt Toolkit. @@ -48,28 +48,18 @@ ** ****************************************************************************/ -#include <QtQml/QQmlExtensionPlugin> -#include <QtQml/QtQml> +#include "main.h" #include "explorer.h" -#include <QtCore/QDebug> QT_BEGIN_NAMESPACE -class SensorExplorerDeclarativeModule : public QQmlExtensionPlugin +void SensorExplorerDeclarativeModule::registerTypes(const char *uri) { - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid FILE "import.json") -public: - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("Explorer")); - // @uri Explorer - qmlRegisterType<QSensorExplorer>(uri, 1, 0, "SensorExplorer"); - qmlRegisterType<QSensorItem>(uri, 1, 0, "SensorItem"); - qmlRegisterType<QPropertyInfo>(uri, 1, 0, "PropertyInfo"); - } -}; + Q_ASSERT(QLatin1String(uri) == QLatin1String("Explorer")); + // @uri Explorer + qmlRegisterType<QSensorExplorer>(uri, 1, 0, "SensorExplorer"); + qmlRegisterType<QSensorItem>(uri, 1, 0, "SensorItem"); + qmlRegisterType<QPropertyInfo>(uri, 1, 0, "PropertyInfo"); +} QT_END_NAMESPACE - -#include "main.moc" diff --git a/examples/sensors/sensor_explorer/import/main.h b/examples/sensors/sensor_explorer/import/main.h new file mode 100644 index 00000000..6964bec6 --- /dev/null +++ b/examples/sensors/sensor_explorer/import/main.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtSensors module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtQml/QQmlExtensionPlugin> +#include <QtQml/QtQml> + +QT_BEGIN_NAMESPACE + +class SensorExplorerDeclarativeModule : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid FILE "import.json") +public: + void registerTypes(const char *uri) override; +}; + +QT_END_NAMESPACE diff --git a/examples/sensors/sensor_explorer/import/sensoritem.cpp b/examples/sensors/sensor_explorer/import/sensoritem.cpp index 88b5fa7c..f268db3a 100644 --- a/examples/sensors/sensor_explorer/import/sensoritem.cpp +++ b/examples/sensors/sensor_explorer/import/sensoritem.cpp @@ -325,7 +325,7 @@ QQmlListProperty<QPropertyInfo> QSensorItem::properties() _properties.clear(); _properties.append(_sensorProperties); _properties.append(_readerProperties); - return QQmlListProperty<QPropertyInfo> (this, _properties); + return QQmlListProperty<QPropertyInfo> (this, &_properties); } QT_END_NAMESPACE |