summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--doc/src/platforms/emb-linux.qdoc84
-rw-r--r--doc/src/qmlapp/deployment.qdoc18
-rw-r--r--doc/src/qmlapp/qtquicktest.qdoc133
-rw-r--r--doc/src/qtmodules.qdoc26
-rw-r--r--doc/src/snippets/qtcluster/designerImports/ClusterDemo/plugin.cpp4
-rw-r--r--doc/src/snippets/qtcluster/hybridimages.qrc3
-rw-r--r--doc/src/snippets/qtcluster/hybridqml.qrc9
-rw-r--r--doc/src/snippets/qtcluster/images/BottomPanel.pngbin8335 -> 40489 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/Cluster8Gauges.pngbin195629 -> 229387 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/Icon_TurnLeft_OFF_small.pngbin232 -> 414 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/Icon_TurnLeft_ON_small.pngbin880 -> 1111 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/SpeedometerNeedle.pngbin193 -> 5094 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/SpeedometerNeedleGreen.pngbin165 -> 220 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/SpeedometerNeedleSmall.pngbin0 -> 2412 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/center.pngbin15987 -> 25610 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/greenglow.pngbin20072 -> 19688 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/knob.pngbin4941 -> 24783 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/knob_small.pngbin0 -> 17989 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/left.pngbin21956 -> 26445 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/leftgauge.pngbin52418 -> 90077 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/right.pngbin21655 -> 26714 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/rightgauge.pngbin52681 -> 111758 bytes
-rw-r--r--doc/src/snippets/qtcluster/images/temperature.pngbin21949 -> 18182 bytes
-rw-r--r--doc/src/snippets/qtcluster/qml/ValueSource.qml4
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/BottomPanel.ui.qml55
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewCarInfo.qml2
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewMusic.qml3
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/Dashboard.qml15
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackground.qml12
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackgroundForm.ui.qml55
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardForm.ui.qml212
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardFrame.qml7
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/Gadget.qml78
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/BatteryMeter.qml72
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/ConsumptionMeter.qml92
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FpsMeter.qml10
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/LargeMeter.qml146
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/NumberLabel.qml9
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SmallMeter.qml (renamed from doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FuelMeter.qml)51
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedoMeter.qml157
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedometerNumbers.qml267
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TachoMeter.qml113
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TemperatureMeter.qml36
-rw-r--r--doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TurboMeter.qml1
-rw-r--r--doc/src/snippets/qtcluster/qtiviclusterdata.h2
-rw-r--r--doc/src/snippets/qtcluster/scenehelper.cpp2
47 files changed, 909 insertions, 771 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 0338efe07..dc68d3884 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,3 +1,3 @@
load(qt_build_config)
-MODULE_VERSION = 5.10.1
+MODULE_VERSION = 5.11.0
diff --git a/doc/src/platforms/emb-linux.qdoc b/doc/src/platforms/emb-linux.qdoc
index 203cc9b29..c234eb283 100644
--- a/doc/src/platforms/emb-linux.qdoc
+++ b/doc/src/platforms/emb-linux.qdoc
@@ -658,7 +658,14 @@
When \c mode is not defined, the mode that is reported as preferred by the
system is chosen. The accepted values for \c mode are: \c off, \c current,
- \c preferred, width\c{x}height, or a modeline string.
+ \c preferred, width\c{x}height, width\c{x}height\c{@}vrefresh, or a modeline
+ string.
+
+ Specifying \c current will choose a mode with a resolution matching the
+ current one. Due to the fact that modesetting is done only when the desired
+ mode is actually different from the active one (unless forced via the
+ \c QT_QPA_EGLFS_ALWAYS_SET_MODE environment variable), this value is useful to
+ keep the current mode and any content in the planes not touched by Qt.
All screens reported by the DRM layer will be treated as one big virtual
desktop by default. The mouse cursor implementation will take this into
@@ -797,6 +804,81 @@
}
\endcode
+ \section2 Advanced eglfs_kms features
+
+ Screen cloning (mirroring) is supported as of Qt 5.11. It can be enabled by
+ the \c clones property:
+
+ \badcode
+ {
+ "device": "/dev/dri/card0",
+ "outputs": [
+ { "name": "HDMI1", "mode": "1920x1080" },
+ { "name": "DP1", "mode": "1920x1080", "clones": "HDMI1" }
+ ]
+ }
+ \endcode
+
+ Here the content on the display connected via DisplayPort will be the same as
+ on the HDMI one. This is ensured by simply scanning out the same buffer on
+ both.
+
+ \note This can only work if the resolutions are the same, there are no
+ incompatibilities when it comes to accepted buffer formats, and the
+ application does not have any output on the QScreen associated with a clone
+ destination. In practice the latter means that no QWindow associated with the
+ QScreen in question - DP1 in the example - must ever perform a
+ QOpenGLContext::swapBuffers() operation. It is up to the configuration and the
+ application to ensure these.
+
+ Headless mode via DRM render nodes is supported as of Qt 5.11. This allows
+ performing GPU compute (OpenGL compute shaders, OpenCL) or offscreen OpenGL
+ rendering without needing DRM master privileges. In this mode applications can
+ function even when there is already another process outputting to the screen.
+
+ Just switching \c device from \c{/dev/dri/card0} to \c{/dev/dri/renderD128} is
+ futile on its own since there are a number of operations that cannot be
+ performed in headless mode. Therefore, this must be combined with a
+ \c headless property, for example:
+
+ \badcode
+ {
+ "device": "/dev/dri/renderD128",
+ "headless": "1024x768"
+ }
+ \endcode
+
+ Keep in mind that windows are still sized to match the - now virtual -
+ screen size, hence the need for specifying a size in the \c headless
+ property. There is also a lack of vsync-based throttling.
+
+ Once enabled, applications have two typical choices to perform offscreen
+ rendering in headless mode:
+
+ Use an ordinary window, such as a QOpenGLWindow subclass, targeting the
+ window's default framebuffer, meaning a \c{gbm_surface} in practice:
+
+ \badcode
+ MyOpenGLWindow w;
+ w.show(); // will not actually show up on screen
+ w.grabFramebuffer().save("output.png");
+ \endcode
+
+ Or the typical offscreen approach with an extra FBO:
+
+ \badcode
+ QOffscreenSurface s;
+ s.setFormat(ctx.format());
+ s.create();
+ ctx.makeCurrent(&s);
+ QOpenGLFramebufferObject fbo(1024, 768);
+ fbo.bind();
+ ctx.functions()->glClearColor(1, 0, 0, 1);
+ ctx.functions()->glClear(GL_COLOR_BUFFER_BIT);
+ fbo.toImage().save("output.png");
+ ctx.doneCurrent();
+ \endcode
+
\section2 eglfs with eglfs_kms_egldevice backend
This backend, typically used on Tegra devices, is similar to the KMS/DRM
diff --git a/doc/src/qmlapp/deployment.qdoc b/doc/src/qmlapp/deployment.qdoc
index ee5def6c3..387464267 100644
--- a/doc/src/qmlapp/deployment.qdoc
+++ b/doc/src/qmlapp/deployment.qdoc
@@ -63,10 +63,10 @@ The \l{Downloads}{Qt Installers} install the QML libraries in
\section1 QML Caching
-The QML runtime loads QML documents by parsing them and generating native code.
+The QML runtime loads QML documents by parsing them and generating byte code.
Most of the time the document hasn't changed since the last time it was loaded.
In order to speed up this loading process, the QML runtime maintains a cache
-file for each qml document. This cache file contains the native code and a
+file for each qml document. This cache file contains the byte code and a
binary representation of the QML document structure. In addition, when multiple
applications use the same QML document, the memory needed for the code is
shared between application processes. The cache files are loaded via the \c
@@ -78,6 +78,7 @@ re-created. Cache files are located in the same directory as the source code,
if the directory is writable. Otherwise they will be placed in a sub-directory
of QStandardPaths::CacheLocation with the name "qmlcache". The file extension
is \c .qmlc for QML documents and \c .jsc for imported JavaScript modules.
+On the Android platform, cache files are always stored in the cache directory.
\section1 QML Caching for Deployment (Preview)
@@ -130,17 +131,8 @@ and also installed into the same directory for deployment.
\section2 Limitations
-Currently this feature has some limitations:
-
-\list
-\li Only QML and JavaScript documents that are part of a QML module can be
-compiled ahead of time.
-\li For cross-compilation, only the ARMv7 and ARMv8 target architectures are
-supported.
-\li For native compilation, Ahead-of-Time caching is limited to architectures
-where the QML runtime supports Just-in-Time compilation. This includes x86, x86-64,
-ARMv7, ARMv8 and MIPS32.
-\endlist
+Currently this feature has the limitation that only QML and JavaScript
+documents that are part of a QML module can be compiled ahead of time.
\section1 Prototyping with QML Scene
diff --git a/doc/src/qmlapp/qtquicktest.qdoc b/doc/src/qmlapp/qtquicktest.qdoc
deleted file mode 100644
index 1481dc3d3..000000000
--- a/doc/src/qmlapp/qtquicktest.qdoc
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtquick-qtquicktest.html
- \title Qt Quick Test Reference Documentation
- \brief unit testing framework for QML
-
- \section1 Introduction
-
- \l {Qt Quick Test QML Types}{Qt Quick Test} is a unit test framework for QML applications.
- Test cases are written as JavaScript functions within a \l {QtTest::TestCase}{TestCase}
- type:
-
- \code
- import QtQuick 2.3
- import QtTest 1.0
-
- TestCase {
- name: "MathTests"
-
- function test_math() {
- compare(2 + 2, 4, "2 + 2 = 4")
- }
-
- function test_fail() {
- compare(2 + 2, 5, "2 + 2 = 5")
- }
- }
- \endcode
-
- Functions whose names start with \c{test_} are treated as test cases
- to be executed. See the documentation for the \l {QtTest::TestCase}{TestCase} and
- \l {QtTest::SignalSpy}{SignalSpy} types for more information on writing test cases.
-
- \section1 Running Tests
-
- Test cases are launched by a C++ harness that consists of
- the following code:
-
- \code
- #include <QtQuickTest/quicktest.h>
- QUICK_TEST_MAIN(example)
- \endcode
-
- Where "example" is the identifier to use to uniquely identify
- this set of tests. You should add \c{CONFIG += qmltestcase}.
- for example:
-
- \code
- TEMPLATE = app
- TARGET = tst_example
- CONFIG += warn_on qmltestcase
- SOURCES += tst_example.cpp
- \endcode
-
- The test harness scans the specified source directory recursively
- for "tst_*.qml" files. If \c{QUICK_TEST_SOURCE_DIR} is not defined,
- then the current directory will be scanned when the harness is run.
- Other *.qml files may appear for auxillary QML components that are
- used by the test.
-
- The \c{-input} command-line option can be set at runtime to run
- test cases from a different directory. This may be needed to run
- tests on a target device where the compiled-in directory name refers
- to a host. For example:
-
- \code
- tst_example -input /mnt/SDCard/qmltests
- \endcode
-
- It is also possible to run a single file using the \c{-input} option.
- For example:
-
- \code
- tst_example -input data/test.qml
- \endcode
-
- \code
- tst_example -input <full_path>/test.qml
- \endcode
-
- \note Specifying the full path to the qml test file is for example
- needed for shadow builds.
-
- If your test case needs QML imports, then you can add them as
- \c{-import} options to the test program command-line.
-
- If IMPORTPATH is specified in your .pro file, each import path added to IMPORTPATH
- will be passed as a command-line argument when the test is run using "make check":
-
- \code
- IMPORTPATH += $$PWD/../imports/my_module1 $$PWD/../imports/my_module2
- \endcode
-
- The \c{-functions} command-line option will return a list of the current
- tests functions. It is possible to run a single test function using the name
- of the test function as an argument. For example:
-
- \code
- tst_example Test_Name::function1
- \endcode
-
- The \c{-help} command-line option will return all the options available.
-
- \code
- tst_example -help
- \endcode
-*/
diff --git a/doc/src/qtmodules.qdoc b/doc/src/qtmodules.qdoc
index fc874d5c2..e73fbd778 100644
--- a/doc/src/qtmodules.qdoc
+++ b/doc/src/qtmodules.qdoc
@@ -73,10 +73,10 @@
\li \l[QtQuick]{Qt Quick}
\li A declarative framework for building highly dynamic applications
with custom user interfaces.
- \row
- \li \l[QtQuickControls]{Qt Quick Controls}
- \li Reusable Qt Quick based UI controls to create classic desktop-style
- user interfaces.
+ \row \li \l{Qt Quick Controls 2}
+ \li Provides lightweight QML types for creating performant user
+ interfaces for desktop, embedded, and mobile devices. These
+ types employ a simple styling architecture and are very efficient.
\row
\li \l[QtQuickDialogs]{Qt Quick Dialogs}
\li Types for creating and interacting with system dialogs from a
@@ -86,6 +86,10 @@
\li Layouts are items that are used to arrange Qt Quick 2 based items in
the user interface.
\row
+ \li \l[QtQuickTest]{Qt Quick Test}
+ \li A unit test framework for QML applications, where the test cases
+ are written as JavaScript functions.
+ \row
\li \l[QtSql]{Qt SQL}
\li Classes for database integration using SQL.
\row
@@ -234,14 +238,12 @@
\li \l{Qt for Android}{Android}, \l{Qt for iOS}{iOS}, and
\l{Qt for macOS}{\macos}.
\li Enables in-app purchase of products in Qt applications.
- \row \li \l{Qt Quick Controls 2}
- \li All
- \li
- \li Provides lightweight QML types for creating performant user
- interfaces for embedded and mobile devices. These controls achieve
- improved efficiency by employing a simplified styling architecture
- when compared to \l {Qt Quick Controls}. These types work in conjunction
- with \l{Qt Quick} and \l{Qt Quick Layouts}.
+ \row
+ \li \l[QtQuickControls]{Qt Quick Controls}
+ \li All
+ \li All
+ \li Reusable Qt Quick based UI controls to create classic desktop-style
+ user interfaces.
\row
\li \l[QtQuickExtras]{Qt Quick Extras}
\li All
diff --git a/doc/src/snippets/qtcluster/designerImports/ClusterDemo/plugin.cpp b/doc/src/snippets/qtcluster/designerImports/ClusterDemo/plugin.cpp
index 14e73660f..efc953b45 100644
--- a/doc/src/snippets/qtcluster/designerImports/ClusterDemo/plugin.cpp
+++ b/doc/src/snippets/qtcluster/designerImports/ClusterDemo/plugin.cpp
@@ -52,14 +52,14 @@ class ClusterDemoPlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
ClusterDemoPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) {}
- void registerTypes(const char *) Q_DECL_OVERRIDE
+ void registerTypes(const char *) override
{
qmlRegisterType<CircularIndicator>("ClusterDemo", 1, 0, "CircularIndicator");
qmlRegisterType<Gauge>("ClusterDemo", 1, 0, "GaugeFiller");
qmlRegisterSingletonType(QUrl("qrc:/ValueSource.qml"), "ClusterDemo", 1, 0, "ValueSource");
}
- void initializeEngine(QQmlEngine *engine, const char *uri) Q_DECL_OVERRIDE
+ void initializeEngine(QQmlEngine *engine, const char *uri) override
{
EtcProvider *etcProvider = new EtcProvider();
etcProvider->setBaseUrl(QUrl("qrc:///images/"));
diff --git a/doc/src/snippets/qtcluster/hybridimages.qrc b/doc/src/snippets/qtcluster/hybridimages.qrc
index e14c7604c..77e932a67 100644
--- a/doc/src/snippets/qtcluster/hybridimages.qrc
+++ b/doc/src/snippets/qtcluster/hybridimages.qrc
@@ -14,6 +14,7 @@
<file>images/Icon_TurnLeft_ON_small.png</file>
<file>images/greenglow.png</file>
<file>images/knob.png</file>
+ <file>images/knob_small.png</file>
<file>images/left.png</file>
<file>images/leftgauge.png</file>
<file>images/redglow.png</file>
@@ -21,6 +22,6 @@
<file>images/rightgauge.png</file>
<file>images/temperature.png</file>
<file>images/center.png</file>
- <file>images/SpeedometerNeedleGreen.png</file>
+ <file>images/SpeedometerNeedleSmall.png</file>
</qresource>
</RCC>
diff --git a/doc/src/snippets/qtcluster/hybridqml.qrc b/doc/src/snippets/qtcluster/hybridqml.qrc
index 1e9f7288a..bc82b0184 100644
--- a/doc/src/snippets/qtcluster/hybridqml.qrc
+++ b/doc/src/snippets/qtcluster/hybridqml.qrc
@@ -5,12 +5,7 @@
<file>qml/dash_hybrid/Dashboard.qml</file>
<file>qml/dash_hybrid/DashboardFrame.qml</file>
<file>qml/dash_hybrid/DashboardView.qml</file>
- <file>qml/dash_hybrid/gauges/BatteryMeter.qml</file>
- <file>qml/dash_hybrid/gauges/ConsumptionMeter.qml</file>
<file>qml/dash_hybrid/gauges/FpsMeter.qml</file>
- <file>qml/dash_hybrid/gauges/FuelMeter.qml</file>
- <file>qml/dash_hybrid/gauges/SpeedoMeter.qml</file>
- <file>qml/dash_hybrid/gauges/TachoMeter.qml</file>
<file>qml/dash_hybrid/gauges/TemperatureMeter.qml</file>
<file>qml/dash_hybrid/gauges/TurboMeter.qml</file>
<file>qml/dash_hybrid/CenterViewCalendar.qml</file>
@@ -23,5 +18,9 @@
<file>qml/dash_hybrid/DashboardBackground.qml</file>
<file>qml/dash_hybrid/DashboardBackgroundForm.ui.qml</file>
<file>qml/dash_hybrid/Gadget.qml</file>
+ <file>qml/dash_hybrid/gauges/LargeMeter.qml</file>
+ <file>qml/dash_hybrid/gauges/SmallMeter.qml</file>
+ <file>qml/dash_hybrid/gauges/SpeedometerNumbers.qml</file>
+ <file>qml/dash_hybrid/gauges/NumberLabel.qml</file>
</qresource>
</RCC>
diff --git a/doc/src/snippets/qtcluster/images/BottomPanel.png b/doc/src/snippets/qtcluster/images/BottomPanel.png
index 8f1d908dc..5f6d92ca5 100644
--- a/doc/src/snippets/qtcluster/images/BottomPanel.png
+++ b/doc/src/snippets/qtcluster/images/BottomPanel.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/Cluster8Gauges.png b/doc/src/snippets/qtcluster/images/Cluster8Gauges.png
index d750a54ef..710b0b5d2 100644
--- a/doc/src/snippets/qtcluster/images/Cluster8Gauges.png
+++ b/doc/src/snippets/qtcluster/images/Cluster8Gauges.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/Icon_TurnLeft_OFF_small.png b/doc/src/snippets/qtcluster/images/Icon_TurnLeft_OFF_small.png
index b0867cdc2..5e01a9fdd 100644
--- a/doc/src/snippets/qtcluster/images/Icon_TurnLeft_OFF_small.png
+++ b/doc/src/snippets/qtcluster/images/Icon_TurnLeft_OFF_small.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/Icon_TurnLeft_ON_small.png b/doc/src/snippets/qtcluster/images/Icon_TurnLeft_ON_small.png
index 20c0e93be..1a0bfa99e 100644
--- a/doc/src/snippets/qtcluster/images/Icon_TurnLeft_ON_small.png
+++ b/doc/src/snippets/qtcluster/images/Icon_TurnLeft_ON_small.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/SpeedometerNeedle.png b/doc/src/snippets/qtcluster/images/SpeedometerNeedle.png
index d5dcc6000..6310a37ce 100644
--- a/doc/src/snippets/qtcluster/images/SpeedometerNeedle.png
+++ b/doc/src/snippets/qtcluster/images/SpeedometerNeedle.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/SpeedometerNeedleGreen.png b/doc/src/snippets/qtcluster/images/SpeedometerNeedleGreen.png
index eeb56f5d3..2d8aba144 100644
--- a/doc/src/snippets/qtcluster/images/SpeedometerNeedleGreen.png
+++ b/doc/src/snippets/qtcluster/images/SpeedometerNeedleGreen.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/SpeedometerNeedleSmall.png b/doc/src/snippets/qtcluster/images/SpeedometerNeedleSmall.png
new file mode 100644
index 000000000..1ba484f57
--- /dev/null
+++ b/doc/src/snippets/qtcluster/images/SpeedometerNeedleSmall.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/center.png b/doc/src/snippets/qtcluster/images/center.png
index aadbdaf9a..7a10220ad 100644
--- a/doc/src/snippets/qtcluster/images/center.png
+++ b/doc/src/snippets/qtcluster/images/center.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/greenglow.png b/doc/src/snippets/qtcluster/images/greenglow.png
index 7097220bd..84d4dda6c 100644
--- a/doc/src/snippets/qtcluster/images/greenglow.png
+++ b/doc/src/snippets/qtcluster/images/greenglow.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/knob.png b/doc/src/snippets/qtcluster/images/knob.png
index 4cd98ae07..7de0ea732 100644
--- a/doc/src/snippets/qtcluster/images/knob.png
+++ b/doc/src/snippets/qtcluster/images/knob.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/knob_small.png b/doc/src/snippets/qtcluster/images/knob_small.png
new file mode 100644
index 000000000..6afa72dd9
--- /dev/null
+++ b/doc/src/snippets/qtcluster/images/knob_small.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/left.png b/doc/src/snippets/qtcluster/images/left.png
index f423cda56..65606758e 100644
--- a/doc/src/snippets/qtcluster/images/left.png
+++ b/doc/src/snippets/qtcluster/images/left.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/leftgauge.png b/doc/src/snippets/qtcluster/images/leftgauge.png
index 323804849..3bd6bb53b 100644
--- a/doc/src/snippets/qtcluster/images/leftgauge.png
+++ b/doc/src/snippets/qtcluster/images/leftgauge.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/right.png b/doc/src/snippets/qtcluster/images/right.png
index 279284d96..99e7a042f 100644
--- a/doc/src/snippets/qtcluster/images/right.png
+++ b/doc/src/snippets/qtcluster/images/right.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/rightgauge.png b/doc/src/snippets/qtcluster/images/rightgauge.png
index 3f80a1cb8..17e849f54 100644
--- a/doc/src/snippets/qtcluster/images/rightgauge.png
+++ b/doc/src/snippets/qtcluster/images/rightgauge.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/images/temperature.png b/doc/src/snippets/qtcluster/images/temperature.png
index 83d889f53..8cf232fa7 100644
--- a/doc/src/snippets/qtcluster/images/temperature.png
+++ b/doc/src/snippets/qtcluster/images/temperature.png
Binary files differ
diff --git a/doc/src/snippets/qtcluster/qml/ValueSource.qml b/doc/src/snippets/qtcluster/qml/ValueSource.qml
index a63446543..eb95d8134 100644
--- a/doc/src/snippets/qtcluster/qml/ValueSource.qml
+++ b/doc/src/snippets/qtcluster/qml/ValueSource.qml
@@ -56,6 +56,8 @@ Item {
property bool runningInDesigner: false
+ property bool seatBelt: false
+
property var consumption: [300, 600, 700, 800, 900, 700, 600, 300, 50, 50, -100, 50, -100, -150,
-200, 50, 150, 200, 300, 200, 300, 200, 500, 50, -100, -100, -150, -80, 50, 300, 600, 700, 800,
600, 700, 300, 50, 50]
@@ -283,7 +285,7 @@ Item {
}
property int simuRpm: fastBootDemo ? kph * 40 : kph * 150
- property double simuTemperature: fastBootDemo ? kph * .25 + 60. : kph * .5 + 50.
+ property double simuTemperature: kph * .25 + 60.
// In normal Car UI mode only speed is animated based on gps data
// In automatic demo mode rpm, turbo, consumption and engine temperature are based on speed
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/BottomPanel.ui.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/BottomPanel.ui.qml
index abc04c5db..7fdd736ff 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/BottomPanel.ui.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/BottomPanel.ui.qml
@@ -41,6 +41,7 @@ import QtQuick 2.6
import ClusterDemo 1.0
import ".."
import QtQuick.Extras 1.4
+import QtGraphicalEffects 1.0
Item {
id: bottomPanel
@@ -52,10 +53,11 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
width: bottomPanelImage.width
- height: bottomPanelImage.height
+ height: bottomPanelImage.height - 24
Image {
id: bottomPanelImage
+ y: -24
source: "image://etc/BottomPanel.png"
}
@@ -79,6 +81,15 @@ Item {
color: ValueSource.engineTemperature >= 100.0 ? bottomPanel.iconRed : bottomPanel.iconDark
source: "qrc:/iso-icons/iso_grs_7000_4_0246.dat"
+
+ layer.enabled: ValueSource.engineTemperature >= 100.0
+ layer.effect: Glow {
+ radius: 5
+ samples: 16
+ color: bottomPanel.iconRed
+ cached: true
+ spread: 0.15
+ }
}
SafeRendererPicture {
@@ -91,6 +102,14 @@ Item {
color: ValueSource.batteryLevel <= 25.0 ? bottomPanel.iconRed : bottomPanel.iconDark
source: "qrc:/iso-icons/iso_grs_7000_4_0247.dat"
+ layer.enabled: ValueSource.batteryLevel <= 25.0
+ layer.effect: Glow {
+ radius: 5
+ samples: 16
+ color: bottomPanel.iconRed
+ cached: true
+ spread: 0.15
+ }
}
SafeRendererPicture {
@@ -102,7 +121,15 @@ Item {
anchors.right: iconParkingBrake.left
color: ValueSource.fuelLevel <= 20.0 ? bottomPanel.iconRed : bottomPanel.iconDark
- source: "qrc:/iso-icons/iso_grs_7000_4_0245.dat"
+ source: "qrc:/iso-icons/iso_grs_7000_4_0245.dat" // This is available in all editors.
+ layer.enabled: ValueSource.fuelLevel <= 20.0
+ layer.effect: Glow {
+ radius: 5
+ samples: 16
+ color: bottomPanel.iconRed
+ cached: true
+ spread: 0.15
+ }
}
SafeRendererPicture {
@@ -114,7 +141,8 @@ Item {
anchors.right: textTime.left
anchors.rightMargin: 3
- color: ValueSource.parkingBrake ? bottomPanel.iconRed : bottomPanel.iconDark
+ color: bottomPanel.iconDark
+
source: "qrc:/iso-icons/iso_grs_7000_4_0238.dat"
}
@@ -137,7 +165,8 @@ Item {
anchors.left: textTime.right
anchors.leftMargin: bottomPanel.iconMargin
- color: ValueSource.lowBeam ? bottomPanel.iconGreen : bottomPanel.iconDark
+ color: bottomPanel.iconDark
+
source: "qrc:/iso-icons/iso_grs_7000_4_0456.dat"
}
@@ -152,6 +181,14 @@ Item {
color: ValueSource.flatTire ? bottomPanel.iconYellow : bottomPanel.iconDark
source: "qrc:/iso-icons/iso_grs_7000_4_1434A.dat"
+ layer.enabled: ValueSource.flatTire
+ layer.effect: Glow {
+ radius: 6
+ samples: 16
+ color: bottomPanel.iconYellow
+ cached: true
+ spread: 0.2
+ }
}
SafeRendererPicture {
@@ -161,8 +198,8 @@ Item {
height: 30
anchors.verticalCenter: textTime.verticalCenter
anchors.left: iconTyre.right
+ color: bottomPanel.iconDark
- color: ValueSource.lightFailure ? bottomPanel.iconYellow : bottomPanel.iconDark
source: "qrc:/iso-icons/iso_grs_7000_4_1555.dat"
}
@@ -176,6 +213,14 @@ Item {
color: ValueSource.seatBelt ? bottomPanel.iconRed : bottomPanel.iconDark
source: "qrc:/iso-icons/iso_grs_7000_4_0249.dat"
+ layer.enabled: ValueSource.seatBelt
+ layer.effect: Glow {
+ radius: 5
+ samples: 16
+ color: bottomPanel.iconRed
+ cached: true
+ spread: 0.15
+ }
}
TurnIndicator {
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewCarInfo.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewCarInfo.qml
index 590ef1beb..9438b5648 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewCarInfo.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewCarInfo.qml
@@ -54,7 +54,7 @@ Item {
CarInfoField {
title: "Total distance"
- value: carinfoContainer.total.toString()
+ value: carinfoContainer.total.toFixed().toString()
unit: "km"
}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewMusic.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewMusic.qml
index 41df21852..1fcc1ba00 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewMusic.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/CenterViewMusic.qml
@@ -42,6 +42,7 @@ Item {
property int defaultYPos: 400
Rectangle {
+ y: 10
id: image
width: 124
height: 124
@@ -61,7 +62,7 @@ Item {
Text {
id: title
anchors.top: image.bottom
- anchors.topMargin: 10
+ anchors.topMargin: 6
anchors.horizontalCenter: image.horizontalCenter
text: musicContainer.currentSong
color: "gray"
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/Dashboard.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/Dashboard.qml
index fe5801236..b94500c11 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/Dashboard.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/Dashboard.qml
@@ -39,6 +39,7 @@
****************************************************************************/
import QtQuick 2.6
+import ClusterDemo 1.0
import "gauges"
DashboardForm
@@ -54,7 +55,17 @@ DashboardForm
property real timeScaleMultiplier: 1.5
property bool startupAnimationsFinished: false
- onNeedleRotationChanged: speedometer.speedometerNeedleRotation = needleRotation / 40.
+ //onNeedleRotationChanged: speedometer.speedometerNeedleRotation = needleRotation / 40.
+
+ property bool animationStopped: ValueSource.runningInDesigner ? true : startupAnimationsFinished
+
+ speedometer.actualValue: animationStopped ? ValueSource.kph : -needleRotation / 40
+
+ tachometer.actualValue: animationStopped ? ValueSource.rpm : -needleRotation
+
+ speedText.text: speedometer.actualValue.toFixed().toString()
+ consumptionMeter.actualValue: 2.0 + ValueSource.rpm / 320.45
+
//
// Startup animations
@@ -70,7 +81,7 @@ DashboardForm
target: dashboardEntity
property: "bottomPanelY"
from: 480
- to: 402
+ to: 412
duration: 1000 * timeScaleMultiplier
easing.type: Easing.InCirc
}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackground.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackground.qml
index 2c46b7fe8..6b9f68b96 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackground.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackground.qml
@@ -110,18 +110,6 @@ DashboardBackgroundForm {
ParallelAnimation {
PropertyAnimation {
- target: dashboard.gadget
- properties: "opacity, scale"
- duration: 1000
- }
- PropertyAnimation {
- target: dashboard.gadget2
- properties: "opacity, scale"
- duration: 1000
- }
- }
- ParallelAnimation {
- PropertyAnimation {
target: dashboard.leftGadget
properties: "opacity, scale"
duration: 400
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackgroundForm.ui.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackgroundForm.ui.qml
index 8b9b5f34f..ef38f8f38 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackgroundForm.ui.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardBackgroundForm.ui.qml
@@ -1,4 +1,3 @@
-
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
@@ -45,7 +44,6 @@ Item {
id: root
width: 1280
height: 480
- property alias gadget2: gadget2
property alias center: center
property alias rightGadget: rightGadget
@@ -54,7 +52,6 @@ Item {
property alias image: image
property alias rightGauge: rightGauge
property alias leftGauge: leftGauge
- property alias gadget: gadget
property real gaugeOpacity: 1
@@ -64,29 +61,38 @@ Item {
Image {
id: center
- x: 574
- y: 30
+ x: 568
+ y: 19
source: "image://etc/center.png"
+
+ Image {
+ x: -140
+ y: -122
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ source: "image://etc/knob_small.png"
+ }
}
Image {
id: rightGadget
- x: 732
- y: 34
+ x: 718
+ y: 29
source: "image://etc/right.png"
}
Image {
id: leftGadget
- x: 419
- y: 32
+ x: 417
+ y: 28
source: "image://etc/left.png"
}
Image {
id: bar
- x: 534
- y: 143
+ x: 531
+ y: 159
source: "image://etc/temperature.png"
}
}
@@ -96,12 +102,6 @@ Item {
x: 318
y: 393
source: "image://etc/leftgauge.png"
-
- Gadget {
- id: gadget
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
}
Image {
@@ -109,12 +109,6 @@ Item {
x: 652
y: 394
source: "image://etc/rightgauge.png"
-
- Gadget {
- id: gadget2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
}
states: [
State {
@@ -152,12 +146,6 @@ Item {
}
PropertyChanges {
- target: gadget
- scale: 0.8
- opacity: 0
- }
-
- PropertyChanges {
target: leftGadget
scale: 0.8
opacity: 0
@@ -180,11 +168,6 @@ Item {
scale: 0.8
opacity: 0
}
-
- PropertyChanges {
- target: gadget2
- opacity: 0
- }
},
State {
name: "normal"
@@ -197,8 +180,8 @@ Item {
PropertyChanges {
target: rightGauge
- x: 841
- y: 74
+ x: 832
+ y: 71
}
}
]
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardForm.ui.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardForm.ui.qml
index d806dc562..eb2aef4c6 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardForm.ui.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardForm.ui.qml
@@ -40,61 +40,225 @@
import QtQuick 2.6
import ClusterDemo 1.0
import "gauges"
+import QtQuick.Extras 1.4
+import ".."
DashboardBackground {
id: dashboardEntity
property alias bottompanel: bottompanel
- property alias speedometer: speedometer
- property alias tachometer: tachometer
property alias bottomPanelY: bottompanel.y
- property alias needleRotation: tachometer.tachometerNeedleRotation
+ property alias needleRotation: tachometer.speedometerNeedleRotation
property real meterOpacity: 1
-
- gadget2.green: tachometer.actualRPM < 4000
- gadget.green: speedometer.actualSpeed < 100
+ property alias speedometer: speedometer
+ property alias tachometer: tachometer
+ property alias speedText: speedText
+ property alias smallMeter: smallMeter
+ property alias consumptionMeter: consumptionMeter
anchors.fill: parent
- // Speedometer
- SpeedoMeter {
- opacity: dashboardEntity.meterOpacity
- id: speedometer
- }
- // Tachometer
- TachoMeter {
- id: tachometer
- opacity: dashboardEntity.meterOpacity
- anchors.fill: parent
- }
// Fuelmeter
- FuelMeter {
+ SmallMeter {
+ id: fuelMeter
+ x: 740
+ y: 45
+ value: ValueSource.fuelLevel
opacity: dashboardEntity.meterOpacity
}
+
// Batterymeter
- BatteryMeter {
+ SmallMeter {
+ id: batteryMeter
+ x: 739
+ y: 45
+ value: ValueSource.batteryLevel
opacity: dashboardEntity.meterOpacity
+ maxValueAngle: 317
+ minValueAngle: 225
+ maximumValue: 100
+ degreesPerValue: Math.abs(
+ (maxValueAngle - minValueAngle) / maximumValue)
+ rotationOffset: 135
+ direction: -1
}
+
// Consumptionmeter
- ConsumptionMeter {
- opacity: dashboardEntity.meterOpacity
- }
+
// Temperaturemeter
TemperatureMeter {
opacity: dashboardEntity.meterOpacity
+
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.rightMargin: 640
+ anchors.topMargin: 82
}
+
// Turbometer
- TurboMeter {
+ SmallMeter {
+ id: smallMeter
+ x: 437
+ y: 45
opacity: dashboardEntity.meterOpacity
+
+ value: ValueSource.rpm / 2000.
+
+ maxValueAngle: 270
+ minValueAngle: 0
+ maximumValue: 4.0
+ degreesPerValue: Math.abs(
+ (maxValueAngle - minValueAngle) / maximumValue)
}
+
// Fpsmeter
FpsMeter {
+ x: 582
opacity: dashboardEntity.meterOpacity
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.rightMargin: 591
+ anchors.topMargin: 87
}
+
// Bottom Panel
BottomPanel {
id: bottompanel
- y: 402
+ y: 412
+ anchors.horizontalCenterOffset: 0
+ }
+
+ SpeedometerNumbers {
+ id: speedometerNumbers
+ x: 103
+ y: 73
+ value: speedometer.actualValue
+ opacity: dashboardEntity.meterOpacity
+ }
+
+ LargeMeter {
+ id: speedometer
+
+ opacity: dashboardEntity.meterOpacity
+ x: 34
+ y: 3
+ actualValue: ValueSource.kph
+ maxValueAngle: 304
+
+ layer.enabled: opacity < 1
+
+ Gadget {
+ id: knobLeft
+ x: 113
+ y: 118
+
+ green: speedometer.actualValue < 100
+ value: speedometer.actualValue
+ }
+ }
+
+
+ LargeMeter {
+ id: tachometer
+ opacity: dashboardEntity.meterOpacity
+ x: 763
+ y: 2
+ actualValue: 6000
+ minValueAngle: 55
+ maxValueAngle: 255
+ minimumValue: 0
+ maximumValue: 8000
+ limitValue: 7000
+
+ layer.enabled: opacity < 1
+
+ LargeMeter {
+ id: consumptionMeter
+ x: 1
+ y: -2
+ fillWidth: 22
+ limitValue: 22
+ angleOffset: 72
+ actualValue: 30
+ visible: true
+
+ minValueAngle: 379
+ maxValueAngle: 291
+ minimumValue: 0
+ maximumValue: 30
+ }
+
+ Gadget {
+ id: knobRight
+ x: 116
+ y: 117
+
+ green: tachometer.actualValue < 7000
+ value: tachometer.actualValue
+ maxValue: 8000
+
+ Text {
+ id: textEco
+ x: -56
+ y: 156
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: tachometer.actualValue > 6000 ? "POWER" : "ECO"
+ anchors.verticalCenterOffset: 3
+ anchors.horizontalCenterOffset: 7
+ visible: true
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: 18
+ color: tachometer.actualValue <= 6000 ? "white" : "red"
+ opacity: dashboardEntity.meterOpacity
+ }
+ }
+ }
+
+
+ Text {
+ id: speedText
+ x: 74
+ y: 330
+
+ font.pixelSize: 40
+ color: "lightGray"
+ text: "10"
+ anchors.horizontalCenter: speedometer.horizontalCenter
+ opacity: dashboardEntity.meterOpacity
+ }
+
+
+ Text {
+ id: speedUnitText
+ anchors.top: speedText.bottom
+ font.pixelSize: 18
+ color: "lightGray"
+ text: "KM/H"
+ anchors.horizontalCenter: speedText.horizontalCenter
+ opacity: dashboardEntity.meterOpacity
+ }
+
+
+ Image {
+ id: knobSmallLeft
+ x: 460
+ y: 68
+ source: "image://etc/knob_small.png"
+ }
+
+ Image {
+ id: knobSmallRight
+ x: 763
+ y: 70
+ source: "image://etc/knob_small.png"
+ }
+
+ Image {
+ id: knobSmallcenter
+ x: 610
+ y: 62
+ source: "image://etc/knob_small.png"
}
}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardFrame.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardFrame.qml
index d0ed5513b..e4dd15e64 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardFrame.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/DashboardFrame.qml
@@ -45,11 +45,8 @@ Rectangle
{
width: 1280
height: 480
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#ffffff" }
- GradientStop { position: 0.4; color: "#1e2127" }
- GradientStop { position: 1.0; color: "#0c0f17" }
- }
+ color: "black"
+
Image {
id: logo
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/Gadget.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/Gadget.qml
index 62b535e84..5ff261cd9 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/Gadget.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/Gadget.qml
@@ -39,6 +39,7 @@
****************************************************************************/
import QtQuick 2.4
+import QtGraphicalEffects 1.0
Item {
id: gadget
@@ -46,24 +47,34 @@ Item {
width: 240
height: 240
+ property real value: 0
+ property real minValue: 0
+ property real maxValue: 200
+
+ property real __t: value / (maxValue - minValue)
+
+ property real __scale: __t * 1.04 + (1 - __t) * 0.85 * __scaleAnimation
+ property real __scaleAnimation: 1
+
property bool green: true
+
SequentialAnimation {
running: true
loops: -1
PropertyAnimation {
- target: glow
- from: 0.96
- to: 0.94
- property: "scale"
+ target: gadget
+ from: 1
+ to: 0.95
+ property: "__scaleAnimation"
duration: 600
}
PropertyAnimation {
- target: glow
- from: 0.94
- to: 0.96
- property: "scale"
+ target: gadget
+ from: 0.95
+ to: 1
+ property: "__scaleAnimation"
duration: 600
}
}
@@ -71,25 +82,31 @@ Item {
Item {
id: glow
- x: 53
- y: 52
- width: 145
- height: 145
+ x: 34
+ y: 31
+ width: 185
+ height: 185
- Image {
- id: green
- x: 0
- y: -1
+ scale: gadget.__scale
- source: "image://etc/greenglow.png"
- }
+ Rectangle {
+ width: 115
+ height: width
+ radius: width / 2
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: green ? "#0098c3" : "#a31e21"
+ Behavior on color {
+ ColorAnimation {
+ duration: 400
+ }
+ }
- Image {
- id: red
- x: -1
- y: 0
+ }
- source: "image://etc/redglow.png"
+ layer.enabled: true
+ layer.effect: FastBlur {
+ radius: 32
}
}
@@ -99,19 +116,4 @@ Item {
y: 65
source: "image://etc/knob.png"
}
- states: [
- State {
- name: "red"
- when: !gadget.green
- },
- State {
- name: "green"
- when: gadget.green
-
- PropertyChanges {
- target: red
- opacity: 0
- }
- }
- ]
}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/BatteryMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/BatteryMeter.qml
deleted file mode 100644
index 1a70ce6c4..000000000
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/BatteryMeter.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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$
-**
-****************************************************************************/
-
-import QtQuick 2.6
-import ClusterDemo 1.0
-
-Item {
- property real batterymeterNeedleRotation: -batteryValue * batteryDegreesPerValue
- property real batteryValue: ValueSource.batteryLevel
- property real maxValueAngle: 317
- property real minValueAngle: 225
- property real maximumValue: 100
- property real batteryDegreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue)
-
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.rightMargin: 436
- anchors.topMargin: 93
- width: 108
- height: 7
- rotation: batterymeterNeedleRotation - 135
-
- Image {
- width: 36
- height: 3
- //opacity: 0.75
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- source: "image://etc/SpeedometerNeedle.png"
- }
- Behavior on batteryValue {
- enabled: !ValueSource.runningInDesigner && !ValueSource.automaticDemoMode && startupAnimationsFinished
- PropertyAnimation { duration: 250 }
- }
-}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/ConsumptionMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/ConsumptionMeter.qml
deleted file mode 100644
index 23a25a6e3..000000000
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/ConsumptionMeter.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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$
-**
-****************************************************************************/
-
-import QtQuick 2.6
-import ClusterDemo 1.0
-
-Item {
- id: consumtionMeter
- property real consumptionValue: 2.0 + ValueSource.rpm / 444.45
-
- property real minValueAngle: 378
- property real maxValueAngle: 291
- property real minimumValue: 0
- property real maximumValue: 20
-
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.topMargin: 243
- anchors.rightMargin: 276
-
- GaugeFiller {
- id: consumptionFiller
- value: consumtionMeter.consumptionValue
- anchors.fill: parent
- numVertices: 32
- radius: 155
- fillWidth: 20
- color: ValueSource.rpm < 4000 ? "green" : "#EF2973"
- opacity: 0.3
- minAngle: consumtionMeter.minValueAngle
- maxAngle: consumtionMeter.maxValueAngle
- minValue: consumtionMeter.minimumValue
- maxValue: consumtionMeter.maximumValue
- Behavior on value {
- enabled: !ValueSource.runningInDesigner && !ValueSource.automaticDemoMode && startupAnimationsFinished
- PropertyAnimation { duration: 250 }
- }
- }
-
- Item {
- width: 322
- height: 7
- rotation: consumptionFiller.angle - 72
- anchors.centerIn: parent
-
- Image {
- width: 95
- height: 3
- //opacity: 0.75
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- source: ValueSource.rpm < 4000 ? "image://etc/SpeedometerNeedleGreen.png" : "image://etc/SpeedometerNeedle.png"
- }
- }
-}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FpsMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FpsMeter.qml
index 51e27fc86..7cee7ce26 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FpsMeter.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FpsMeter.qml
@@ -51,20 +51,16 @@ Item {
property real maximumValue: 60
property real fpsDegreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue)
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.rightMargin: 591
- anchors.topMargin: 83
+
width: 107
height: 7
rotation: fpsmeterNeedleRotation - 45
Image {
- width: 37
- height: 3
anchors.left: parent.left
+ anchors.leftMargin: -12
anchors.verticalCenter: parent.verticalCenter
- source: "image://etc/SpeedometerNeedle.png"
+ source: "image://etc/SpeedometerNeedleSmall.png"
}
FpsCounter {
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/LargeMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/LargeMeter.qml
new file mode 100644
index 000000000..5447b43d1
--- /dev/null
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/LargeMeter.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import ClusterDemo 1.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ Rectangle {
+ visible: false
+ width: 86
+ height: 86
+ radius: 43
+ color: "#3a5fe1"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ width: 480
+ height: 480
+
+ id: speedometer
+
+ property real speedometerNeedleRotation: 0.0
+
+ property bool animationStopped: ValueSource.runningInDesigner ? true : startupAnimationsFinished
+
+ property real actualValue: 90
+
+ property real minValueAngle: 55
+ property real maxValueAngle: 305
+ property real minimumValue: 0
+ property real maximumValue: 200
+
+ property real limitValue: 100
+
+ property real angleOffset: 35
+
+ property alias fillWidth: speedFiller.fillWidth
+
+ GaugeFiller {
+ anchors.fill: parent
+ id: speedFiller
+ value: speedometer.actualValue
+ numVertices: 64
+ radius: 155
+ fillWidth: 10
+ color: speedometer.actualValue < speedometer.limitValue ? "#0098c3" : "#a31e21"
+ opacity: 0.4
+ minAngle: speedometer.minValueAngle
+ maxAngle: speedometer.maxValueAngle
+ minValue: speedometer.minimumValue
+ maxValue: speedometer.maximumValue
+
+ Behavior on color {
+ ColorAnimation {
+ duration: 1000
+ }
+ }
+ }
+
+
+ Item {
+ id: speedometerNeedle
+ width: needleImage.width
+ height: needleImage.height
+ rotation: speedFiller.angle - speedometer.angleOffset
+
+ anchors.centerIn: parent
+
+ Item {
+
+ Image {
+ x: -59
+ y: -0.5
+ source: "image://etc/SpeedometerNeedle.png"
+ opacity: 1
+ layer.enabled: true
+ layer.effect: Colorize {
+ hue: 0.5
+ }
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 1000
+ }
+ }
+ }
+ Image {
+ x: -59
+ y: -0.5
+ id: needleImage
+ opacity: speedometer.actualValue < speedometer.limitValue ? 0 : 0.75
+ source: "image://etc/SpeedometerNeedle.png"
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 1000
+ }
+ }
+ layer.enabled: true
+ layer.effect: Colorize {
+ hue: 0.95
+ }
+ }
+
+ }
+ }
+
+}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/NumberLabel.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/NumberLabel.qml
new file mode 100644
index 000000000..32b9630df
--- /dev/null
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/NumberLabel.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+
+Text {
+ id: text_0
+ color: "#c6c6c6"
+ text: "0"
+ font.family: "Verdana"
+ font.pixelSize: 14
+}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FuelMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SmallMeter.qml
index b6569c6d6..6b323027a 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/FuelMeter.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SmallMeter.qml
@@ -42,31 +42,46 @@ import QtQuick 2.6
import ClusterDemo 1.0
Item {
- property real fuelmeterNeedleRotation: fuelValue * fuelDegreesPerValue
- property real fuelValue: ValueSource.fuelLevel
+ id: meter
+ width: 100
+ height: 100
+
+ property real meterNeedleRotation: direction * value * degreesPerValue
+ property real value: 20
property real maxValueAngle: 170
property real minValueAngle: 10
property real maximumValue: 100
- property real fuelDegreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue)
+ property real degreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue)
+
+ property real rotationOffset: 80
+
+ property real direction: 1
+
+ Rectangle {
+ visible: false
+ color: "red"
+ width: 10
+ height: 10
+ anchors.centerIn: parent
+ }
+
+
+ Item {
+ width: image.width
+ height: image.height
+
+ rotation: meter.meterNeedleRotation - meter.rotationOffset
+ anchors.centerIn: parent
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.rightMargin: 436
- anchors.topMargin: 93
- width: 105
- height: 7
- rotation: fuelmeterNeedleRotation - 80
+ Image {
+ id: image
+ x: -23
+ source: "image://etc/SpeedometerNeedleSmall.png"
+ }
- Image {
- width: 37
- height: 3
- //opacity: 0.75
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- source: "image://etc/SpeedometerNeedle.png"
}
- Behavior on fuelValue {
+ Behavior on value {
enabled: !ValueSource.automaticDemoMode && startupAnimationsFinished
PropertyAnimation { duration: 250 }
}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedoMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedoMeter.qml
deleted file mode 100644
index 23f11c43c..000000000
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedoMeter.qml
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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$
-**
-****************************************************************************/
-
-import QtQuick 2.6
-import ClusterDemo 1.0
-
-Item {
-
- id: speedometer
-
- property real speedometerNeedleRotation: 0.0
- property string speed: actualSpeed.toFixed().toString()
-
- property bool animationStopped: ValueSource.runningInDesigner ? true : startupAnimationsFinished
-
- property real actualSpeed: animationStopped
- ? ValueSource.kph : -speedometerNeedleRotation
-
- property real minValueAngle: 55
- property real maxValueAngle: 305
- property real minimumSpeed: 0
- property real maximumSpeed: 200
-
- Item {
- anchors.left: parent.left
- anchors.leftMargin: 20
- width: 480
- height: 480
-
- GaugeFiller {
- id: speedFiller
- value: speedometer.actualSpeed
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.topMargin: 244
- anchors.leftMargin: 255
- numVertices: 64
- radius: 155
- fillWidth: 5
- color: speedometer.actualSpeed < 100 ? "green" : "#EF2973"
- opacity: 0.6
- minAngle: speedometer.minValueAngle
- maxAngle: speedometer.maxValueAngle
- minValue: speedometer.minimumSpeed
- maxValue: speedometer.maximumSpeed
- }
- }
-
- Item {
- id: speedometerNeedle
- width: 309
- height: 7
- rotation: speedFiller.angle - 35
-
- x: 121
- y: 243
-
- Image {
- opacity: 0.75
- width: 97
- height: 7
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- source: speedometer.actualSpeed < 100 ? "image://etc/SpeedometerNeedleGreen.png" : "image://etc/SpeedometerNeedle.png"
- }
- }
-
- Row {
- anchors.top: speedometerNeedle.bottom
- anchors.topMargin: 80
- anchors.horizontalCenter: speedometerNeedle.horizontalCenter
- spacing: 7
-
- Text {
- font.pixelSize: 18
- color:(ValueSource.gear === 0 && ValueSource.parkingBrake) ? "white" : "gray"
- text: "P"
- }
-
- Text {
- font.pixelSize: 18
- //font.bold: ValueSource.gear === -1
- color: ValueSource.gear === -1 ? "white" : "gray"
- text: "R"
- }
-
- Text {
- font.pixelSize: 18
- //font.bold: ValueSource.gear === 0
- color: (ValueSource.gear === 0 && !ValueSource.parkingBrake) ? "white" : "gray"
- text: "N"
- }
-
- Text {
- font.pixelSize: 18
- //font.bold: ValueSource.gear === 1
- color: ValueSource.gear === 1 ? "white" : "gray"
- text: "D"
- }
- }
-
- Text {
- id: speedText
- anchors.top: speedometerNeedle.top
- anchors.topMargin: -27
- anchors.horizontalCenter: speedometerNeedle.horizontalCenter
- font.pixelSize: 40
- color: "lightGray"
- text: speedometer.speed
- }
-
- Text {
- id: speedUnitText
- anchors.top: speedText.bottom
- anchors.horizontalCenter: speedometerNeedle.horizontalCenter
- font.pixelSize: 18
- color: "lightGray"
- text: "KM/H"
- }
-}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedometerNumbers.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedometerNumbers.qml
new file mode 100644
index 000000000..f92e86768
--- /dev/null
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/SpeedometerNumbers.qml
@@ -0,0 +1,267 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: root
+ width: 338
+ height: 338
+
+ property real value: 5
+ property real scaleFactor: 1.3
+
+ NumberLabel {
+ id: text_0
+ x: 64
+ y: 237
+ }
+
+ NumberLabel {
+ id: text_20
+ x: 39
+ y: 184
+ text: "20"
+ }
+
+ NumberLabel {
+ id: text_40
+ x: 40
+ y: 126
+ text: "40"
+ }
+
+ NumberLabel {
+ id: text_60
+ x: 67
+ y: 78
+ text: "60"
+ }
+
+ NumberLabel {
+ id: text_80
+ x: 112
+ y: 45
+ text: "80"
+ }
+
+ NumberLabel {
+ id: text_100
+ x: 158
+ y: 35
+ text: "100"
+ }
+
+ NumberLabel {
+ id: text_120
+ x: 211
+ y: 45
+ text: "120"
+ }
+
+ NumberLabel {
+ id: text_140
+ x: 250
+ y: 78
+ text: "140"
+ }
+
+ NumberLabel {
+ id: text_160
+ x: 277
+ y: 126
+ text: "160"
+ }
+
+ NumberLabel {
+ id: text_180
+ x: 279
+ y: 185
+ text: "180"
+ }
+
+ NumberLabel {
+ id: text_200
+ x: 256
+ y: 237
+ text: "200"
+ }
+
+ states: [
+ State {
+ name: "0"
+
+ when: root.value < 10
+
+ PropertyChanges {
+ target: text_0
+ color: "#0098c3"
+ scale: 1.2
+ }
+ },
+ State {
+ name: "20"
+
+ when: root.value > 10 && root.value < 30
+
+ PropertyChanges {
+ target: text_20
+ color: "#0098c3"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "40"
+
+ when: root.value > 30 && root.value < 50
+
+ PropertyChanges {
+ target: text_40
+ color: "#0098c3"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "60"
+
+ when: root.value > 50 && root.value < 70
+
+ PropertyChanges {
+ target: text_60
+ color: "#0098c3"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "80"
+
+ when: root.value > 70 && root.value < 90
+
+ PropertyChanges {
+ target: text_80
+ color: "#0098c3"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "100"
+
+ when: root.value > 90 && root.value < 110
+
+ PropertyChanges {
+ target: text_100
+ color: "#a31e21"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "120"
+
+ when: root.value > 110 && root.value < 130
+
+ PropertyChanges {
+ target: text_120
+ color: "#a31e21"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "140"
+
+ when: root.value > 130 && root.value < 150
+
+ PropertyChanges {
+ target: text_140
+ color: "#a31e21"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "160"
+
+ when: root.value > 150 && root.value < 170
+
+ PropertyChanges {
+ target: text_160
+ color: "#a31e21"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "180"
+
+ when: root.value > 170 && root.value < 190
+
+ PropertyChanges {
+ target: text_180
+ color: "#a31e21"
+ scale: root.scaleFactor
+ }
+ },
+ State {
+ name: "200"
+
+ when: root.value > 190
+
+ PropertyChanges {
+ target: text_200
+ color: "#a31e21"
+ scale: root.scaleFactor
+ }
+ }
+ ]
+
+ transitions: Transition {
+ from: "*"
+ to: "*"
+
+ ParallelAnimation {
+ NumberAnimation {
+ properties: "scale"
+ duration: 400
+ }
+
+ ColorAnimation {
+ properties: "color"
+ duration: 400
+ }
+ }
+ }
+}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TachoMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TachoMeter.qml
deleted file mode 100644
index c6dc1bf55..000000000
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TachoMeter.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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$
-**
-****************************************************************************/
-
-import QtQuick 2.6
-import ClusterDemo 1.0
-
-Item {
- id: tachometer
-
- property real tachometerNeedleRotation: 0.0
- property string rpm: actualRPM.toFixed().toString()
-
- property bool animationStoped: ValueSource.runningInDesigner ? true : startupAnimationsFinished
-
- property real actualRPM: animationStoped
- ? ValueSource.rpm : -tachometerNeedleRotation
-
- property real minValueAngle: 55
- property real maxValueAngle: 255
- property real minimumRPM: 0
- property real maximumRPM: 8000
-
- Item {
- anchors.right: parent.right
- anchors.rightMargin: 20
- width: 480
- height: 480
-
- GaugeFiller {
- id: rpmFiller
- value: tachometer.actualRPM
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.topMargin: 246
- anchors.rightMargin: 253
- numVertices: 64
- radius: 155
- fillWidth: 5
- color: tachometer.actualRPM < 4000 ? "green" : "#EF2973"
- opacity: 0.6
- minAngle: tachometer.minValueAngle
- maxAngle: tachometer.maxValueAngle
- minValue: tachometer.minimumRPM
- maxValue: tachometer.maximumRPM
- }
- }
-
- Item {
- id: tachometerNeedle
- width: 312
- height: 7
- rotation: rpmFiller.angle - 35
- x: 854
- y: 242
-
- Image {
- opacity: 0.75
- width: 98
- height: 7
- anchors.left: parent.left
- anchors.leftMargin: 2
- anchors.verticalCenter: parent.verticalCenter
- source: tachometer.actualRPM < 4000 ? "image://etc/SpeedometerNeedleGreen.png" : "image://etc/SpeedometerNeedle.png"
- }
- }
-
- Text {
- id: textEco
- anchors.top: tachometerNeedle.top
- anchors.topMargin: -7
- anchors.horizontalCenter: tachometerNeedle.horizontalCenter
- text: tachometer.actualRPM > 4000 ? "POWER" : "ECO"
- font.pixelSize: 18
- color: tachometer.actualRPM <= 4000 ? "white" : "red"
- }
-}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TemperatureMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TemperatureMeter.qml
index c0001667f..cf575b6c8 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TemperatureMeter.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TemperatureMeter.qml
@@ -42,30 +42,26 @@ import QtQuick 2.6
import ClusterDemo 1.0
Item {
+ id: root
property real temperatureValue: ValueSource.engineTemperature
property real minValueAngle: 42.5
property real maxValueAngle: -42.5
property real minimumValue: 40
property real maximumValue: 120
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.rightMargin: 643
- anchors.topMargin: 60
-
GaugeFiller {
id: temperatureFiller
- value: temperatureValue
+ value: root.temperatureValue
anchors.fill: parent
numVertices: 32
radius: 140
fillWidth: 25
color: "#EF2973"
opacity: 0.3
- minAngle: minValueAngle
- maxAngle: maxValueAngle
- minValue: minimumValue
- maxValue: maximumValue
+ minAngle: root.minValueAngle
+ maxAngle: root.maxValueAngle
+ minValue: root.minimumValue
+ maxValue: root.maximumValue
Behavior on value {
enabled: !ValueSource.automaticDemoMode && startupAnimationsFinished
PropertyAnimation { duration: 250 }
@@ -75,16 +71,24 @@ Item {
Item {
width: 280
height: 7
- rotation: temperatureFiller.angle - 47.5
+ rotation: temperatureFiller.angle - 48
anchors.centerIn: parent
- Image {
- width: 25
- height: 3
- //opacity: 0.75
+ Item {
+ id: item1
+ width: 34
+ height: 7
+ opacity: 0.75
anchors.left: parent.left
+ anchors.leftMargin: -4
anchors.verticalCenter: parent.verticalCenter
- source: "image://etc/SpeedometerNeedle.png"
+ clip: true
+
+ Image {
+ x: -4
+ anchors.verticalCenter: parent.verticalCenter
+ source: "image://etc/SpeedometerNeedleSmall.png"
+ }
}
}
}
diff --git a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TurboMeter.qml b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TurboMeter.qml
index 7da8e8f90..af6296634 100644
--- a/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TurboMeter.qml
+++ b/doc/src/snippets/qtcluster/qml/dash_hybrid/gauges/TurboMeter.qml
@@ -60,7 +60,6 @@ Item {
Image {
width: 38
height: 3
- //opacity: 0.75
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
source: "image://etc/SpeedometerNeedle.png"
diff --git a/doc/src/snippets/qtcluster/qtiviclusterdata.h b/doc/src/snippets/qtcluster/qtiviclusterdata.h
index 7ba02a147..7d263219a 100644
--- a/doc/src/snippets/qtcluster/qtiviclusterdata.h
+++ b/doc/src/snippets/qtcluster/qtiviclusterdata.h
@@ -174,7 +174,7 @@ private Q_SLOTS:
void onGearChanged(int gear, const QString &zone);
protected:
- // virtual QtIVIAbstractZonedFeature* createZoneFeature(const QString &zone) Q_DECL_OVERRIDE;
+ // QtIVIAbstractZonedFeature* createZoneFeature(const QString &zone) override;
// QtIVIClusterData* zonedFeature(const QString &zone);
diff --git a/doc/src/snippets/qtcluster/scenehelper.cpp b/doc/src/snippets/qtcluster/scenehelper.cpp
index 0d0fd2c9a..7ee5ec581 100644
--- a/doc/src/snippets/qtcluster/scenehelper.cpp
+++ b/doc/src/snippets/qtcluster/scenehelper.cpp
@@ -78,7 +78,7 @@ void SceneHelper::removeFromScene(Qt3DRender::QSceneLoader *loader, const QStrin
foreach (QString name, names) {
QObject *entity = root->findChild<Qt3DCore::QEntity *>(name);
- entity->setParent(Q_NULLPTR);
+ entity->setParent(nullptr);
}
}