From b6618e767f69ee3ff3bab8b5b15925ad6fab2b20 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Fri, 17 Feb 2023 11:33:30 +0200 Subject: Remove sensors accelbubble example The example is a simple QML accelerometer example, originally introduced as a tutorial for creating Android QML applications, and more importantly superseded by the somewhat recent sensorsshowcase example. Task-number: QTBUG-110939 Pick-to: 6.5 Change-Id: I70b37fcf8e876dd6dba102612ca1421f65802d9a Reviewed-by: Lorn Potter --- examples/sensors/CMakeLists.txt | 1 - examples/sensors/accelbubble/CMakeLists.txt | 64 --------------- examples/sensors/accelbubble/Info.plist | 34 -------- examples/sensors/accelbubble/accelbubble.pro | 28 ------- examples/sensors/accelbubble/accelbubble.qml | 86 --------------------- examples/sensors/accelbubble/accelbubble.qrc | 6 -- .../accelbubble/android/AndroidManifest.xml | 47 ----------- .../sensors/accelbubble/content/Bluebubble.svg | 10 --- .../sensors/accelbubble/doc/images/accelbubble.png | Bin 5025 -> 0 bytes .../sensors/accelbubble/doc/src/accelbubble.qdoc | 32 -------- examples/sensors/accelbubble/main.cpp | 14 ---- examples/sensors/sensors.pro | 3 - 12 files changed, 325 deletions(-) delete mode 100644 examples/sensors/accelbubble/CMakeLists.txt delete mode 100644 examples/sensors/accelbubble/Info.plist delete mode 100644 examples/sensors/accelbubble/accelbubble.pro delete mode 100644 examples/sensors/accelbubble/accelbubble.qml delete mode 100644 examples/sensors/accelbubble/accelbubble.qrc delete mode 100644 examples/sensors/accelbubble/android/AndroidManifest.xml delete mode 100644 examples/sensors/accelbubble/content/Bluebubble.svg delete mode 100644 examples/sensors/accelbubble/doc/images/accelbubble.png delete mode 100644 examples/sensors/accelbubble/doc/src/accelbubble.qdoc delete mode 100644 examples/sensors/accelbubble/main.cpp diff --git a/examples/sensors/CMakeLists.txt b/examples/sensors/CMakeLists.txt index f1b382a..69582c3 100644 --- a/examples/sensors/CMakeLists.txt +++ b/examples/sensors/CMakeLists.txt @@ -7,7 +7,6 @@ if(TARGET Qt::Quick) qt_internal_add_example(qmlqtsensors) qt_internal_add_example(sensor_explorer) if(TARGET Qt::Svg) - qt_internal_add_example(accelbubble) qt_internal_add_example(sensorsshowcase) endif() endif() diff --git a/examples/sensors/accelbubble/CMakeLists.txt b/examples/sensors/accelbubble/CMakeLists.txt deleted file mode 100644 index b5d6507..0000000 --- a/examples/sensors/accelbubble/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) -project(accelbubble LANGUAGES CXX) - -set(CMAKE_AUTOMOC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/accelbubble") - -find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Sensors Svg Xml) - -qt_add_executable(accelbubble - main.cpp -) - -set_target_properties(accelbubble PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) - -if(ANDROID) - set_property(TARGET accelbubble PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR - ${CMAKE_CURRENT_SOURCE_DIR}/android) - endif() -if(APPLE) - if(IOS) - set_property(TARGET accelbubble PROPERTY - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" - ) - endif() -endif() - -target_link_libraries(accelbubble PUBLIC - Qt::Core - Qt::Gui - Qt::Quick - Qt::Sensors - Qt::Svg - Qt::Xml -) - -# Resources: -set(accelbubble_resource_files - "accelbubble.qml" - "content/Bluebubble.svg" -) - -qt6_add_resources(accelbubble "accelbubble" - PREFIX - "/" - FILES - ${accelbubble_resource_files} -) - -install(TARGETS accelbubble - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/sensors/accelbubble/Info.plist b/examples/sensors/accelbubble/Info.plist deleted file mode 100644 index 9072545..0000000 --- a/examples/sensors/accelbubble/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDisplayName - accelbubble - CFBundleExecutable - accelbubble - CFBundleGetInfoString - Created by Qt/QMake - CFBundleIdentifier - com.digia.accelbubble - CFBundleName - accelbubble - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NOTE - This file was generated by Qt/QMake. - UILaunchStoryboardName - LaunchScreen - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro deleted file mode 100644 index d3b20a9..0000000 --- a/examples/sensors/accelbubble/accelbubble.pro +++ /dev/null @@ -1,28 +0,0 @@ -TEMPLATE = app -TARGET = accelbubble -QT += quick sensors svg xml -SOURCES = main.cpp - -RESOURCES += \ - accelbubble.qrc - -OTHER_FILES = \ - $$files(*.qml) \ - content \ - images \ - android/AndroidManifest.xml - -target.path = $$[QT_INSTALL_EXAMPLES]/sensors/accelbubble -INSTALLS += target - -ios { -QMAKE_INFO_PLIST = Info.plist - -# manual plugin loading needed with older Qt -# QTPLUGIN += qsvg qtsensors_ios qtsensors_generic -} - -ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android - -EXAMPLE_FILES += \ - Info.plist diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml deleted file mode 100644 index 6590116..0000000 --- a/examples/sensors/accelbubble/accelbubble.qml +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - -import QtQuick -import QtQuick.Controls - -//! [0] -import QtSensors -//! [0] - - -ApplicationWindow { - title: "Accelerate Bubble" - id: mainWindow - width: 320 - height: 480 - visible: true - readonly property double radians_to_degrees: 180 / Math.PI - -//! [1] - Accelerometer { - id: accel - dataRate: 100 -//! [1] -//! [2] - active:true -//! [2] - -//! [3] - onReadingChanged: { - var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * .1) - var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * .1) - - if (isNaN(newX) || isNaN(newY)) - return; - - if (newX < 0) - newX = 0 - - if (newX > mainWindow.width - bubble.width) - newX = mainWindow.width - bubble.width - - if (newY < 18) - newY = 18 - - if (newY > mainWindow.height - bubble.height) - newY = mainWindow.height - bubble.height - - bubble.x = newX - bubble.y = newY - } -//! [3] - } - - function calcPitch(x,y,z) { - return -Math.atan2(y, Math.hypot(x, z)) * mainWindow.radians_to_degrees; - } - function calcRoll(x,y,z) { - return -Math.atan2(x, Math.hypot(y, z)) * mainWindow.radians_to_degrees; - } - - Image { - id: bubble - source: "content/Bluebubble.svg" - smooth: true - property real centerX: mainWindow.width / 2 - property real centerY: mainWindow.height / 2 - property real bubbleCenter: bubble.width / 2 - x: centerX - bubbleCenter - y: centerY - bubbleCenter - - Behavior on y { - SmoothedAnimation { - easing.type: Easing.Linear - duration: 100 - } - } - Behavior on x { - SmoothedAnimation { - easing.type: Easing.Linear - duration: 100 - } - } - } -} diff --git a/examples/sensors/accelbubble/accelbubble.qrc b/examples/sensors/accelbubble/accelbubble.qrc deleted file mode 100644 index 5cb6945..0000000 --- a/examples/sensors/accelbubble/accelbubble.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - accelbubble.qml - content/Bluebubble.svg - - diff --git a/examples/sensors/accelbubble/android/AndroidManifest.xml b/examples/sensors/accelbubble/android/AndroidManifest.xml deleted file mode 100644 index 537c705..0000000 --- a/examples/sensors/accelbubble/android/AndroidManifest.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/sensors/accelbubble/content/Bluebubble.svg b/examples/sensors/accelbubble/content/Bluebubble.svg deleted file mode 100644 index d9c406c..0000000 --- a/examples/sensors/accelbubble/content/Bluebubble.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/examples/sensors/accelbubble/doc/images/accelbubble.png b/examples/sensors/accelbubble/doc/images/accelbubble.png deleted file mode 100644 index ad4cfc0..0000000 Binary files a/examples/sensors/accelbubble/doc/images/accelbubble.png and /dev/null differ diff --git a/examples/sensors/accelbubble/doc/src/accelbubble.qdoc b/examples/sensors/accelbubble/doc/src/accelbubble.qdoc deleted file mode 100644 index 527d82f..0000000 --- a/examples/sensors/accelbubble/doc/src/accelbubble.qdoc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example accelbubble - \title Qt Sensors - Accel Bubble - \brief The AccelBubble example demonstrates the Accelerometer QML type. - \ingroup qtsensors-examples - - \image accelbubble.png - -\section1 Overview - Writing a QML application that uses the Accelerometer QML sensors type requires the following steps: - - Import the Sensors Declarative module. - -\snippet accelbubble/accelbubble.qml 0 - - Add an Accelerometer QML type. - -\snippet accelbubble/accelbubble.qml 1 - - Use the 'active' property to start the sensor - -\snippet accelbubble/accelbubble.qml 2 - - Move the bubble according to a factor of the accelerator sensor - -\snippet accelbubble/accelbubble.qml 3 - -*/ - diff --git a/examples/sensors/accelbubble/main.cpp b/examples/sensors/accelbubble/main.cpp deleted file mode 100644 index ad71fc0..0000000 --- a/examples/sensors/accelbubble/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - -#include -#include - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc,argv); - QQmlApplicationEngine engine(QUrl("qrc:///accelbubble.qml")); - - return app.exec(); -} diff --git a/examples/sensors/sensors.pro b/examples/sensors/sensors.pro index 1b637ba..77a9529 100644 --- a/examples/sensors/sensors.pro +++ b/examples/sensors/sensors.pro @@ -7,9 +7,6 @@ qtHaveModule(quick) { maze \ qmlqtsensors \ sensor_explorer - - qtHaveModule(svg): SUBDIRS += \ - accelbubble } EXAMPLE_FILES += \ -- cgit v1.2.1