summaryrefslogtreecommitdiffstats
path: root/examples/sensors
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@qt.io>2023-02-17 11:33:30 +0200
committerJuha Vuolle <juha.vuolle@qt.io>2023-02-22 08:37:49 +0200
commitb6618e767f69ee3ff3bab8b5b15925ad6fab2b20 (patch)
tree4917af2695ef78b935a4f863d93d9f8761c7233a /examples/sensors
parentc6b56a7b4ba0e0f52bf9a824518b12b76928c5c7 (diff)
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 <lorn.potter@gmail.com>
Diffstat (limited to 'examples/sensors')
-rw-r--r--examples/sensors/CMakeLists.txt1
-rw-r--r--examples/sensors/accelbubble/CMakeLists.txt64
-rw-r--r--examples/sensors/accelbubble/Info.plist34
-rw-r--r--examples/sensors/accelbubble/accelbubble.pro28
-rw-r--r--examples/sensors/accelbubble/accelbubble.qml86
-rw-r--r--examples/sensors/accelbubble/accelbubble.qrc6
-rw-r--r--examples/sensors/accelbubble/android/AndroidManifest.xml47
-rw-r--r--examples/sensors/accelbubble/content/Bluebubble.svg10
-rw-r--r--examples/sensors/accelbubble/doc/images/accelbubble.pngbin5025 -> 0 bytes
-rw-r--r--examples/sensors/accelbubble/doc/src/accelbubble.qdoc32
-rw-r--r--examples/sensors/accelbubble/main.cpp14
-rw-r--r--examples/sensors/sensors.pro3
12 files changed, 0 insertions, 325 deletions
diff --git a/examples/sensors/CMakeLists.txt b/examples/sensors/CMakeLists.txt
index f1b382a6..69582c33 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 b5d6507a..00000000
--- 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 90725455..00000000
--- a/examples/sensors/accelbubble/Info.plist
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDisplayName</key>
- <string>accelbubble</string>
- <key>CFBundleExecutable</key>
- <string>accelbubble</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
- <key>CFBundleIdentifier</key>
- <string>com.digia.accelbubble</string>
- <key>CFBundleName</key>
- <string>accelbubble</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>NOTE</key>
- <string>This file was generated by Qt/QMake.</string>
- <key>UILaunchStoryboardName</key>
- <string>LaunchScreen</string>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- </array>
-</dict>
-</plist>
diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro
deleted file mode 100644
index d3b20a9d..00000000
--- 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 65901169..00000000
--- 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 5cb6945a..00000000
--- a/examples/sensors/accelbubble/accelbubble.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>accelbubble.qml</file>
- <file>content/Bluebubble.svg</file>
- </qresource>
-</RCC>
diff --git a/examples/sensors/accelbubble/android/AndroidManifest.xml b/examples/sensors/accelbubble/android/AndroidManifest.xml
deleted file mode 100644
index 537c705e..00000000
--- a/examples/sensors/accelbubble/android/AndroidManifest.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.qtproject.example.accelbubble"
- android:installLocation="auto"
- android:versionCode="1"
- android:versionName="1.0">
- <!-- The comment below will be replaced with dependencies permissions upon deployment.
- Remove the comment if you do not require these default permissions. -->
- <!-- %%INSERT_PERMISSIONS -->
-
- <!-- The comment below will be replaced with dependencies permissions upon deployment.
- Remove the comment if you do not require these default features. -->
- <!-- %%INSERT_FEATURES -->
-
- <supports-screens
- android:anyDensity="true"
- android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="true" />
- <application
- android:name="org.qtproject.qt.android.bindings.QtApplication"
- android:extractNativeLibs="true"
- android:hardwareAccelerated="true"
- android:label="-- %%INSERT_APP_NAME%% --"
- android:requestLegacyExternalStorage="true">
- <activity
- android:name="org.qtproject.qt.android.bindings.QtActivity"
- android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
- android:label="-- %%INSERT_APP_NAME%% --"
- android:launchMode="singleTop"
- android:screenOrientation="portrait">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- <meta-data
- android:name="android.app.lib_name"
- android:value="-- %%INSERT_APP_LIB_NAME%% --" />
- <meta-data
- android:name="android.app.background_running"
- android:value="false" />
- <meta-data
- android:name="android.app.extract_android_style"
- android:value="minimal" />
- </activity>
- </application>
-</manifest>
diff --git a/examples/sensors/accelbubble/content/Bluebubble.svg b/examples/sensors/accelbubble/content/Bluebubble.svg
deleted file mode 100644
index d9c406c4..00000000
--- a/examples/sensors/accelbubble/content/Bluebubble.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny">
- <defs>
- <radialGradient id="grad1" cx="0.5" cy="0.7" r="0.7" fx="0.5" fy="0.4">
- <stop offset="0" style="stop-color:rgb(255,255,255)" />
- <stop offset="1.5" style="stop-color:rgb(0,102,153)" />
- </radialGradient>
- </defs>
- <circle cx="100" cy="80" r="42" fill="url(#grad1)"/>
-</svg>
diff --git a/examples/sensors/accelbubble/doc/images/accelbubble.png b/examples/sensors/accelbubble/doc/images/accelbubble.png
deleted file mode 100644
index ad4cfc07..00000000
--- a/examples/sensors/accelbubble/doc/images/accelbubble.png
+++ /dev/null
Binary files differ
diff --git a/examples/sensors/accelbubble/doc/src/accelbubble.qdoc b/examples/sensors/accelbubble/doc/src/accelbubble.qdoc
deleted file mode 100644
index 527d82fb..00000000
--- 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 ad71fc00..00000000
--- 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 <QtGui/QGuiApplication>
-#include <QtQml/QQmlApplicationEngine>
-
-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 1b637bac..77a95296 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 += \