├── README.md ├── circularindicator.cpp ├── circularindicator.h ├── designerImports └── ClusterDemo │ ├── ValueSource.qml │ ├── plugin.cpp │ ├── plugin.pro │ ├── plugin.qrc │ └── qmldir ├── etcprovider.cpp ├── etcprovider.h ├── gauge.cpp ├── gauge.h ├── gaugenode.cpp ├── gaugenode.h ├── hybridimages.qrc ├── hybridqml.qrc ├── images.qrc ├── images ├── BottomPanel.png ├── BottomPanel_copy.png ├── Built_with_Qt.png ├── CarForParkSensors.png ├── CarInfoIcon.png ├── CentreMask.png ├── Cluster8Gauges.png ├── DashboardFrameSport-mask.png ├── DashboardMask.png ├── DoorActive.png ├── GaugeSpeedometer_CentreRingA.png ├── GaugeSpeedometer_CentreRingB.png ├── GaugeSpeedometer_OuterRingA.png ├── GaugeSpeedometer_OuterRingB.png ├── GaugeSpeedometer_Ticks1.png ├── GaugeSpeedometer_Ticks2.png ├── GaugeSpeedometer_TrailMask.png ├── Gauge_RPM.png ├── Gauge_Speed.png ├── Icon_TurnLeft_OFF.png ├── Icon_TurnLeft_OFF_small.png ├── Icon_TurnLeft_ON.png ├── Icon_TurnLeft_ON_small.png ├── InfoNoteBackground.png ├── MapLocation.png ├── MapLocationSport.png ├── MusicPlayer_CircleRemaining.png ├── MusicPlayer_Cover.png ├── ParkingSensorOff.png ├── RearCameraOverlay.png ├── RearCameraOverlaySport.png ├── RearCameraStill.jpg ├── SpeedometerNeedle.png ├── SpeedometerNeedleGreen.png ├── SpeedometerNeedleSmall.png ├── SportCarFloorShadow.png ├── SportCarForParkSensors.png ├── calendar.png ├── center.png ├── contacts.png ├── convert_premultiplied_alpha.sh ├── cover.png ├── greenglow.png ├── jane.png ├── john.png ├── knob.png ├── knob_small.png ├── left.png ├── leftgauge.png ├── other_danger.png ├── redglow.png ├── right.png ├── rightgauge.png └── temperature.png ├── iso-icons.qrc ├── iso-icons ├── iso_grs_7000_4_0083.dat ├── iso_grs_7000_4_0238.dat ├── iso_grs_7000_4_0239.dat ├── iso_grs_7000_4_0245.dat ├── iso_grs_7000_4_0246.dat ├── iso_grs_7000_4_0247.dat ├── iso_grs_7000_4_0248.dat ├── iso_grs_7000_4_0249.dat ├── iso_grs_7000_4_0456.dat ├── iso_grs_7000_4_1434A.dat ├── iso_grs_7000_4_1555.dat └── iso_grs_7000_4_1702.dat ├── main.cpp ├── pubkey.pem ├── qml ├── CarModelMain.qml ├── CarModelSports.qml ├── CarParking.qml ├── CarParkingSports.qml ├── CarViewElectric.qml ├── CarViewSports.qml ├── Circular_route.txt ├── ConsumptionView.qml ├── FpsCounter.qml ├── MapView.qml ├── MediaPlayerView.qml ├── TurnIndicator.qml ├── ValueSource.qml ├── VehicleInfoNote.qml ├── VideoView.qml ├── dash_hybrid │ ├── BottomPanel.ui.qml │ ├── CarInfoField.qml │ ├── CenterView.qml │ ├── CenterViewCalendar.qml │ ├── CenterViewCarInfo.qml │ ├── CenterViewContacts.qml │ ├── CenterViewMusic.qml │ ├── Dashboard.qml │ ├── DashboardBackground.qml │ ├── DashboardBackgroundForm.ui.qml │ ├── DashboardForm.ui.qml │ ├── DashboardFrame.qml │ ├── DashboardView.qml │ ├── Gadget.qml │ ├── SafeRendererPicture.qml │ └── gauges │ │ ├── FpsMeter.qml │ │ ├── LargeMeter.qml │ │ ├── NumberLabel.qml │ │ ├── SmallMeter.qml │ │ ├── SpeedometerNumbers.qml │ │ ├── TemperatureMeter.qml │ │ ├── TurboMeter.qml │ │ └── designer │ │ ├── BatteryMeterSpecifics.qml │ │ ├── ConsumptionMeterSpecifics.qml │ │ ├── FuelMeterSpecifics.qml │ │ ├── SpeedoMeterSpecifics.qml │ │ ├── TachoMeterSpecifics.qml │ │ ├── TemperatureMeterSpecifics.qml │ │ └── TurboMeterSpecifics.qml ├── dash_sports │ ├── CameraLoader.qml │ ├── CarLoader.qml │ ├── CenterStack.qml │ ├── Dashboard.qml │ ├── DashboardForm.ui.qml │ ├── DashboardFrame.qml │ ├── DashboardView.qml │ ├── Gauge.qml │ ├── RPMFlipable.qml │ ├── RPMGauge.qml │ ├── RPMGauge_painter.qml │ ├── RPMGauge_vertex.qml │ ├── SpeedoMeter.qml │ ├── SpeedoMeterLoader.qml │ ├── SpeedoMeter_painter.qml │ ├── SpeedoMeter_vertex.qml │ └── designer │ │ ├── RPMFlipableSpecifics.qml │ │ └── SpeedoMeterLoaderSpecifics.qml ├── functions.js ├── models │ ├── Map11.jpg │ ├── Map3.jpg │ ├── sportscar_15k.qgltf │ └── sportscar_15k_1.bin └── route.txt ├── qtcluster-base.pro ├── qtcluster.pro ├── qtcluster.qrc ├── qtiviclusterdata.cpp ├── qtiviclusterdata.h ├── scenehelper.cpp ├── scenehelper.h ├── sportscar_15k.qrc ├── sportsimages.qrc └── sportsqml.qrc /README.md: -------------------------------------------------------------------------------- 1 | # qt-instrument-cluster 2 | 3 | The project is part of a Fog Network Simulator which tries to simulate the use case of a vehicle collision on a public road and prevent further incidents by sending alerts to other drivers in the vicinity. 4 | 5 | The Instrument cluster is the visualisation part of the simulator which displays internal vehicle parameters which are sent on the CAN Bus network and acts as a head-unit which communicates with a Fog Network, receiving status signals and displays them appropriately. 6 | 7 | This is a fork of qtcluster, a public demo of automotive instrument cluster capabilities created with the QT framework: 8 | Source: http://code.qt.io/cgit/qt/qtdoc.git/tree/doc/src/snippets/qtcluster?h=5.10 9 | 10 | 11 | Features: 12 | - Connection to virtual CAN Bus via SSL sockets: http://doc.qt.io/qt-5/qsslsocket.html 13 | - Connection to virtual CAN Bus via QCanBus: http://doc.qt.io/qt-5/qcanbus.html 14 | - Connection to a Fog Node via sockets 15 | - Visualisation of Vehicle CAN Bus parameters 16 | - Visualisation of Collision warning 17 | 18 | Built with version 5.10.1 19 | -------------------------------------------------------------------------------- /circularindicator.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | #ifndef CIRCULARINDICATOR_H 52 | #define CIRCULARINDICATOR_H 53 | 54 | #include 55 | #include 56 | 57 | class CircularIndicator : public QQuickPaintedItem 58 | { 59 | Q_OBJECT 60 | Q_PROPERTY(int startAngle READ startAngle WRITE setStartAngle NOTIFY startAngleChanged) 61 | Q_PROPERTY(int endAngle READ endAngle WRITE setEndAngle NOTIFY endAngleChanged) 62 | Q_PROPERTY(qreal minimumValue READ minimumValue WRITE setMinimumValue NOTIFY minimumValueChanged) 63 | Q_PROPERTY(qreal maximumValue READ maximumValue WRITE setMaximumValue NOTIFY maximumValueChanged) 64 | Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged) 65 | Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth NOTIFY lineWidthChanged) 66 | Q_PROPERTY(QColor progressColor READ progressColor WRITE setProgressColor NOTIFY progressColorChanged) 67 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) 68 | Q_PROPERTY(int padding READ padding WRITE setPadding NOTIFY paddingChanged) 69 | 70 | public: 71 | CircularIndicator(QQuickItem *parent = 0); 72 | ~CircularIndicator(); 73 | 74 | int startAngle() const; 75 | int endAngle() const; 76 | qreal minimumValue() const; 77 | qreal maximumValue() const; 78 | qreal value() const; 79 | int lineWidth() const; 80 | QColor progressColor() const; 81 | QColor backgroundColor() const; 82 | int padding() const; 83 | 84 | public slots: 85 | void setStartAngle(int angle); 86 | void setEndAngle(int angle); 87 | void setMinimumValue(qreal value); 88 | void setMaximumValue(qreal value); 89 | void setValue(qreal value); 90 | void setLineWidth(int width); 91 | void setProgressColor(QColor color); 92 | void setBackgroundColor(QColor color); 93 | void setPadding(int padding); 94 | 95 | signals: 96 | void startAngleChanged(int); 97 | void endAngleChanged(int); 98 | void minimumValueChanged(qreal); 99 | void maximumValueChanged(qreal); 100 | void valueChanged(qreal); 101 | void lineWidthChanged(int); 102 | void progressColorChanged(QColor); 103 | void backgroundColorChanged(QColor); 104 | void paddingChanged(int); 105 | 106 | protected: 107 | void paint(QPainter *painter); 108 | 109 | private: 110 | int mStartAngle; 111 | int mEndAngle; 112 | qreal mMinimumValue; 113 | qreal mMaximumValue; 114 | qreal mValue; 115 | int mLineWidth; 116 | QColor mProgressColor; 117 | QColor mBackgroundColor; 118 | int mPadding; 119 | }; 120 | 121 | #endif // CIRCULARINDICATOR_H 122 | -------------------------------------------------------------------------------- /designerImports/ClusterDemo/ValueSource.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | pragma Singleton 42 | import QtQuick 2.6 43 | 44 | Item { 45 | id: valueSource 46 | 47 | property real kph: 30 48 | property real consumeKW: 0 49 | property real maxConsumeKWValue: 90 50 | property real maxChargeKWValue: 40 51 | property real chargeKW: 10 52 | property real maxRange: 600 53 | property real range: (batteryLevel / 100) * maxRange 54 | 55 | property bool runningInDesigner: true 56 | 57 | property var consumption: [300, 600, 700, 800, 900, 700, 600, 300, 50, 50, -100, 50, -100, -150, 58 | -200, 50, 150, 200, 300, 200, 300, 200, 500, 50, -100, -100, -150, -80, 50, 300, 600, 700, 800, 59 | 600, 700, 300, 50, 50] 60 | 61 | property var turnSignal 62 | property var currentDate: new Date() 63 | //property string date: currentDate.toLocaleDateString(Qt.locale("fi_FI"), "ddd d. MMM") 64 | //property string time: currentDate.toLocaleTimeString(Qt.locale("fi_FI"), "hh:mm") 65 | property string date: currentDate.toLocaleDateString(Qt.locale("en_GB")) 66 | property string time: currentDate.toLocaleTimeString(Qt.locale("en_GB"), "hh:mm") 67 | 68 | property real latitude: 0 69 | property real longitude: 0 70 | property real direction: 0 71 | property bool lowBeam: false 72 | property int carId: 4 73 | property bool lightFailure: true 74 | property bool flatTire: false 75 | 76 | property bool frontLeftOpen: false 77 | property bool frontRightOpen: true 78 | property bool rearLeftDoorOpen: false 79 | property bool rearRighDoorOpen: true 80 | property bool hoodOpen: false 81 | property bool trunkOpen: true 82 | 83 | property double batteryLevel: 45 84 | property double fuelLevel: 55 85 | property int gear: -1 86 | property bool parkingBrake: true 87 | // TODO: These two are hacks. View change messages might not come through CAN. 88 | property bool viewChange: false 89 | property bool rightViewChange: false 90 | property string gearString: "1" 91 | 92 | property int rpm: 1450 93 | property double engineTemperature: 40 94 | 95 | property int totalDistance: 42300 96 | property int kmSinceCharge: 8 97 | property int avRangePerCharge: 425 98 | property int energyPerKm: 324 99 | 100 | property real totalDistanceSince: 10 101 | } 102 | -------------------------------------------------------------------------------- /designerImports/ClusterDemo/plugin.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the plugins of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 3 requirements 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 24 | ** 25 | ** GNU General Public License Usage 26 | ** Alternatively, this file may be used under the terms of the GNU 27 | ** General Public License version 2.0 or (at your option) the GNU General 28 | ** Public license version 3 or any later version approved by the KDE Free 29 | ** Qt Foundation. The licenses are as published by the Free Software 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 31 | ** included in the packaging of this file. Please review the following 32 | ** information to ensure the GNU General Public License requirements will 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. 35 | ** 36 | ** $QT_END_LICENSE$ 37 | ** 38 | ****************************************************************************/ 39 | 40 | #include "../../etcprovider.h" 41 | #include "../../circularindicator.h" 42 | #include "../../gauge.h" 43 | 44 | #include 45 | 46 | #include 47 | 48 | class ClusterDemoPlugin : public QQmlExtensionPlugin 49 | { 50 | Q_OBJECT 51 | 52 | Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) 53 | public: 54 | ClusterDemoPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) {} 55 | void registerTypes(const char *) override 56 | { 57 | qmlRegisterType("ClusterDemo", 1, 0, "CircularIndicator"); 58 | qmlRegisterType("ClusterDemo", 1, 0, "GaugeFiller"); 59 | qmlRegisterSingletonType(QUrl("qrc:/ValueSource.qml"), "ClusterDemo", 1, 0, "ValueSource"); 60 | } 61 | 62 | void initializeEngine(QQmlEngine *engine, const char *uri) override 63 | { 64 | EtcProvider *etcProvider = new EtcProvider(); 65 | etcProvider->setBaseUrl(QUrl("qrc:///images/")); 66 | engine->addImageProvider("etc", etcProvider); 67 | QQmlExtensionPlugin::initializeEngine(engine, uri); 68 | } 69 | }; 70 | 71 | #include "plugin.moc" 72 | -------------------------------------------------------------------------------- /designerImports/ClusterDemo/plugin.pro: -------------------------------------------------------------------------------- 1 | CXX_MODULE = qml 2 | TARGET = clusterdemo 3 | QT += qml quick 4 | TEMPLATE = lib 5 | CONFIG -= debug 6 | CONFIG += release 7 | DESTDIR = $$PWD 8 | TARGET = $$qtLibraryTarget($$TARGET) 9 | 10 | OUT_PWD = $$PWD 11 | 12 | SOURCES += \ 13 | plugin.cpp \ 14 | ../../etcprovider.cpp \ 15 | ../../circularindicator.cpp \ 16 | ../../gauge.cpp \ 17 | ../../gaugenode.cpp 18 | 19 | HEADERS += \ 20 | ../../etcprovider.h \ 21 | ../../circularindicator.h \ 22 | ../../gauge.h \ 23 | ../../gaugenode.h 24 | 25 | RESOURCES += plugin.qrc \ 26 | ../../images.qrc \ 27 | ../../sportsimages.qrc \ 28 | ../../hybridimages.qrc 29 | 30 | 31 | DISTFILES = qmldir 32 | 33 | !equals(_PRO_FILE_PWD_, $$OUT_PWD) { 34 | copy_qmldir.target = $$OUT_PWD/qmldir 35 | copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir 36 | copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" 37 | QMAKE_EXTRA_TARGETS += copy_qmldir 38 | PRE_TARGETDEPS += $$copy_qmldir.target 39 | } 40 | 41 | -------------------------------------------------------------------------------- /designerImports/ClusterDemo/plugin.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ValueSource.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /designerImports/ClusterDemo/qmldir: -------------------------------------------------------------------------------- 1 | module ClusterDemo 2 | plugin clusterdemo 3 | singleton ValueSource 1.0 ValueSource.qml 4 | -------------------------------------------------------------------------------- /etcprovider.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | #include "etcprovider.h" 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | 58 | QImage EtcProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) 59 | { 60 | Q_UNUSED(requestedSize); 61 | QImage ret; 62 | 63 | QUrl url = QUrl(id); 64 | if (url.isRelative() && !m_baseUrl.isEmpty()) 65 | url = m_baseUrl.resolved(url); 66 | QString path = QQmlFile::urlToLocalFileOrQrc(url); 67 | ret.load(path); 68 | *size = ret.size(); 69 | 70 | return ret; 71 | } 72 | 73 | void EtcProvider::setBaseUrl(const QUrl &base) 74 | { 75 | m_baseUrl = base; 76 | } 77 | -------------------------------------------------------------------------------- /etcprovider.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef ETCPROVIDER_H 35 | #define ETCPROVIDER_H 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | class EtcProvider : public QQuickImageProvider 43 | { 44 | public: 45 | EtcProvider() : QQuickImageProvider(QQuickImageProvider::Image) 46 | {} 47 | 48 | QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize); 49 | void setBaseUrl(const QUrl &base); 50 | 51 | private: 52 | QUrl m_baseUrl; 53 | }; 54 | 55 | #endif // ETCPROVIDER_H 56 | -------------------------------------------------------------------------------- /hybridimages.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/Built_with_Qt.png 4 | images/BottomPanel.png 5 | images/Cluster8Gauges.png 6 | images/SpeedometerNeedle.png 7 | images/jane.png 8 | images/john.png 9 | images/calendar.png 10 | images/CarInfoIcon.png 11 | images/contacts.png 12 | images/cover.png 13 | images/Icon_TurnLeft_OFF_small.png 14 | images/Icon_TurnLeft_ON_small.png 15 | images/greenglow.png 16 | images/knob.png 17 | images/knob_small.png 18 | images/left.png 19 | images/leftgauge.png 20 | images/redglow.png 21 | images/right.png 22 | images/rightgauge.png 23 | images/temperature.png 24 | images/center.png 25 | images/SpeedometerNeedleSmall.png 26 | images/BottomPanel_copy.png 27 | images/DoorActive.png 28 | images/other_danger.png 29 | 30 | 31 | -------------------------------------------------------------------------------- /hybridqml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/dash_hybrid/BottomPanel.ui.qml 4 | qml/dash_hybrid/CenterView.qml 5 | qml/dash_hybrid/Dashboard.qml 6 | qml/dash_hybrid/DashboardFrame.qml 7 | qml/dash_hybrid/DashboardView.qml 8 | qml/dash_hybrid/gauges/FpsMeter.qml 9 | qml/dash_hybrid/gauges/TemperatureMeter.qml 10 | qml/dash_hybrid/gauges/TurboMeter.qml 11 | qml/dash_hybrid/CenterViewCalendar.qml 12 | qml/dash_hybrid/CenterViewCarInfo.qml 13 | qml/dash_hybrid/CenterViewContacts.qml 14 | qml/dash_hybrid/CenterViewMusic.qml 15 | qml/dash_hybrid/CarInfoField.qml 16 | qml/dash_hybrid/DashboardForm.ui.qml 17 | qml/dash_hybrid/SafeRendererPicture.qml 18 | qml/dash_hybrid/DashboardBackground.qml 19 | qml/dash_hybrid/DashboardBackgroundForm.ui.qml 20 | qml/dash_hybrid/Gadget.qml 21 | qml/dash_hybrid/gauges/LargeMeter.qml 22 | qml/dash_hybrid/gauges/SmallMeter.qml 23 | qml/dash_hybrid/gauges/SpeedometerNumbers.qml 24 | qml/dash_hybrid/gauges/NumberLabel.qml 25 | 26 | 27 | -------------------------------------------------------------------------------- /images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/Icon_TurnLeft_OFF.png 4 | images/Icon_TurnLeft_ON.png 5 | images/MapLocation.png 6 | images/MusicPlayer_CircleRemaining.png 7 | images/MusicPlayer_Cover.png 8 | images/RearCameraOverlay.png 9 | images/CarForParkSensors.png 10 | images/ParkingSensorOff.png 11 | images/InfoNoteBackground.png 12 | images/RearCameraStill.jpg 13 | images/DoorActive.png 14 | 15 | 16 | -------------------------------------------------------------------------------- /images/BottomPanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/BottomPanel.png -------------------------------------------------------------------------------- /images/BottomPanel_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/BottomPanel_copy.png -------------------------------------------------------------------------------- /images/Built_with_Qt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Built_with_Qt.png -------------------------------------------------------------------------------- /images/CarForParkSensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/CarForParkSensors.png -------------------------------------------------------------------------------- /images/CarInfoIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/CarInfoIcon.png -------------------------------------------------------------------------------- /images/CentreMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/CentreMask.png -------------------------------------------------------------------------------- /images/Cluster8Gauges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Cluster8Gauges.png -------------------------------------------------------------------------------- /images/DashboardFrameSport-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/DashboardFrameSport-mask.png -------------------------------------------------------------------------------- /images/DashboardMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/DashboardMask.png -------------------------------------------------------------------------------- /images/DoorActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/DoorActive.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_CentreRingA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_CentreRingA.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_CentreRingB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_CentreRingB.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_OuterRingA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_OuterRingA.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_OuterRingB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_OuterRingB.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_Ticks1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_Ticks1.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_Ticks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_Ticks2.png -------------------------------------------------------------------------------- /images/GaugeSpeedometer_TrailMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/GaugeSpeedometer_TrailMask.png -------------------------------------------------------------------------------- /images/Gauge_RPM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Gauge_RPM.png -------------------------------------------------------------------------------- /images/Gauge_Speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Gauge_Speed.png -------------------------------------------------------------------------------- /images/Icon_TurnLeft_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Icon_TurnLeft_OFF.png -------------------------------------------------------------------------------- /images/Icon_TurnLeft_OFF_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Icon_TurnLeft_OFF_small.png -------------------------------------------------------------------------------- /images/Icon_TurnLeft_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Icon_TurnLeft_ON.png -------------------------------------------------------------------------------- /images/Icon_TurnLeft_ON_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/Icon_TurnLeft_ON_small.png -------------------------------------------------------------------------------- /images/InfoNoteBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/InfoNoteBackground.png -------------------------------------------------------------------------------- /images/MapLocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/MapLocation.png -------------------------------------------------------------------------------- /images/MapLocationSport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/MapLocationSport.png -------------------------------------------------------------------------------- /images/MusicPlayer_CircleRemaining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/MusicPlayer_CircleRemaining.png -------------------------------------------------------------------------------- /images/MusicPlayer_Cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/MusicPlayer_Cover.png -------------------------------------------------------------------------------- /images/ParkingSensorOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/ParkingSensorOff.png -------------------------------------------------------------------------------- /images/RearCameraOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/RearCameraOverlay.png -------------------------------------------------------------------------------- /images/RearCameraOverlaySport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/RearCameraOverlaySport.png -------------------------------------------------------------------------------- /images/RearCameraStill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/RearCameraStill.jpg -------------------------------------------------------------------------------- /images/SpeedometerNeedle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/SpeedometerNeedle.png -------------------------------------------------------------------------------- /images/SpeedometerNeedleGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/SpeedometerNeedleGreen.png -------------------------------------------------------------------------------- /images/SpeedometerNeedleSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/SpeedometerNeedleSmall.png -------------------------------------------------------------------------------- /images/SportCarFloorShadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/SportCarFloorShadow.png -------------------------------------------------------------------------------- /images/SportCarForParkSensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/SportCarForParkSensors.png -------------------------------------------------------------------------------- /images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/calendar.png -------------------------------------------------------------------------------- /images/center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/center.png -------------------------------------------------------------------------------- /images/contacts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/contacts.png -------------------------------------------------------------------------------- /images/convert_premultiplied_alpha.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while read -r line || [[ -n "$line" ]]; do 4 | echo "Text: $line"; 5 | convert $line -write mpr:temp -background black -alpha Remove mpr:temp -compose Copy_Opacity -composite ../images-premultiplied-alpha/$line 6 | done < "$1" 7 | -------------------------------------------------------------------------------- /images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/cover.png -------------------------------------------------------------------------------- /images/greenglow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/greenglow.png -------------------------------------------------------------------------------- /images/jane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/jane.png -------------------------------------------------------------------------------- /images/john.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/john.png -------------------------------------------------------------------------------- /images/knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/knob.png -------------------------------------------------------------------------------- /images/knob_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/knob_small.png -------------------------------------------------------------------------------- /images/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/left.png -------------------------------------------------------------------------------- /images/leftgauge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/leftgauge.png -------------------------------------------------------------------------------- /images/other_danger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/other_danger.png -------------------------------------------------------------------------------- /images/redglow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/redglow.png -------------------------------------------------------------------------------- /images/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/right.png -------------------------------------------------------------------------------- /images/rightgauge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/rightgauge.png -------------------------------------------------------------------------------- /images/temperature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/images/temperature.png -------------------------------------------------------------------------------- /iso-icons.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | iso-icons/iso_grs_7000_4_0083.dat 4 | iso-icons/iso_grs_7000_4_1434A.dat 5 | iso-icons/iso_grs_7000_4_0246.dat 6 | iso-icons/iso_grs_7000_4_0245.dat 7 | iso-icons/iso_grs_7000_4_0247.dat 8 | iso-icons/iso_grs_7000_4_1555.dat 9 | iso-icons/iso_grs_7000_4_1702.dat 10 | iso-icons/iso_grs_7000_4_0249.dat 11 | iso-icons/iso_grs_7000_4_0238.dat 12 | iso-icons/iso_grs_7000_4_0456.dat 13 | iso-icons/iso_grs_7000_4_0239.dat 14 | iso-icons/iso_grs_7000_4_0248.dat 15 | 16 | 17 | -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0083.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0083.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0238.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0238.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0239.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0239.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0245.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0245.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0246.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0246.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0247.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0247.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0248.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0248.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0249.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0249.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_0456.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_0456.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_1434A.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_1434A.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_1555.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_1555.dat -------------------------------------------------------------------------------- /iso-icons/iso_grs_7000_4_1702.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/iso-icons/iso_grs_7000_4_1702.dat -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifdef QT_3DCORE_LIB 42 | #include "scenehelper.h" 43 | #endif 44 | #include "gauge.h" 45 | #include "qtiviclusterdata.h" 46 | #include "circularindicator.h" 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | #include "etcprovider.h" 57 | #ifdef STATIC 58 | #include 59 | #include 60 | 61 | Q_IMPORT_PLUGIN(QtQuick2Plugin) 62 | Q_IMPORT_PLUGIN(QtQuickScene3DPlugin) 63 | Q_IMPORT_PLUGIN(Qt3DQuick3DCorePlugin) 64 | Q_IMPORT_PLUGIN(Qt3DQuick3DRenderPlugin) 65 | #endif 66 | 67 | int main(int argc, char **argv) 68 | { 69 | qputenv("QT_QPA_EGLFS_HIDECURSOR", "1"); 70 | qputenv("QT_QPA_EGLFS_DISABLE_INPUT", "1"); 71 | // qputenv("QT_QPA_EGLFS_INTEGRATION", "eglfs_viv"); 72 | qputenv("FB_MULTI_BUFFER", "2"); 73 | qputenv("QT_QPA_EGLFS_WIDTH", "1280"); 74 | qputenv("QT_QPA_EGLFS_HEIGHT", "480"); 75 | qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", "1280"); 76 | qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", "480"); 77 | qputenv("QT_QPA_FONTDIR", "."); 78 | // iPad Air, iPad Air 2, iPad Pro (9.7 inch), iPad Pro (12.9 inch), iPad Retina 79 | // qputenv("QT_SCALE_FACTOR", "0.8"); 80 | // iPhone 5, iPhone 5s, iPhone 6, iPhone 6 Plus, iPhone 6s, iPhone 6s Plus, iPhone 7, iPhone 7 Plus, iPhone SE 81 | // qputenv("QT_SCALE_FACTOR", "0.44"); 82 | 83 | #ifdef STATIC 84 | qobject_cast(qt_static_plugin_QtQuick2Plugin().instance())->registerTypes("QtQuick"); 85 | qobject_cast(qt_static_plugin_QtQuickScene3DPlugin().instance())->registerTypes("QtQuick.Scene3D"); 86 | qobject_cast(qt_static_plugin_Qt3DQuick3DCorePlugin().instance())->registerTypes("Qt3D.Core"); 87 | qobject_cast(qt_static_plugin_Qt3DQuick3DRenderPlugin().instance())->registerTypes("Qt3D.Render"); 88 | #endif 89 | QGuiApplication app(argc, argv); 90 | 91 | #ifdef QT_3DCORE_LIB 92 | qmlRegisterType("Qt3D.Examples", 2, 0, "SceneHelper"); 93 | #endif 94 | qmlRegisterType("ClusterDemoData", 1, 0, "ClusterData"); 95 | qmlRegisterType("ClusterDemo", 1, 0, "GaugeFiller"); 96 | qmlRegisterType("ClusterDemo", 1, 0, "CircularIndicator"); 97 | qmlRegisterSingletonType(QUrl("qrc:/qml/ValueSource.qml"), "ClusterDemo", 1, 0, "ValueSource"); 98 | 99 | QQuickView view; 100 | 101 | EtcProvider *etcProvider = new EtcProvider(); 102 | etcProvider->setBaseUrl(QUrl("qrc:///images/")); 103 | view.engine()->addImageProvider("etc", etcProvider); 104 | 105 | view.setColor(QColor(Qt::black)); 106 | view.setWidth(1280); 107 | view.setHeight(480); 108 | view.engine()->addImportPath("qrc:/imports/"); 109 | 110 | bool sportsCar = false; 111 | if (app.arguments().count() > 1) 112 | sportsCar = app.arguments().at(1) == "sports"; 113 | 114 | if (sportsCar) 115 | view.setSource(QUrl("qrc:/qml/dash_sports/DashboardFrame.qml")); 116 | else 117 | view.setSource(QUrl("qrc:/qml/dash_hybrid/DashboardFrame.qml")); 118 | 119 | view.show(); 120 | return app.exec(); 121 | } 122 | -------------------------------------------------------------------------------- /pubkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFPjCCAyagAwIBAgIJAJ5oNs9Ra6SQMA0GCSqGSIb3DQEBCwUAMDQxCzAJBgNV 3 | BAYTAlVLMRMwEQYDVQQIDApTb21lLVN0YXRlMRAwDgYDVQQKDAdDYXJkaWZmMB4X 4 | DTE4MDQyNjE1NDU1OVoXDTE4MDUyNjE1NDU1OVowNDELMAkGA1UEBhMCVUsxEzAR 5 | BgNVBAgMClNvbWUtU3RhdGUxEDAOBgNVBAoMB0NhcmRpZmYwggIiMA0GCSqGSIb3 6 | DQEBAQUAA4ICDwAwggIKAoICAQC2M89T2ecqa8+HNSzY0zK3OhWfPIdLDGOueXFZ 7 | vzLEOE8TPB4FCGCBghwUww61S6nj3wQFw/M+EbshSZBYqg8WP2UhgFrX18VYCsaP 8 | Zc8azwgavq3MlqQMyzbTRpiJMfxPQkycXLZx28V9DyG5ZuErA8usyalsyxZe+CWQ 9 | 7AfmyNK6bGjrjyTKbaKHA2cndDmJolZK6k0d9XSJ/44jLVeRahnAqbTpW32JaKDM 10 | jY9bIJ+GLfoHZ3dWAUZdqG5HDpj7kraIce1qMMxTH8WjNGuut7P5aDj3Q5lF4F7R 11 | ozLiPhGrDLYBOKR4mMhKLBnMFQk4NaLvtJmpI2mlcwepk8YRyVS+6ytQavZjdNvO 12 | o8/WxrmAiArzVHJVn58ZEVKns6ZuQEs1Gwbx9AHGCjt1t/eiXFJaESeQFnBaQFQr 13 | XbXiW87+6y3xt3vFYs8HK3bZ0mS4lxyWJ5Fe5JRk0GyX0tRYW/2S3yfvJsDXeagJ 14 | 2nUnh4yXXRYQBUmoNpoyAm7VgmQF7n/k0ZVa2QG4t/5ZAYE5Bg8I2Lb/RzBCdxH8 15 | sa0DgsWrjOYyTY5ErRKLr6/VTfiYSxzQtThsCBJmfSDnj3KS1A+8T0DZvh2j2/xn 16 | mtfxpG5EbJysIdCUuSwaFszsKAobz23RD3yafFZBS4Wb3rJPs18YFGsKCLYyHOIF 17 | gd/0ZwIDAQABo1MwUTAdBgNVHQ4EFgQUxwrgLp+OWalKtAEqvNxPPTQiQtkwHwYD 18 | VR0jBBgwFoAUxwrgLp+OWalKtAEqvNxPPTQiQtkwDwYDVR0TAQH/BAUwAwEB/zAN 19 | BgkqhkiG9w0BAQsFAAOCAgEATHmGOVOkJ8ZQtD3OYq63B4ySLOqFE96lDHsN+vlF 20 | MjM6YWd+rm4l1ch0ZAMh4Ebn8L8l0nelXW1rCK/28wfXbFthYulJySLpqAMKFZvv 21 | 4VRFbtnvMPm/o1ttbqYgCRMY8fNpDrqnptQjOmIlrth77vTl9SvfJTXEUr/RKuPU 22 | Y9WsLspanzjuoH08ee7UKyR7K1jgXQbcfnPbBlOxOc/fkounv23Pzdb7rLliPUsv 23 | cKxIqQ1huZ7vrzr7u72CSRp3AOf72WqblQ6EZgXOwb/2+8nqp7kDIpGk7k4o537V 24 | xX4aLqlfZpeyDVn87Q1zRY3fpFQ08STVAEAqJTfHXHZKZrv9FDoYyV/Z9m7IyY29 25 | k9rXhnFx6TtHYSro2juGiFgES15DyyeDS6MFqu4gy2qS6WSr3Xj4Dh8OiGLYriPu 26 | g3f3klbWCvDn2vxywt0FWnkVxTtGM5NnxmrMyH4oqTMOestmkb3OE1AWw14251QY 27 | VOE8zk5vhr5eGYGiQtRwBSvyrhR43Gc9uErh4ojaHwMhwSJ+I5xWbu+KQD3vri9e 28 | wZ4Lbj66C9MlLELlbs2HGQ0U+GL65SsMaYBX5rRK0/STTdVGJzgOdcgpAm/6CuXy 29 | dt2S+udBSNxH9GsoFY7EmEmHk8kzyfeLHGQBfTA+MBiT/+O5boz9G+KJnHCMIby2 30 | WQ8= 31 | -----END CERTIFICATE----- 32 | 33 | -------------------------------------------------------------------------------- /qml/CarParking.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Item { 44 | height: root.height 45 | width: root.width / 3 46 | Image { 47 | id: carImage 48 | height: root.height / 3 49 | anchors.verticalCenter: parent.verticalCenter 50 | anchors.horizontalCenter: parent.horizontalCenter 51 | fillMode: Image.PreserveAspectFit 52 | source:"qrc:/images/CarForParkSensors.png" 53 | } 54 | Image { 55 | anchors.left: carImage.left 56 | anchors.leftMargin: 5 57 | anchors.bottom: carImage.bottom 58 | anchors.bottomMargin: carImage.height * 0.86 59 | source:"qrc:/images/ParkingSensorOff.png" 60 | z: 1 61 | } 62 | Image { 63 | scale: -1 64 | anchors.left: carImage.left 65 | anchors.leftMargin: 5 66 | anchors.top: carImage.top 67 | anchors.topMargin: carImage.height * 0.86 68 | source:"qrc:/images/ParkingSensorOff.png" 69 | z: 1 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /qml/CarParkingSports.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | import QtQuick 2.0 52 | 53 | Item { 54 | Image { 55 | id: carImage 56 | height: root.height / 3 57 | anchors.verticalCenter: parent.verticalCenter 58 | anchors.horizontalCenter: parent.horizontalCenter 59 | fillMode: Image.PreserveAspectFit 60 | source:"image://etc/SportCarForParkSensors.png" 61 | } 62 | Image { 63 | anchors.horizontalCenter: carImage.horizontalCenter 64 | anchors.leftMargin: 5 65 | anchors.bottom: carImage.bottom 66 | anchors.bottomMargin: carImage.height * 0.9 67 | source:"image://etc/ParkingSensorOff.png" 68 | z: 1 69 | } 70 | Image { 71 | scale: -1 72 | anchors.horizontalCenter: carImage.horizontalCenter 73 | anchors.leftMargin: 5 74 | anchors.top: carImage.top 75 | anchors.topMargin: carImage.height * 0.86 76 | source:"image://etc/ParkingSensorOff.png" 77 | z: 1 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /qml/CarViewElectric.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL3$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPLv3 included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 3 requirements 23 | ** will be met: https://www.gnu.org/licenses/lgpl.html. 24 | ** 25 | ** GNU General Public License Usage 26 | ** Alternatively, this file may be used under the terms of the GNU 27 | ** General Public License version 2.0 or later as published by the Free 28 | ** Software Foundation and appearing in the file LICENSE.GPL included in 29 | ** the packaging of this file. Please review the following information to 30 | ** ensure the GNU General Public License version 2.0 requirements will be 31 | ** met: http://www.gnu.org/licenses/gpl-2.0.html. 32 | ** 33 | ** $QT_END_LICENSE$ 34 | ** 35 | ****************************************************************************/ 36 | 37 | import QtQuick 2.0 38 | import QtQuick.Scene3D 2.0 39 | 40 | Item { 41 | id: mainview 42 | visible: true 43 | width: root.width / 3 44 | height: root.height 45 | property alias hidden: carModel.hidden 46 | 47 | Scene3D { 48 | id: carScene 49 | width: mainview.width 50 | height: mainview.height 51 | multisample: true 52 | 53 | CarModelElectric { 54 | id: carModel 55 | scene: carScene 56 | } 57 | } 58 | 59 | // Functions to control highlights from dashboard 60 | function highlightLamp() { 61 | var type = carModel.highlightLamp() 62 | carModel.toggleIdleTimer(true) 63 | resetModelTimer.restart() 64 | return type 65 | } 66 | 67 | function highlightDoors(doors) { 68 | doorAction = true 69 | carModel.doorAction = true 70 | carModel.highlightOpenDoors(doors) 71 | carModel.toggleIdleTimer(true) 72 | resetModelTimer.restart() 73 | } 74 | 75 | function highlightTire() { 76 | var type = carModel.highlightTire() 77 | carModel.toggleIdleTimer(true) 78 | resetModelTimer.restart() 79 | return type 80 | } 81 | 82 | Timer { 83 | id: resetModelTimer 84 | interval: 3000 85 | running: false 86 | onTriggered: { 87 | carModel.resetHighlight() 88 | carModelHighlightType = 0 89 | actionInProgress = false 90 | doorAction = false 91 | if (!rightStack.visible) // return previous view if we forced the car model 92 | returnView.start() 93 | if (visible) 94 | carModel.toggleIdleTimer(true) 95 | } 96 | } 97 | 98 | onVisibleChanged: { 99 | // Start/stop idle timer, that will trigger camera rotation around the car model after X secs 100 | carModel.toggleIdleTimer(visible) 101 | } 102 | 103 | // TODO: Don't use if car view is not the first one 104 | Component.onCompleted: { 105 | // Start/stop idle timer, that will trigger camera rotation around the car model after X secs 106 | carModel.toggleIdleTimer(visible) 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /qml/CarViewSports.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL3$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPLv3 included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 3 requirements 23 | ** will be met: https://www.gnu.org/licenses/lgpl.html. 24 | ** 25 | ** GNU General Public License Usage 26 | ** Alternatively, this file may be used under the terms of the GNU 27 | ** General Public License version 2.0 or later as published by the Free 28 | ** Software Foundation and appearing in the file LICENSE.GPL included in 29 | ** the packaging of this file. Please review the following information to 30 | ** ensure the GNU General Public License version 2.0 requirements will be 31 | ** met: http://www.gnu.org/licenses/gpl-2.0.html. 32 | ** 33 | ** $QT_END_LICENSE$ 34 | ** 35 | ****************************************************************************/ 36 | 37 | import QtQuick 2.0 38 | import QtQuick.Scene3D 2.0 39 | 40 | Item { 41 | id: mainview 42 | visible: true 43 | width: root.width / 3 44 | height: root.height 45 | property alias hidden: carModel.hidden 46 | 47 | Scene3D { 48 | id: carScene 49 | width: mainview.width 50 | height: mainview.height 51 | multisample: true 52 | 53 | CarModelSports { 54 | id: carModel 55 | scene: carScene 56 | } 57 | } 58 | 59 | // Functions to control highlights from dashboard 60 | function highlightLamp() { 61 | var type = carModel.highlightLamp() 62 | carModel.toggleIdleTimer(true) 63 | resetModelTimer.restart() 64 | return type 65 | } 66 | 67 | function highlightDoors(doors) { 68 | doorAction = true 69 | carModel.doorAction = true 70 | carModel.highlightOpenDoors(doors) 71 | carModel.toggleIdleTimer(true) 72 | resetModelTimer.restart() 73 | } 74 | 75 | function highlightTire() { 76 | var type = carModel.highlightTire() 77 | carModel.toggleIdleTimer(true) 78 | resetModelTimer.restart() 79 | return type 80 | } 81 | 82 | Timer { 83 | id: resetModelTimer 84 | interval: 3000 85 | running: false 86 | onTriggered: { 87 | carModel.resetHighlight() 88 | carModelHighlightType = 0 89 | doorAction = false 90 | actionInProgress = false 91 | if (!centerStack.visible) // return previous view if we forced the car model 92 | returnView.start() 93 | if (visible) 94 | carModel.toggleIdleTimer(true) 95 | } 96 | } 97 | 98 | onVisibleChanged: { 99 | // Start/stop idle timer, that will trigger camera rotation around the car model after X secs 100 | carModel.toggleIdleTimer(visible) 101 | } 102 | 103 | // TODO: Don't use if car view is not the first one 104 | Component.onCompleted: { 105 | // Start/stop idle timer, that will trigger camera rotation around the car model after X secs 106 | carModel.toggleIdleTimer(visible) 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /qml/FpsCounter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | 43 | Item { 44 | id: fpscounter 45 | property real fpsNow: 0 46 | property bool running: false 47 | property alias fpsVisible: fpsLabel.visible 48 | property int fpsInterval: 1000 49 | property alias color: fpsLabel.color 50 | 51 | Item { 52 | id: swapTest 53 | property real t 54 | NumberAnimation on t { 55 | running: fpscounter.running 56 | from: 0 57 | to: 1 58 | duration: fpsInterval 59 | loops: Animation.Infinite 60 | } 61 | onTChanged: { 62 | ++fpsTimer.tick 63 | } 64 | } 65 | 66 | Timer { 67 | id: fpsTimer 68 | running: fpscounter.running 69 | repeat: true 70 | interval: fpsInterval 71 | property var lastFrameTime: new Date() 72 | property int tick 73 | 74 | onTriggered: { 75 | var now = new Date() 76 | var dt = now.getTime() - lastFrameTime.getTime() 77 | lastFrameTime = now 78 | var fps = (tick * fpsInterval) / dt 79 | fpsNow = Math.round(fps * 10) / 10 80 | tick = 0 81 | 82 | if (fpsVisible) 83 | fpsLabel.updateYerself() 84 | } 85 | } 86 | 87 | Text { 88 | id: fpsLabel 89 | visible: false 90 | 91 | anchors.centerIn: parent 92 | font.pixelSize: 10 93 | color: "white" 94 | 95 | function updateYerself() { 96 | text = Math.round(fpsNow) 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /qml/MapView.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | import QtLocation 5.5 43 | import QtPositioning 5.5 44 | import QtGraphicalEffects 1.0 45 | import ClusterDemo 1.0 46 | 47 | Item { 48 | width: root.width / 3 49 | height: width 50 | 51 | Map { 52 | id: map 53 | width: parent.width + 300 54 | height: parent.height + 300 55 | x: -150 56 | y: -150 57 | property real speed 58 | 59 | plugin: Plugin { 60 | id: plugin 61 | preferred: ["mapbox"] 62 | PluginParameter { name: "mapbox.access_token"; value: "pk.eyJ1IjoicXRjbHVzdGVyIiwiYSI6ImZiYTNiM2I0MDE2NmNlYmY0ZmM5NWMzZDVmYzI4NjFlIn0.uk3t7Oi9lDByIJd2E0vRWg" } 63 | PluginParameter { name: "mapbox.map_id"; value: "qtcluster.ndeb6ce6" } 64 | } 65 | 66 | center: QtPositioning.coordinate(ValueSource.latitude, ValueSource.longitude) 67 | 68 | zoomLevel: 16 69 | 70 | enabled: false 71 | 72 | rotation: -ValueSource.direction 73 | 74 | Behavior on rotation { 75 | RotationAnimation { 76 | duration: 2000 77 | direction: RotationAnimation.Shortest 78 | } 79 | } 80 | 81 | // uncomment ifndef QTIVIVEHICLEFUNCTIONS 82 | // PositionSource { 83 | // id: positionSource 84 | // nmeaSource: "qrc:/qml/route.txt" 85 | // onPositionChanged: { 86 | 87 | // if (position.speedValid) { 88 | // // center the map on the current position 89 | // if (position.direction > 0) { 90 | // map.rotation = -position.direction 91 | // map.center = position.coordinate 92 | // } 93 | 94 | // ValueSource.kph = position.speed * 3.6 95 | // ValueSource.oldSpeed.shift() 96 | // ValueSource.oldSpeed.push(position.speed * 3.6) 97 | // ValueSource.speedChanged() 98 | // //routeStopped.restart() 99 | // } 100 | // } 101 | // } 102 | // Component.onCompleted:{ 103 | // positionSource.start() 104 | // //routeStopped.running = true 105 | // } 106 | // end comment 107 | 108 | Behavior on center { 109 | id: centerBehavior 110 | enabled: true 111 | CoordinateAnimation { duration: 1500 } 112 | } 113 | } 114 | 115 | FastBlur { 116 | anchors.fill: map 117 | source: map 118 | radius: 0.01 119 | rotation: map.rotation 120 | } 121 | 122 | Image { 123 | id: positionImage 124 | anchors.centerIn: parent 125 | source: mapPositionImage 126 | } 127 | 128 | Text { 129 | color: "white" 130 | anchors.bottom: parent.bottom 131 | anchors.horizontalCenter: parent.horizontalCenter 132 | anchors.bottomMargin: (ValueSource.carId === 0) ? 75 : 0 133 | font.pixelSize: 9 134 | text:"© Mapbox © OpenStreetMap" 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /qml/MediaPlayerView.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | import ClusterDemo 1.0 44 | 45 | Item { 46 | id: playerView 47 | 48 | property real xCenter: remainingTimeImage.width / 2 49 | property real yCenter: remainingTimeImage.height / 2 50 | property var timeElapsed: ValueSource.musicElapsed 51 | 52 | Image { 53 | id: musicCover 54 | anchors.top: parent.top 55 | anchors.topMargin: (ValueSource.carId === 0) ? 160 : 70 56 | anchors.horizontalCenter: parent.horizontalCenter 57 | source: "image://etc/MusicPlayer_Cover.png" 58 | } 59 | 60 | Image { 61 | id: remainingTimeImage 62 | anchors.centerIn: musicCover 63 | source: "image://etc/MusicPlayer_CircleRemaining.png" 64 | } 65 | 66 | Text { 67 | id: song 68 | anchors.top: remainingTimeImage.bottom 69 | anchors.topMargin: 10 70 | anchors.horizontalCenter: remainingTimeImage.horizontalCenter 71 | text: "Tonight's the Night \n(Gonna Be Alright)" 72 | font.pixelSize: 12 73 | color: "white" 74 | } 75 | Text { 76 | anchors.top: song.bottom 77 | anchors.horizontalCenter: song.horizontalCenter 78 | text: "ROD STEWART" 79 | font.pixelSize: 10 80 | color: "white" 81 | } 82 | 83 | function paintBackground(ctx) { 84 | ctx.beginPath() 85 | ctx.lineWidth = 2 86 | ctx.strokeStyle = "white" 87 | ctx.arc(xCenter, yCenter, yCenter - ctx.lineWidth / 2, 1.5 * Math.PI, 88 | 2 * Math.PI * timeElapsed / 100 + 1.5 * Math.PI) 89 | ctx.stroke() 90 | } 91 | 92 | Canvas { 93 | id: canvas 94 | width: remainingTimeImage.width 95 | height: width 96 | anchors.centerIn: musicCover 97 | onPaint: { 98 | var ctx = getContext("2d") 99 | ctx.reset() 100 | paintBackground(ctx) 101 | } 102 | } 103 | onTimeElapsedChanged: { 104 | canvas.requestPaint() 105 | } 106 | 107 | //Do not play music timer if view not visible 108 | Component.onCompleted: ValueSource.musicTimer.running = true 109 | onVisibleChanged: { 110 | if (!visible) 111 | ValueSource.musicTimer.running = false 112 | else 113 | ValueSource.musicTimer.running = true 114 | } 115 | } 116 | 117 | -------------------------------------------------------------------------------- /qml/TurnIndicator.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | 44 | Item { 45 | property int direction: Qt.NoArrow 46 | property bool active: false 47 | property bool flashing: false 48 | 49 | property url iconOn: "image://etc/Icon_TurnLeft_ON.png" 50 | property url iconOff: "image://etc/Icon_TurnLeft_OFF.png" 51 | 52 | Timer { 53 | interval: 500 54 | running: (direction !== Qt.NoArrow) 55 | repeat: true 56 | onTriggered: flashing = !flashing 57 | } 58 | 59 | Image { 60 | source: (active && flashing) ? iconOn : iconOff 61 | mirror: direction === Qt.RightArrow 62 | anchors.centerIn: parent 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /qml/VideoView.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.5 42 | import QtMultimedia 5.5 43 | import ClusterDemo 1.0 44 | 45 | Item { 46 | property alias imageSource: overlay.source 47 | 48 | visible: true 49 | 50 | /* TODO replace with image */ 51 | MediaPlayer { 52 | id: video 53 | autoPlay: false 54 | muted: true 55 | //source: "file:///data/user/qt/qtcluster/video/reversing_video.3gp" 56 | // Switch to still image after reversing video is finished, or an error occurs 57 | onError: { 58 | stillView.visible = true 59 | console.log("Error playing video: " + error + ": " + errorString) 60 | } 61 | onStatusChanged: { 62 | if (status === MediaPlayer.EndOfMedia) 63 | stillView.visible = true 64 | } 65 | } 66 | 67 | VideoOutput { 68 | id: videoOutput 69 | 70 | source: video //camera 71 | anchors.centerIn: parent 72 | height: 480 - 180 73 | width: 1280 / 2.1 74 | fillMode: Image.Stretch 75 | 76 | Image { 77 | id: stillView 78 | visible: false 79 | anchors.centerIn: parent 80 | source: "image://etc/RearCameraStill.jpg" 81 | height: videoOutput.height 82 | width: videoOutput.width 83 | } 84 | 85 | Image { 86 | id: overlay 87 | visible: ValueSource.gear === -1 88 | anchors.horizontalCenter: parent.horizontalCenter 89 | anchors.bottom: parent.bottom 90 | } 91 | } 92 | 93 | onVisibleChanged: { 94 | if (visible) { 95 | stillView.visible = false 96 | video.play() 97 | 98 | } else { 99 | video.stop() 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /qml/dash_hybrid/CarInfoField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | import QtQuick 2.0 52 | 53 | Column { 54 | spacing: 20 / 1.5 55 | 56 | property string value: "" 57 | property string title: "" 58 | property string unit: "KM" 59 | 60 | Row { 61 | anchors.horizontalCenter: parent.horizontalCenter 62 | 63 | Text { 64 | text: value 65 | font.pixelSize: 24 66 | color: "lightGray" 67 | } 68 | Text { 69 | text: unit 70 | font.pixelSize: 16 71 | color: "lightGray" 72 | } 73 | } 74 | 75 | Text { 76 | text: title 77 | font.pixelSize: 16 78 | horizontalAlignment: Text.AlignHCenter 79 | color: "lightGray" 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /qml/dash_hybrid/CenterView.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | 44 | Item { 45 | anchors.fill: parent 46 | property real defaultScale: 1.0 47 | property var previousView: calendarView 48 | property bool view: ValueSource.viewChange 49 | 50 | property int viewNumber: -1 51 | 52 | 53 | CenterViewMusic { 54 | id: musicView 55 | anchors.horizontalCenter: parent.horizontalCenter 56 | yTarget: 230 57 | width: 124 58 | height: 124 59 | visible: false 60 | y: defaultYPos 61 | } 62 | 63 | CenterViewContacts { 64 | id: contactView 65 | anchors.horizontalCenter: parent.horizontalCenter 66 | yTarget: 240 67 | width: 100 68 | height: 100 69 | visible: false 70 | y: defaultYPos 71 | } 72 | 73 | CenterViewCarInfo { 74 | id: carinfoView 75 | xTarget: (parent.width - width) / 2 76 | anchors.top: parent.top 77 | anchors.topMargin: 230 78 | width: 146 79 | height: 80 80 | x: defaultXPos 81 | visible: false 82 | } 83 | 84 | CenterViewCalendar { 85 | id: calendarView 86 | xTarget: (parent.width - width) / 2 87 | anchors.top: parent.top 88 | anchors.topMargin: 230 89 | width: 100 90 | height: 91 91 | x: defaultXPos 92 | visible: false 93 | } 94 | 95 | PropertyAnimation { 96 | id: shrinkCenter 97 | property: "scale" 98 | to: 0.0 99 | running: false 100 | duration: 500 101 | onStopped: { 102 | if (target != null) 103 | target.visible = false 104 | } 105 | } 106 | 107 | function handleViewChange(number) { 108 | var currentView 109 | if (number === 0) 110 | currentView = musicView 111 | else if (number === 1) 112 | currentView = contactView 113 | else if (number === 2) 114 | currentView = carinfoView 115 | else if (number === 3) 116 | currentView = calendarView 117 | if (previousView !== currentView) { 118 | currentView.scale = defaultScale 119 | currentView.visible = true 120 | shrinkCenter.target = previousView 121 | previousView = currentView 122 | shrinkCenter.start() 123 | } 124 | } 125 | 126 | onViewChanged: { 127 | if (view) { 128 | if (++viewNumber > 3) 129 | viewNumber = 0 130 | handleViewChange(viewNumber) 131 | } 132 | } 133 | 134 | // Used on automatic demo mode 135 | Timer { 136 | id: centerTimer 137 | property int viewNumber: -1 138 | running: ValueSource.automaticDemoMode 139 | repeat: true 140 | interval: 6000 141 | onTriggered: { 142 | if (++viewNumber > 3) 143 | viewNumber = 0 144 | handleViewChange(viewNumber) 145 | } 146 | } 147 | 148 | function stopAll() { 149 | centerTimer.stop() 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /qml/dash_hybrid/CenterViewCalendar.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 Pelagicore AG 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Neptune IVI UI. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-QTAS$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt Automotive Suite licenses may use 11 | ** this file in accordance with the commercial license agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and The Qt Company. For 14 | ** licensing terms and conditions see https://www.qt.io/terms-conditions. 15 | ** For further information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ** SPDX-License-Identifier: GPL-3.0 29 | ** 30 | ****************************************************************************/ 31 | 32 | import QtQuick 2.6 33 | 34 | Item { 35 | id: calendarContainer 36 | 37 | property string appointment: "No appointments" 38 | property var currentDate 39 | property string date 40 | property string time 41 | opacity: 0.5 42 | property alias xTarget: startupAnimation.to 43 | property int defaultXPos: 200 44 | 45 | Image { 46 | id: image 47 | source: "image://etc/calendar.png" 48 | } 49 | 50 | Text { 51 | id: dateText 52 | anchors.top: image.bottom 53 | anchors.topMargin: 10 54 | anchors.horizontalCenter: image.horizontalCenter 55 | text: date 56 | color: "gray" 57 | font.pixelSize: 16 58 | } 59 | 60 | Text { 61 | id: timeText 62 | anchors.top: dateText.bottom 63 | anchors.horizontalCenter: image.horizontalCenter 64 | text: time 65 | color: "gray" 66 | font.pixelSize: 20 67 | } 68 | 69 | Text { 70 | anchors.top: timeText.bottom 71 | anchors.horizontalCenter: image.horizontalCenter 72 | text: appointment 73 | color: "lightGray" 74 | font.pixelSize: 14 75 | } 76 | 77 | Timer { 78 | id: fadeOutTimer 79 | interval: 5000 80 | running: false 81 | repeat: false 82 | onTriggered: { 83 | calendarContainer.opacity = 0.5 84 | } 85 | } 86 | 87 | Behavior on opacity { PropertyAnimation { duration: 500 } } 88 | 89 | PropertyAnimation on x { 90 | id: startupAnimation 91 | duration: 500 92 | easing.type: Easing.InCubic 93 | onStopped: { 94 | calendarContainer.opacity = 1.0 95 | fadeOutTimer.start() 96 | } 97 | } 98 | 99 | onVisibleChanged: { 100 | if (visible) { 101 | currentDate = new Date() 102 | date = currentDate.toLocaleDateString(Qt.locale("en_GB")) 103 | time = currentDate.toLocaleTimeString(Qt.locale("en_GB"), "hh:mm") 104 | x = defaultXPos 105 | startupAnimation.start() 106 | } 107 | } 108 | } 109 | 110 | -------------------------------------------------------------------------------- /qml/dash_hybrid/CenterViewCarInfo.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 Pelagicore AG 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Neptune IVI UI. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-QTAS$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt Automotive Suite licenses may use 11 | ** this file in accordance with the commercial license agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and The Qt Company. For 14 | ** licensing terms and conditions see https://www.qt.io/terms-conditions. 15 | ** For further information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ** SPDX-License-Identifier: GPL-3.0 29 | ** 30 | ****************************************************************************/ 31 | 32 | import QtQuick 2.6 33 | import ClusterDemo 1.0 34 | 35 | Item { 36 | id: carinfoContainer 37 | 38 | property int total: ValueSource.totalDistance 39 | property int sinceLast: ValueSource.kmSinceCharge 40 | opacity: 0.5 41 | property alias xTarget: startupAnimation.to 42 | property int defaultXPos: 900 43 | 44 | Image { 45 | id: image 46 | source: "image://etc/CarInfoIcon.png" 47 | } 48 | 49 | Row { 50 | scale: 0.75 51 | spacing: 7 52 | anchors.top: image.bottom 53 | anchors.horizontalCenter: image.horizontalCenter 54 | 55 | CarInfoField { 56 | title: "Total distance" 57 | value: carinfoContainer.total.toFixed().toString() 58 | unit: "km" 59 | } 60 | 61 | CarInfoField { 62 | title: "Since last\ncharge" 63 | value: carinfoContainer.sinceLast.toString() 64 | unit: "km" 65 | } 66 | } 67 | 68 | Timer { 69 | id: fadeOutTimer 70 | interval: 5000 71 | running: false 72 | repeat: false 73 | onTriggered: { 74 | carinfoContainer.opacity = 0.5 75 | } 76 | } 77 | 78 | Behavior on opacity { PropertyAnimation { duration: 500 } } 79 | 80 | PropertyAnimation on x { 81 | id: startupAnimation 82 | duration: 500 83 | easing.type: Easing.InCubic 84 | onStopped: { 85 | carinfoContainer.opacity = 1.0 86 | fadeOutTimer.start() 87 | } 88 | } 89 | 90 | onVisibleChanged: { 91 | if (visible) { 92 | x = defaultXPos 93 | startupAnimation.start() 94 | } 95 | } 96 | } 97 | 98 | -------------------------------------------------------------------------------- /qml/dash_hybrid/CenterViewContacts.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 Pelagicore AG 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Neptune IVI UI. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-QTAS$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt Automotive Suite licenses may use 11 | ** this file in accordance with the commercial license agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and The Qt Company. For 14 | ** licensing terms and conditions see https://www.qt.io/terms-conditions. 15 | ** For further information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ** SPDX-License-Identifier: GPL-3.0 29 | ** 30 | ****************************************************************************/ 31 | 32 | import QtQuick 2.6 33 | 34 | Item { 35 | id: contactContainer 36 | opacity: 0.5 37 | property int defaultYPos: 50 38 | property alias icon: contactImage.source 39 | property alias name: contactName.text 40 | property alias yTarget: startupAnimation.to 41 | 42 | Image { 43 | id: contactImage 44 | source: "image://etc/contacts.png" 45 | } 46 | 47 | Text { 48 | id: title 49 | anchors.top: contactImage.bottom 50 | anchors.topMargin: 10 51 | anchors.horizontalCenter: contactImage.horizontalCenter 52 | text: contactContainer.name === "" ? "Browsing\ncontacts" : "Calling" 53 | color: "gray" 54 | font.pixelSize: 20 55 | } 56 | 57 | Text { 58 | id: contactName 59 | anchors.top: title.bottom 60 | anchors.horizontalCenter: contactImage.horizontalCenter 61 | color: "lightGray" 62 | font.pixelSize: 24 63 | } 64 | 65 | Timer { 66 | id: fadeOutTimer 67 | interval: 5000 68 | running: false 69 | repeat: false 70 | onTriggered: { 71 | fadeOut.start() 72 | } 73 | } 74 | 75 | PropertyAnimation on opacity { 76 | id: fadeIn 77 | to: 1.0 78 | duration: 500 79 | onStopped: { 80 | call.start() 81 | } 82 | } 83 | 84 | PropertyAnimation on opacity { 85 | id: fadeOut 86 | to: 0.5 87 | duration: 500 88 | } 89 | 90 | PropertyAnimation on y { 91 | id: startupAnimation 92 | duration: 500 93 | easing.type: Easing.InCubic 94 | onStopped: { 95 | fadeIn.start() 96 | fadeOutTimer.start() 97 | } 98 | } 99 | 100 | Timer { 101 | id: call 102 | interval: 2000 103 | running: false 104 | onTriggered: { 105 | name = "Jane" 106 | icon = "image://etc/jane.png" 107 | } 108 | } 109 | 110 | onVisibleChanged: { 111 | if (visible) { 112 | name = "" 113 | icon = "image://etc/contacts.png" 114 | y = defaultYPos 115 | startupAnimation.start() 116 | } 117 | } 118 | } 119 | 120 | -------------------------------------------------------------------------------- /qml/dash_hybrid/CenterViewMusic.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 Pelagicore AG 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Neptune IVI UI. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-QTAS$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt Automotive Suite licenses may use 11 | ** this file in accordance with the commercial license agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and The Qt Company. For 14 | ** licensing terms and conditions see https://www.qt.io/terms-conditions. 15 | ** For further information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ** SPDX-License-Identifier: GPL-3.0 29 | ** 30 | ****************************************************************************/ 31 | 32 | import QtQuick 2.6 33 | 34 | Item { 35 | id: musicContainer 36 | 37 | property url currentCover: "image://etc/cover.png" 38 | property string currentSong: "Doesn't Mean Anything" 39 | property string currentArtist: "Alicia Keys" 40 | opacity: 0.5 41 | property alias yTarget: startupAnimation.to 42 | property int defaultYPos: 400 43 | 44 | Rectangle { 45 | y: 10 46 | id: image 47 | width: 124 48 | height: 124 49 | border.color: "#EF2973" 50 | border.width: 2 51 | color: "black" 52 | 53 | Image { 54 | anchors.margins: 2 55 | fillMode: Image.PreserveAspectCrop 56 | anchors.fill: parent 57 | asynchronous: true 58 | source: musicContainer.currentCover 59 | } 60 | } 61 | 62 | Text { 63 | id: title 64 | anchors.top: image.bottom 65 | anchors.topMargin: 6 66 | anchors.horizontalCenter: image.horizontalCenter 67 | text: musicContainer.currentSong 68 | color: "gray" 69 | font.pixelSize: 16 70 | } 71 | 72 | Text { 73 | anchors.top: title.bottom 74 | anchors.horizontalCenter: image.horizontalCenter 75 | text: musicContainer.currentArtist 76 | color: "lightGray" 77 | font.pixelSize: 16 78 | } 79 | 80 | Timer { 81 | id: fadeOutTimer 82 | interval: 3000 83 | running: false 84 | repeat: false 85 | onTriggered: { 86 | musicContainer.opacity = 0.5 87 | } 88 | } 89 | 90 | Behavior on opacity { PropertyAnimation { duration: 500 } } 91 | 92 | PropertyAnimation on y { 93 | id: startupAnimation 94 | duration: 500 95 | easing.type: Easing.InCubic 96 | onStopped: { 97 | musicContainer.opacity = 1.0 98 | fadeOutTimer.start() 99 | } 100 | } 101 | 102 | onVisibleChanged: { 103 | if (visible) { 104 | y = defaultYPos 105 | startupAnimation.start() 106 | } 107 | } 108 | } 109 | 110 | -------------------------------------------------------------------------------- /qml/dash_hybrid/Dashboard.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | import "gauges" 44 | 45 | DashboardForm 46 | { 47 | id: dashboardEntity 48 | 49 | state: "start" 50 | 51 | meterOpacity: 0.0 52 | 53 | anchors.fill: parent 54 | 55 | property real timeScaleMultiplier: 1.5 56 | property bool startupAnimationsFinished: false 57 | 58 | //onNeedleRotationChanged: speedometer.speedometerNeedleRotation = needleRotation / 40. 59 | 60 | property bool animationStopped: ValueSource.runningInDesigner ? true : startupAnimationsFinished 61 | 62 | speedometer.actualValue: animationStopped ? ValueSource.kph : -needleRotation / 40 63 | 64 | tachometer.actualValue: animationStopped ? ValueSource.rpm : -needleRotation 65 | 66 | speedText.text: speedometer.actualValue.toFixed().toString() 67 | consumptionMeter.actualValue: 2.0 + ValueSource.rpm / 320.45 68 | 69 | 70 | // 71 | // Startup animations 72 | // 73 | SequentialAnimation { 74 | id: speedometerStartupAnimations 75 | running: true 76 | 77 | PauseAnimation { duration: 1000 } 78 | ScriptAction { script: bottompanel.visible = true } 79 | 80 | SmoothedAnimation { 81 | target: dashboardEntity 82 | property: "bottomPanelY" 83 | from: 480 84 | to: 412 85 | duration: 1000 * timeScaleMultiplier 86 | easing.type: Easing.InCirc 87 | } 88 | 89 | PauseAnimation { 90 | duration: 1000 91 | } 92 | 93 | NumberAnimation { 94 | target: dashboardEntity 95 | property: "meterOpacity" 96 | from: 0 97 | to: 1 98 | duration: 2000 99 | } 100 | 101 | SmoothedAnimation { 102 | target: dashboardEntity 103 | property: "needleRotation" 104 | from: 0.0 105 | to: -8000.0 106 | duration: 1000 * timeScaleMultiplier 107 | easing.type: Easing.InCubic 108 | } 109 | 110 | SmoothedAnimation { 111 | target: dashboardEntity 112 | property: "needleRotation" 113 | from: -8000.0 114 | to: 0.0 115 | duration: 1000 * timeScaleMultiplier 116 | easing.type: Easing.OutCubic 117 | } 118 | 119 | ScriptAction { script: startupAnimationsFinished = true } 120 | } 121 | 122 | function stopAll() { 123 | speedometerStartupAnimations.stop() 124 | } 125 | 126 | bottompanel.visible: false 127 | bottompanel.y: 480 128 | } 129 | -------------------------------------------------------------------------------- /qml/dash_hybrid/DashboardBackground.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.4 42 | 43 | DashboardBackgroundForm { 44 | id: dashboard 45 | 46 | state: "normal" 47 | 48 | Timer { 49 | running: true 50 | interval: 100 51 | onTriggered: dashboard.state = "normal" 52 | repeat: false 53 | } 54 | 55 | 56 | 57 | transitions: [ 58 | Transition { 59 | from: "*" 60 | to: "*" 61 | 62 | SequentialAnimation { 63 | 64 | ParallelAnimation { 65 | PropertyAnimation { 66 | target: dashboard.image 67 | properties: "opacity" 68 | duration: 1500 69 | } 70 | 71 | 72 | PropertyAnimation { 73 | target: dashboard.leftGauge 74 | properties: "scale, opacity" 75 | duration: 2000 76 | easing.type: Easing.InOutQuad 77 | } 78 | 79 | PropertyAnimation { 80 | target: dashboard.rightGauge 81 | properties: "scale, opacity" 82 | duration: 2000 83 | easing.type: Easing.InOutQuad 84 | } 85 | 86 | SequentialAnimation { 87 | 88 | PauseAnimation { 89 | duration: 200 90 | } 91 | PropertyAnimation { 92 | properties: "x,y" 93 | duration: 800 94 | easing.type: Easing.InOutQuad 95 | } 96 | } 97 | 98 | 99 | SequentialAnimation { 100 | PauseAnimation { 101 | duration: 1000 102 | } 103 | 104 | PropertyAnimation { 105 | target: dashboard 106 | property: "scale" 107 | easing.type: Easing.InOutQuad 108 | duration: 300 109 | } 110 | 111 | ParallelAnimation { 112 | PropertyAnimation { 113 | target: dashboard.leftGadget 114 | properties: "opacity, scale" 115 | duration: 400 116 | } 117 | PropertyAnimation { 118 | target: dashboard.rightGadget 119 | properties: "opacity, scale" 120 | duration: 400 121 | } 122 | PropertyAnimation { 123 | target: dashboard.center 124 | properties: "opacity, scale" 125 | duration: 400 126 | } 127 | PropertyAnimation { 128 | target: dashboard.bar 129 | properties: "opacity, scale" 130 | duration: 800 131 | } 132 | } 133 | } 134 | } 135 | } 136 | } 137 | ] 138 | } 139 | 140 | -------------------------------------------------------------------------------- /qml/dash_hybrid/DashboardBackgroundForm.ui.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.4 41 | import ClusterDemo 1.0 42 | 43 | Item { 44 | id: root 45 | width: 1280 46 | height: 480 47 | 48 | property alias center: center 49 | property alias rightGadget: rightGadget 50 | property alias bar: bar 51 | property alias leftGadget: leftGadget 52 | property alias image: image 53 | property alias rightGauge: rightGauge 54 | property alias leftGauge: leftGauge 55 | 56 | property real gaugeOpacity: 1 57 | 58 | Image { 59 | id: image 60 | source: "image://etc/Cluster8Gauges.png" 61 | 62 | Image { 63 | id: center 64 | x: 568 65 | y: 19 66 | source: "image://etc/center.png" 67 | 68 | Image { 69 | x: -140 70 | y: -122 71 | anchors.horizontalCenter: parent.horizontalCenter 72 | anchors.verticalCenter: parent.verticalCenter 73 | 74 | source: "image://etc/knob_small.png" 75 | } 76 | } 77 | 78 | Image { 79 | id: rightGadget 80 | x: 718 81 | y: 29 82 | source: "image://etc/right.png" 83 | } 84 | 85 | Image { 86 | id: leftGadget 87 | x: 417 88 | y: 28 89 | source: "image://etc/left.png" 90 | } 91 | 92 | Image { 93 | id: bar 94 | x: 531 95 | y: 159 96 | source: "image://etc/temperature.png" 97 | } 98 | } 99 | 100 | Image { 101 | id: leftGauge 102 | x: 318 103 | y: 393 104 | source: "image://etc/leftgauge.png" 105 | } 106 | 107 | Image { 108 | id: rightGauge 109 | x: 652 110 | y: 394 111 | source: "image://etc/rightgauge.png" 112 | } 113 | states: [ 114 | State { 115 | name: "start" 116 | 117 | PropertyChanges { 118 | target: leftGauge 119 | x: 13 120 | y: 169 121 | width: 339 122 | height: 340 123 | opacity: 0 124 | scale: 0.7 125 | } 126 | 127 | PropertyChanges { 128 | target: rightGauge 129 | x: 930 130 | y: 169 131 | width: 330 132 | height: 340 133 | opacity: 0 134 | scale: 0.7 135 | } 136 | 137 | PropertyChanges { 138 | target: root 139 | scale: 0.8 140 | gaugeOpacity: 0 141 | } 142 | 143 | PropertyChanges { 144 | target: image 145 | opacity: 0.2 146 | } 147 | 148 | PropertyChanges { 149 | target: leftGadget 150 | scale: 0.8 151 | opacity: 0 152 | } 153 | 154 | PropertyChanges { 155 | target: center 156 | opacity: 0 157 | scale: 0.8 158 | } 159 | 160 | PropertyChanges { 161 | target: rightGadget 162 | scale: 0.8 163 | opacity: 0 164 | } 165 | 166 | PropertyChanges { 167 | target: bar 168 | scale: 0.8 169 | opacity: 0 170 | } 171 | }, 172 | State { 173 | name: "normal" 174 | 175 | PropertyChanges { 176 | target: leftGauge 177 | x: 102 178 | y: 75 179 | } 180 | 181 | PropertyChanges { 182 | target: rightGauge 183 | x: 832 184 | y: 71 185 | } 186 | } 187 | ] 188 | } 189 | -------------------------------------------------------------------------------- /qml/dash_hybrid/DashboardFrame.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | 44 | Rectangle 45 | { 46 | width: 1280 47 | height: 480 48 | color: "black" 49 | 50 | 51 | Image { 52 | id: logo 53 | anchors.horizontalCenter: parent.horizontalCenter 54 | y: 270 55 | source: "image://etc/Built_with_Qt.png" 56 | } 57 | 58 | Loader { 59 | id: dashLoader 60 | anchors.fill: parent 61 | source: "DashboardView.qml" 62 | active: logo.status === Image.Ready 63 | transform: Rotation { 64 | id: rot 65 | origin.x: 1280 / 2 66 | origin.y: 0 67 | axis { x: 1; y: 0; z: 0 } 68 | angle: ValueSource.runningInDesigner ? 0 : 90 // the default angle 69 | 70 | } 71 | onLoaded: flipin.start() 72 | } 73 | 74 | SequentialAnimation { 75 | id: flipin 76 | PauseAnimation { duration: 500 } 77 | SmoothedAnimation { target: rot; property: "angle"; from: 90; to: 0; duration: 500 } 78 | PauseAnimation { duration: 2500 } 79 | OpacityAnimator { target: logo; from: 1.0; to: 0; duration: 500 } 80 | } 81 | 82 | function stopAll() { 83 | dashLoader.item.stopAll() 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /qml/dash_hybrid/DashboardView.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL3$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPLv3 included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 3 requirements 23 | ** will be met: https://www.gnu.org/licenses/lgpl.html. 24 | ** 25 | ** GNU General Public License Usage 26 | ** Alternatively, this file may be used under the terms of the GNU 27 | ** General Public License version 2.0 or later as published by the Free 28 | ** Software Foundation and appearing in the file LICENSE.GPL included in 29 | ** the packaging of this file. Please review the following information to 30 | ** ensure the GNU General Public License version 2.0 requirements will be 31 | ** met: http://www.gnu.org/licenses/gpl-2.0.html. 32 | ** 33 | ** $QT_END_LICENSE$ 34 | ** 35 | ****************************************************************************/ 36 | 37 | import QtQuick 2.6 38 | 39 | Loader { 40 | id: centerview 41 | asynchronous: true 42 | anchors.fill: parent 43 | source: "CenterView.qml" 44 | 45 | Loader { 46 | id: dash 47 | asynchronous: true 48 | anchors.fill: parent 49 | source: "Dashboard.qml" 50 | z: 2 51 | } 52 | 53 | function stopAll() { 54 | centerview.item.stopAll() 55 | dash.item.stopAll() 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /qml/dash_hybrid/Gadget.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.4 42 | import QtGraphicalEffects 1.0 43 | 44 | Item { 45 | id: gadget 46 | 47 | width: 240 48 | height: 240 49 | 50 | property real value: 0 51 | property real minValue: 0 52 | property real maxValue: 200 53 | 54 | property real __t: value / (maxValue - minValue) 55 | 56 | property real __scale: __t * 1.04 + (1 - __t) * 0.85 * __scaleAnimation 57 | property real __scaleAnimation: 1 58 | 59 | property bool green: true 60 | 61 | 62 | SequentialAnimation { 63 | running: true 64 | loops: -1 65 | PropertyAnimation { 66 | 67 | target: gadget 68 | from: 1 69 | to: 0.95 70 | property: "__scaleAnimation" 71 | duration: 600 72 | } 73 | PropertyAnimation { 74 | target: gadget 75 | from: 0.95 76 | to: 1 77 | property: "__scaleAnimation" 78 | duration: 600 79 | } 80 | } 81 | 82 | Item { 83 | id: glow 84 | 85 | x: 34 86 | y: 31 87 | width: 185 88 | height: 185 89 | 90 | scale: gadget.__scale 91 | 92 | Rectangle { 93 | width: 115 94 | height: width 95 | radius: width / 2 96 | anchors.verticalCenter: parent.verticalCenter 97 | anchors.horizontalCenter: parent.horizontalCenter 98 | color: green ? "#0098c3" : "#a31e21" 99 | Behavior on color { 100 | ColorAnimation { 101 | duration: 400 102 | } 103 | } 104 | 105 | } 106 | 107 | layer.enabled: true 108 | layer.effect: FastBlur { 109 | radius: 32 110 | } 111 | } 112 | 113 | Image { 114 | id: knob 115 | x: 68 116 | y: 65 117 | source: "image://etc/knob.png" 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /qml/dash_hybrid/SafeRendererPicture.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | import QtQuick 2.6 52 | import QtQuick.Extras 1.4 53 | 54 | Picture { 55 | 56 | } 57 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/FpsMeter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import "../.." 43 | 44 | Item { 45 | id: fpsmeterNeedle 46 | 47 | property real fpsmeterNeedleRotation: fpsValue * fpsDegreesPerValue 48 | property real fpsValue: Math.min(fpscounter.fpsNow, 60) // Limit to 60, as that's where the gauge ends 49 | property real maxValueAngle: 314 50 | property real minValueAngle: 45 51 | property real maximumValue: 60 52 | property real fpsDegreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue) 53 | 54 | 55 | width: 107 56 | height: 7 57 | rotation: fpsmeterNeedleRotation - 45 58 | 59 | Image { 60 | anchors.left: parent.left 61 | anchors.leftMargin: -12 62 | anchors.verticalCenter: parent.verticalCenter 63 | source: "image://etc/SpeedometerNeedleSmall.png" 64 | } 65 | 66 | FpsCounter { 67 | id: fpscounter 68 | rotation: fpsVisible ? -fpsmeterNeedle.rotation : 0 69 | anchors.top: parent.top 70 | anchors.topMargin: 33 71 | anchors.horizontalCenter: parent.horizontalCenter 72 | fpsVisible: false // Setting this to true prints fps on screen 73 | running: startupAnimationsFinished 74 | } 75 | Behavior on fpsValue { 76 | enabled: startupAnimationsFinished 77 | PropertyAnimation { duration: fpscounter.fpsInterval } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/LargeMeter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | import QtGraphicalEffects 1.0 44 | 45 | Item { 46 | 47 | Rectangle { 48 | visible: false 49 | width: 86 50 | height: 86 51 | radius: 43 52 | color: "#3a5fe1" 53 | anchors.horizontalCenter: parent.horizontalCenter 54 | anchors.verticalCenter: parent.verticalCenter 55 | } 56 | 57 | width: 480 58 | height: 480 59 | 60 | id: speedometer 61 | 62 | property real speedometerNeedleRotation: 0.0 63 | 64 | property bool animationStopped: ValueSource.runningInDesigner ? true : startupAnimationsFinished 65 | 66 | property real actualValue: 90 67 | 68 | property real minValueAngle: 55 69 | property real maxValueAngle: 305 70 | property real minimumValue: 0 71 | property real maximumValue: 200 72 | 73 | property real limitValue: 100 74 | 75 | property real angleOffset: 35 76 | 77 | property alias fillWidth: speedFiller.fillWidth 78 | 79 | GaugeFiller { 80 | anchors.fill: parent 81 | id: speedFiller 82 | value: speedometer.actualValue 83 | numVertices: 64 84 | radius: 155 85 | fillWidth: 10 86 | color: speedometer.actualValue < speedometer.limitValue ? "#0098c3" : "#a31e21" 87 | opacity: 0.4 88 | minAngle: speedometer.minValueAngle 89 | maxAngle: speedometer.maxValueAngle 90 | minValue: speedometer.minimumValue 91 | maxValue: speedometer.maximumValue 92 | 93 | Behavior on color { 94 | ColorAnimation { 95 | duration: 1000 96 | } 97 | } 98 | } 99 | 100 | 101 | Item { 102 | id: speedometerNeedle 103 | width: needleImage.width 104 | height: needleImage.height 105 | rotation: speedFiller.angle - speedometer.angleOffset 106 | 107 | anchors.centerIn: parent 108 | 109 | Item { 110 | 111 | Image { 112 | x: -59 113 | y: -0.5 114 | source: "image://etc/SpeedometerNeedle.png" 115 | opacity: 1 116 | layer.enabled: true 117 | layer.effect: Colorize { 118 | hue: 0.5 119 | } 120 | Behavior on opacity { 121 | NumberAnimation { 122 | duration: 1000 123 | } 124 | } 125 | } 126 | Image { 127 | x: -59 128 | y: -0.5 129 | id: needleImage 130 | opacity: speedometer.actualValue < speedometer.limitValue ? 0 : 0.75 131 | source: "image://etc/SpeedometerNeedle.png" 132 | Behavior on opacity { 133 | NumberAnimation { 134 | duration: 1000 135 | } 136 | } 137 | layer.enabled: true 138 | layer.effect: Colorize { 139 | hue: 0.95 140 | } 141 | } 142 | 143 | } 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/NumberLabel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Text { 4 | id: text_0 5 | color: "#c6c6c6" 6 | text: "0" 7 | font.family: "Verdana" 8 | font.pixelSize: 14 9 | } 10 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/SmallMeter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | 44 | Item { 45 | id: meter 46 | width: 100 47 | height: 100 48 | 49 | property real meterNeedleRotation: direction * value * degreesPerValue 50 | property real value: 20 51 | 52 | property real maxValueAngle: 170 53 | property real minValueAngle: 10 54 | property real maximumValue: 100 55 | property real degreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue) 56 | 57 | property real rotationOffset: 80 58 | 59 | property real direction: 1 60 | 61 | Rectangle { 62 | visible: false 63 | color: "red" 64 | width: 10 65 | height: 10 66 | anchors.centerIn: parent 67 | } 68 | 69 | 70 | Item { 71 | width: image.width 72 | height: image.height 73 | 74 | rotation: meter.meterNeedleRotation - meter.rotationOffset 75 | anchors.centerIn: parent 76 | 77 | Image { 78 | id: image 79 | x: -23 80 | source: "image://etc/SpeedometerNeedleSmall.png" 81 | } 82 | 83 | } 84 | Behavior on value { 85 | enabled: !ValueSource.automaticDemoMode && startupAnimationsFinished 86 | PropertyAnimation { duration: 250 } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/TemperatureMeter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | 44 | Item { 45 | id: root 46 | property real temperatureValue: ValueSource.engineTemperature 47 | property real minValueAngle: 42.5 48 | property real maxValueAngle: -42.5 49 | property real minimumValue: 0 50 | property real maximumValue: 100 51 | 52 | GaugeFiller { 53 | id: temperatureFiller 54 | value: root.temperatureValue 55 | anchors.fill: parent 56 | numVertices: 32 57 | radius: 140 58 | fillWidth: 25 59 | color: "#EF2973" 60 | opacity: 0.3 61 | minAngle: root.minValueAngle 62 | maxAngle: root.maxValueAngle 63 | minValue: root.minimumValue 64 | maxValue: root.maximumValue 65 | Behavior on value { 66 | enabled: !ValueSource.automaticDemoMode && startupAnimationsFinished 67 | PropertyAnimation { duration: 250 } 68 | } 69 | } 70 | 71 | Item { 72 | width: 280 73 | height: 7 74 | rotation: temperatureFiller.angle - 48 75 | anchors.centerIn: parent 76 | 77 | Item { 78 | id: item1 79 | width: 34 80 | height: 7 81 | opacity: 0.75 82 | anchors.left: parent.left 83 | anchors.leftMargin: -4 84 | anchors.verticalCenter: parent.verticalCenter 85 | clip: true 86 | 87 | Image { 88 | x: -4 89 | anchors.verticalCenter: parent.verticalCenter 90 | source: "image://etc/SpeedometerNeedleSmall.png" 91 | } 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/TurboMeter.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ClusterDemo 1.0 43 | 44 | Item { 45 | property real turbometerNeedleRotation: turboValue * turboDegreesPerValue 46 | property real turboValue: ValueSource.rpm / 2000. 47 | property real maxValueAngle: 270 48 | property real minValueAngle: 0 49 | property real maximumValue: 4.0 50 | property real turboDegreesPerValue: Math.abs((maxValueAngle - minValueAngle) / maximumValue) 51 | 52 | anchors.left: parent.left 53 | anchors.top: parent.top 54 | anchors.leftMargin: 426 55 | anchors.topMargin: 93 56 | width: 109 57 | height: 7 58 | rotation: turbometerNeedleRotation - 90 59 | 60 | Image { 61 | width: 38 62 | height: 3 63 | anchors.left: parent.left 64 | anchors.verticalCenter: parent.verticalCenter 65 | source: "image://etc/SpeedometerNeedle.png" 66 | } 67 | Behavior on turboValue { 68 | enabled: !ValueSource.automaticDemoMode && startupAnimationsFinished 69 | PropertyAnimation { duration: 250 } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/designer/BatteryMeterSpecifics.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms 13 | ** and conditions see https://www.qt.io/terms-conditions. For further 14 | ** information use the contact form at https://www.qt.io/contact-us. 15 | ** 16 | ** GNU General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU 18 | ** General Public License version 3 as published by the Free Software 19 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 20 | ** included in the packaging of this file. Please review the following 21 | ** information to ensure the GNU General Public License requirements will 22 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 23 | ** 24 | ****************************************************************************/ 25 | 26 | import QtQuick 2.1 27 | import HelperWidgets 2.0 28 | import QtQuick.Layouts 1.0 29 | import QtQuick.Controls 1.0 as Controls 30 | 31 | Column { 32 | anchors.left: parent.left 33 | anchors.right: parent.right 34 | 35 | Section { 36 | anchors.left: parent.left 37 | anchors.right: parent.right 38 | caption: qsTr("BatteryMeter") 39 | SectionLayout { 40 | 41 | Label { 42 | text: qsTr("Battery Value") 43 | } 44 | 45 | SecondColumnLayout { 46 | SpinBox { 47 | backendValue: backendValues.batteryValue 48 | minimumValue: 0 49 | maximumValue: backendValues.maximumValue.value 50 | decimals: 0 51 | } 52 | 53 | Controls.Slider { 54 | id: batterySlider 55 | Layout.preferredWidth: 100 56 | 57 | minimumValue: 0 58 | maximumValue: backendValues.maximumValue.value 59 | updateValueWhileDragging: true 60 | stepSize: 1 61 | value: backendValues.batteryValue.value 62 | onValueChanged: { 63 | backendValues.batteryValue.value = batterySlider.value 64 | 65 | } 66 | 67 | } 68 | 69 | ExpandingSpacer { 70 | width: 30 71 | } 72 | } 73 | 74 | 75 | 76 | Label { 77 | text: qsTr("Maximum Battery") 78 | } 79 | 80 | SecondColumnLayout { 81 | SpinBox { 82 | backendValue: backendValues.maximumValue 83 | minimumValue: 0 84 | maximumValue: 1000 85 | decimals: 0 86 | } 87 | 88 | Controls.Slider { 89 | id: maximumFuelSlider 90 | Layout.preferredWidth: 100 91 | 92 | minimumValue: 0 93 | maximumValue: 1000 94 | updateValueWhileDragging: true 95 | stepSize: 1 96 | value: backendValues.maximumValue.value 97 | onValueChanged: { 98 | backendValues.maximumValue.value = maximumFuelSlider.value 99 | 100 | } 101 | 102 | } 103 | 104 | ExpandingSpacer { 105 | width: 30 106 | } 107 | } 108 | 109 | Label { 110 | text: qsTr("Maximum Value Angle") 111 | } 112 | 113 | SecondColumnLayout { 114 | SpinBox { 115 | backendValue: backendValues.maxValueAngle 116 | minimumValue: 0 117 | maximumValue: 360 118 | decimals: 0 119 | } 120 | 121 | Controls.Slider { 122 | id: maxValueAngleSlider 123 | Layout.preferredWidth: 100 124 | 125 | minimumValue: 0 126 | maximumValue: 360 127 | updateValueWhileDragging: true 128 | stepSize: 1 129 | value: backendValues.maxValueAngle.value 130 | onValueChanged: { 131 | backendValues.maxValueAngle.value = maxValueAngleSlider.value 132 | } 133 | 134 | } 135 | 136 | ExpandingSpacer { 137 | width: 30 138 | } 139 | } 140 | 141 | Label { 142 | text: qsTr("Minimum Value Angle") 143 | } 144 | 145 | 146 | SecondColumnLayout { 147 | SpinBox { 148 | backendValue: backendValues.minValueAngle 149 | minimumValue: 0 150 | maximumValue: 360 151 | decimals: 0 152 | } 153 | 154 | Controls.Slider { 155 | id: minValueAngleSlider 156 | Layout.preferredWidth: 100 157 | 158 | minimumValue: 0 159 | maximumValue: 360 160 | updateValueWhileDragging: true 161 | stepSize: 1 162 | value: backendValues.minValueAngle.value 163 | onValueChanged: { 164 | backendValues.minValueAngle.value = minValueAngleSlider.value 165 | } 166 | 167 | } 168 | 169 | ExpandingSpacer { 170 | width: 30 171 | } 172 | } 173 | 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/designer/FuelMeterSpecifics.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms 13 | ** and conditions see https://www.qt.io/terms-conditions. For further 14 | ** information use the contact form at https://www.qt.io/contact-us. 15 | ** 16 | ** GNU General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU 18 | ** General Public License version 3 as published by the Free Software 19 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 20 | ** included in the packaging of this file. Please review the following 21 | ** information to ensure the GNU General Public License requirements will 22 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 23 | ** 24 | ****************************************************************************/ 25 | 26 | import QtQuick 2.1 27 | import HelperWidgets 2.0 28 | import QtQuick.Layouts 1.0 29 | import QtQuick.Controls 1.0 as Controls 30 | 31 | Column { 32 | anchors.left: parent.left 33 | anchors.right: parent.right 34 | 35 | Section { 36 | anchors.left: parent.left 37 | anchors.right: parent.right 38 | caption: qsTr("FuelMeter") 39 | SectionLayout { 40 | 41 | Label { 42 | text: qsTr("Fuel Value") 43 | } 44 | 45 | SecondColumnLayout { 46 | SpinBox { 47 | backendValue: backendValues.fuelValue 48 | minimumValue: 0 49 | maximumValue: backendValues.maximumValue.value 50 | decimals: 0 51 | } 52 | 53 | Controls.Slider { 54 | id: fuelSlider 55 | Layout.preferredWidth: 100 56 | 57 | minimumValue: 0 58 | maximumValue: backendValues.maximumValue.value 59 | updateValueWhileDragging: true 60 | stepSize: 1 61 | value: backendValues.fuelValue.value 62 | onValueChanged: { 63 | backendValues.fuelValue.value = fuelSlider.value 64 | 65 | } 66 | 67 | } 68 | 69 | ExpandingSpacer { 70 | width: 30 71 | } 72 | } 73 | 74 | 75 | 76 | Label { 77 | text: qsTr("Maximum Fuel") 78 | } 79 | 80 | SecondColumnLayout { 81 | SpinBox { 82 | backendValue: backendValues.maximumValue 83 | minimumValue: 0 84 | maximumValue: 1000 85 | decimals: 0 86 | } 87 | 88 | Controls.Slider { 89 | id: maximumFuelSlider 90 | Layout.preferredWidth: 100 91 | 92 | minimumValue: 0 93 | maximumValue: 1000 94 | updateValueWhileDragging: true 95 | stepSize: 10 96 | value: backendValues.maximumValue.value 97 | onValueChanged: { 98 | backendValues.maximumValue.value = maximumFuelSlider.value 99 | 100 | } 101 | 102 | } 103 | 104 | ExpandingSpacer { 105 | width: 30 106 | } 107 | } 108 | 109 | Label { 110 | text: qsTr("Maximum Value Angle") 111 | } 112 | 113 | SecondColumnLayout { 114 | SpinBox { 115 | backendValue: backendValues.maxValueAngle 116 | minimumValue: 0 117 | maximumValue: 360 118 | decimals: 0 119 | } 120 | 121 | Controls.Slider { 122 | id: maxValueAngleSlider 123 | Layout.preferredWidth: 100 124 | 125 | minimumValue: 0 126 | maximumValue: 360 127 | updateValueWhileDragging: true 128 | stepSize: 10 129 | value: backendValues.maxValueAngle.value 130 | onValueChanged: { 131 | backendValues.maxValueAngle.value = maxValueAngleSlider.value 132 | } 133 | 134 | } 135 | 136 | ExpandingSpacer { 137 | width: 30 138 | } 139 | } 140 | 141 | Label { 142 | text: qsTr("Minimum Value Angle") 143 | } 144 | 145 | 146 | SecondColumnLayout { 147 | SpinBox { 148 | backendValue: backendValues.minValueAngle 149 | minimumValue: 0 150 | maximumValue: 360 151 | decimals: 0 152 | } 153 | 154 | Controls.Slider { 155 | id: minValueAngleSlider 156 | Layout.preferredWidth: 100 157 | 158 | minimumValue: 0 159 | maximumValue: 360 160 | updateValueWhileDragging: true 161 | stepSize: 10 162 | value: backendValues.minValueAngle.value 163 | onValueChanged: { 164 | backendValues.minValueAngle.value = minValueAngleSlider.value 165 | } 166 | 167 | } 168 | 169 | ExpandingSpacer { 170 | width: 30 171 | } 172 | } 173 | 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /qml/dash_hybrid/gauges/designer/TurboMeterSpecifics.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms 13 | ** and conditions see https://www.qt.io/terms-conditions. For further 14 | ** information use the contact form at https://www.qt.io/contact-us. 15 | ** 16 | ** GNU General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU 18 | ** General Public License version 3 as published by the Free Software 19 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 20 | ** included in the packaging of this file. Please review the following 21 | ** information to ensure the GNU General Public License requirements will 22 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 23 | ** 24 | ****************************************************************************/ 25 | 26 | import QtQuick 2.1 27 | import HelperWidgets 2.0 28 | import QtQuick.Layouts 1.0 29 | import QtQuick.Controls 1.0 as Controls 30 | 31 | Column { 32 | anchors.left: parent.left 33 | anchors.right: parent.right 34 | 35 | Section { 36 | anchors.left: parent.left 37 | anchors.right: parent.right 38 | caption: qsTr("TurboMeter") 39 | SectionLayout { 40 | 41 | Label { 42 | text: qsTr("Turbo Value") 43 | } 44 | 45 | SecondColumnLayout { 46 | SpinBox { 47 | backendValue: backendValues.turboValue 48 | minimumValue: 0 49 | maximumValue: backendValues.maximumValue.value 50 | decimals: 0 51 | } 52 | 53 | Controls.Slider { 54 | id: turboSlider 55 | Layout.preferredWidth: 100 56 | 57 | minimumValue: 0 58 | maximumValue: backendValues.maximumValue.value 59 | updateValueWhileDragging: true 60 | stepSize: 0.1 61 | value: backendValues.turboValue.value 62 | onValueChanged: { 63 | backendValues.turboValue.value = turboSlider.value 64 | 65 | } 66 | 67 | } 68 | 69 | ExpandingSpacer { 70 | width: 30 71 | } 72 | } 73 | 74 | 75 | 76 | Label { 77 | text: qsTr("Maximum Turbo") 78 | } 79 | 80 | SecondColumnLayout { 81 | SpinBox { 82 | backendValue: backendValues.maximumValue 83 | minimumValue: 0 84 | maximumValue: 1000 85 | decimals: 0 86 | } 87 | 88 | Controls.Slider { 89 | id: maximumFuelSlider 90 | Layout.preferredWidth: 100 91 | 92 | minimumValue: 0 93 | maximumValue: 1000 94 | updateValueWhileDragging: true 95 | stepSize: 10 96 | value: backendValues.maximumValue.value 97 | onValueChanged: { 98 | backendValues.maximumValue.value = maximumFuelSlider.value 99 | 100 | } 101 | 102 | } 103 | 104 | ExpandingSpacer { 105 | width: 30 106 | } 107 | } 108 | 109 | Label { 110 | text: qsTr("Maximum Value Angle") 111 | } 112 | 113 | SecondColumnLayout { 114 | SpinBox { 115 | backendValue: backendValues.maxValueAngle 116 | minimumValue: 0 117 | maximumValue: 360 118 | decimals: 0 119 | } 120 | 121 | Controls.Slider { 122 | id: maxValueAngleSlider 123 | Layout.preferredWidth: 100 124 | 125 | minimumValue: 0 126 | maximumValue: 360 127 | updateValueWhileDragging: true 128 | stepSize: 10 129 | value: backendValues.maxValueAngle.value 130 | onValueChanged: { 131 | backendValues.maxValueAngle.value = maxValueAngleSlider.value 132 | } 133 | 134 | } 135 | 136 | ExpandingSpacer { 137 | width: 30 138 | } 139 | } 140 | 141 | Label { 142 | text: qsTr("Minimum Value Angle") 143 | } 144 | 145 | 146 | SecondColumnLayout { 147 | SpinBox { 148 | backendValue: backendValues.minValueAngle 149 | minimumValue: 0 150 | maximumValue: 360 151 | decimals: 0 152 | } 153 | 154 | Controls.Slider { 155 | id: minValueAngleSlider 156 | Layout.preferredWidth: 100 157 | 158 | minimumValue: 0 159 | maximumValue: 360 160 | updateValueWhileDragging: true 161 | stepSize: 10 162 | value: backendValues.minValueAngle.value 163 | onValueChanged: { 164 | backendValues.minValueAngle.value = minValueAngleSlider.value 165 | } 166 | 167 | } 168 | 169 | ExpandingSpacer { 170 | width: 30 171 | } 172 | } 173 | 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /qml/dash_sports/CameraLoader.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ".." 43 | import ClusterDemo 1.0 44 | 45 | Loader { 46 | id: camera 47 | 48 | opacity: 0.0 49 | visible: false 50 | asynchronous: true 51 | source: "../VideoView.qml" 52 | onLoaded: item.imageSource = "image://etc/RearCameraOverlaySport.png" 53 | } 54 | -------------------------------------------------------------------------------- /qml/dash_sports/CarLoader.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | 43 | Loader { 44 | opacity: 0.0 45 | 46 | asynchronous: true 47 | active: false 48 | source: "../CarViewSports.qml" 49 | 50 | onLoaded: { 51 | // Start with car view, there is some kind of a problem when starting with any 52 | // other (It seems NoDraw doesn't work if this is not the first view) 53 | loadCenterView(true) // We get the first change from signal 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /qml/dash_sports/CenterStack.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | import QtQuick 2.6 52 | import ".." 53 | import ClusterDemo 1.0 54 | 55 | Item { 56 | id: centerStack 57 | property int viewIndex: 4 58 | height: root.height - 173 59 | width: root.width / 2 60 | clip: true 61 | 62 | property alias fadeOutCenter: fadeOutCenter 63 | property alias fadeInCenter: fadeInCenter 64 | property alias loader: loader 65 | 66 | 67 | Loader { 68 | id: loader 69 | onStatusChanged: { 70 | if (status == Loader.Ready) 71 | fadeInCenter.start() 72 | } 73 | anchors.fill: parent 74 | } 75 | 76 | Component.onCompleted: { 77 | loader.source = "../MediaPlayerView.qml" 78 | // Start with car view, there is some kind of a problem when starting with any 79 | // other (It seems NoDraw doesn't work if this is not the first view) 80 | //loadCenterView(true) // We get the first change from signal 81 | } 82 | 83 | PropertyAnimation { 84 | id: fadeInCenter 85 | target: loader 86 | property: "opacity" 87 | from: 0.0 88 | to: 1.0 89 | duration: 400 90 | easing.type: Easing.Linear 91 | } 92 | 93 | PropertyAnimation { 94 | id: fadeOutCenter 95 | property: "opacity" 96 | from: 1.0 97 | to: 0.0 98 | duration: 250 99 | easing.type: Easing.Linear 100 | onStopped: { 101 | if (target === car) { 102 | car.visible = false 103 | car.item.hidden = true 104 | } else if (target === camera) { 105 | camera.visible = false 106 | } 107 | if (centerStack.viewIndex === carviewindex) { 108 | car.visible = true 109 | fadeInCenter.target = car 110 | car.item.hidden = false 111 | fadeInCenter.start() 112 | } else if (centerStack.viewIndex === videoviewindex) { 113 | camera.x = centerStack.x 114 | camera.y = centerStack.y 115 | camera.visible = true 116 | fadeInCenter.target = camera 117 | fadeInCenter.start() 118 | } else { 119 | fadeInCenter.target = loader 120 | } 121 | loader.source = component[centerStack.viewIndex] 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /qml/dash_sports/Dashboard.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.2 42 | import ClusterDemo 1.0 43 | import ".." 44 | 45 | Item { 46 | id: main 47 | 48 | width: 1280 49 | height: 480 50 | 51 | anchors.fill: parent 52 | } 53 | -------------------------------------------------------------------------------- /qml/dash_sports/DashboardFrame.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ".." 43 | import ClusterDemo 1.0 44 | 45 | Loader { 46 | width: 1280 47 | height: 480 48 | 49 | id: loader 50 | asynchronous: true 51 | active: frame.status === Image.Ready 52 | source: "DashboardView.qml" 53 | 54 | Image { 55 | id: frame 56 | 57 | visible: loader.status !== Loader.Ready //only show until the real dashboard is loaded 58 | source: "image://etc/DashboardFrameSport-mask.png" 59 | z: 2 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /qml/dash_sports/Gauge.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2014 The Qt Company and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt.io 5 | ** 6 | ** This file is part of the The Qt Company automotive framework. 7 | ** 8 | ****************************************************************************/ 9 | 10 | import QtQuick 2.0 11 | 12 | import "functions.js" as Functions 13 | 14 | Item { 15 | id: gauge 16 | property alias topText: topTxt 17 | property alias bgSource: bgImage.source 18 | property real outerRadius: Math.min(width, height) * 0.5 19 | property int animationDuration: 500 20 | 21 | property int value: 0 22 | property int minValue: 0 23 | property int maxValue: 10000 24 | property int minAngle: -138 25 | property int maxAngle: 162 26 | property real valueInDegrees: ((maxAngle - minAngle) / (maxValue - minValue)) * (value - minValue) 27 | property string shaderColor: "#E31E24" 28 | 29 | //This is for drawing the shader needle. RpmGauge values background is a bit bigger than 30 | //speedometer (or in different location). 31 | // As we draw all gauge needles here we need the correction for rpm gauge 32 | property alias pixelCorrection: effect.pixelCorrection 33 | 34 | Image { 35 | id: bgImage 36 | anchors.centerIn: parent 37 | } 38 | 39 | Text { 40 | id: topTxt 41 | anchors.horizontalCenter: parent.horizontalCenter 42 | anchors.bottom: parent.verticalCenter 43 | font.pixelSize: Functions.toPixels(0.3, outerRadius) 44 | color: "white" 45 | } 46 | 47 | ShaderEffect { 48 | id: effect 49 | anchors.centerIn: parent 50 | 51 | width: gauge.width 52 | height: gauge.height 53 | property double frontCut: gauge.minAngle + gauge.valueInDegrees// new speed 54 | property double backCut: gauge.minAngle //starting point 55 | 56 | // INTERNAL BELOW 57 | property double _accelerating: (backCut < frontCut) ? 1. : 0. 58 | property double pixelCorrection: 0.0 59 | 60 | property variant source: ShaderEffectSource { 61 | sourceItem: Rectangle { 62 | width: effect.width 63 | height: effect.width 64 | radius: width 65 | color: shaderColor 66 | } 67 | } 68 | 69 | Behavior on frontCut { 70 | enabled: startupAnimationStopped 71 | PropertyAnimation { duration: animationDuration } 72 | } 73 | 74 | fragmentShader: " 75 | varying highp vec2 qt_TexCoord0; 76 | uniform lowp sampler2D source; 77 | uniform lowp float qt_Opacity; 78 | 79 | uniform lowp float frontCut; 80 | uniform lowp float backCut; 81 | uniform lowp float _accelerating; 82 | uniform lowp float pixelCorrection; 83 | 84 | highp float FCRad = radians(frontCut - 180.); 85 | highp float BCRad = radians(backCut - 180.); 86 | 87 | void main() { 88 | highp vec2 uv = vec2(.5 - qt_TexCoord0.y, .5 - qt_TexCoord0.x); 89 | 90 | lowp float L = length(uv); 91 | lowp float f = 0.; 92 | 93 | f = smoothstep(L - .01, L, .4615 + pixelCorrection); 94 | f -= smoothstep(L,L + 0.01, .444 + pixelCorrection); 95 | //f = step(L, 0.48); 96 | //f -= step(L,0.45); 97 | 98 | lowp float angle = -atan(uv.y,uv.x); 99 | 100 | // Without gradient 101 | f *= mix((1. - step(BCRad, angle)) * step(FCRad, angle), 102 | (1. - step(FCRad, angle)) * step(BCRad, angle), 103 | _accelerating); 104 | 105 | gl_FragColor = texture2D(source, qt_TexCoord0) * f * 1.; 106 | } 107 | " 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /qml/dash_sports/RPMFlipable.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ".." 43 | import ClusterDemo 1.0 44 | 45 | Flipable { 46 | id: flipable 47 | height: width 48 | property bool flipped: false 49 | signal loaded 50 | property alias flipRotation: flipRotation 51 | property alias rpm: rpm 52 | 53 | property int rpmValue: 4000 54 | 55 | front: Loader { 56 | id: rpm 57 | width: parent.width 58 | height: width 59 | asynchronous: true 60 | source: "RPMGauge_painter.qml" 61 | onLoaded: flipable.loaded() 62 | } 63 | 64 | back: Loader { 65 | width: parent.width 66 | height: width 67 | asynchronous: true 68 | source: "../CarParkingSports.qml" 69 | } 70 | 71 | transform: Rotation { 72 | id: flipRotation 73 | origin.x: flipable.width / 2 74 | origin.y: flipable.height / 2 75 | axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis 76 | angle: 90 // the default angle 77 | } 78 | 79 | states: [ 80 | State { 81 | name: "back" 82 | PropertyChanges { 83 | target: flipRotation 84 | angle: 180 85 | } 86 | PropertyChanges { 87 | target: flipable.front 88 | visible: false 89 | } 90 | 91 | PropertyChanges { 92 | target: flipable.back 93 | visible: true 94 | } 95 | 96 | when: flipable.flipped 97 | }, 98 | State { 99 | name: "front" 100 | PropertyChanges { 101 | target: flipRotation 102 | angle: 0 103 | } 104 | PropertyChanges { 105 | target: flipable.front 106 | visible: true 107 | } 108 | 109 | PropertyChanges { 110 | target: flipable.back 111 | visible: false 112 | } 113 | when: !flipable.flipped 114 | } 115 | ] 116 | 117 | transitions: Transition { 118 | NumberAnimation { target: flipRotation; property: "angle"; duration: 300 } 119 | } 120 | 121 | //Fill background while flipping. TODO think better way to do it 122 | Rectangle { 123 | anchors.centerIn: parent 124 | radius: flipable.width+4 /2 125 | width: flipable.width+4 126 | height: flipable.width+4 127 | color: "black" 128 | z: -1 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /qml/dash_sports/SpeedoMeterLoader.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.6 42 | import ".." 43 | import ClusterDemo 1.0 44 | 45 | Loader { 46 | id: speedoMeter 47 | asynchronous: true 48 | source: "SpeedoMeter_painter.qml" 49 | //source: "SpeedoMeter_vertex.qml" 50 | //source: "SpeedoMeter.qml" 51 | 52 | property int value: 150 53 | 54 | property alias rotation: speed_rot 55 | 56 | transform: Rotation { 57 | id: speed_rot 58 | origin.x: speedoMeter.width / 2 59 | origin.y: speedoMeter.height / 2 60 | axis { x: 0; y: 1; z: 0 } 61 | angle: ValueSource.runningInDesigner ? 0 : 90 // the default angle 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /qml/dash_sports/SpeedoMeter_vertex.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | import QtQuick 2.0 52 | 53 | import "../functions.js" as Functions 54 | import ClusterDemo 1.0 55 | 56 | Item { 57 | id: root 58 | property alias speedValue: speedgauge.speedValue 59 | property alias maxValue: speedgauge.maxValue 60 | 61 | property bool updateGeometry: false 62 | property bool showWire: false 63 | 64 | Image { 65 | id: bg 66 | anchors.centerIn: parent 67 | source: "image://etc/Gauge_Speed.png" 68 | 69 | GaugeFiller { 70 | id: speedgauge 71 | 72 | property real outerRadius: Math.min(width, height) * 0.5 73 | 74 | property real speedValue: 0 75 | value: startupAnimationStopped ? ValueSource.kph : speedValue 76 | 77 | anchors.fill: parent 78 | radius: 177 79 | fillWidth: 10 80 | updateGeometry: root.updateGeometry 81 | doNotFill: root.showWire 82 | 83 | Behavior on value { 84 | enabled: startupAnimationStopped 85 | PropertyAnimation { duration: 500 } 86 | } 87 | } 88 | 89 | GaugeFiller { 90 | id: fuel 91 | anchors.fill: parent 92 | radius: 177 93 | fillWidth: 10 94 | 95 | value: ValueSource.fuelLevel 96 | numVertices: 16 97 | minAngle: 323.7 98 | maxAngle: 287.7 99 | maxValue: 100 100 | 101 | color: "#464749" 102 | 103 | updateGeometry: root.updateGeometry 104 | doNotFill: root.showWire 105 | 106 | Behavior on value { 107 | enabled: startupAnimationStopped 108 | PropertyAnimation { duration: 100 } 109 | } 110 | } 111 | } 112 | 113 | Text { 114 | id: topText 115 | anchors.horizontalCenter: parent.horizontalCenter 116 | anchors.bottom: parent.verticalCenter 117 | font.pixelSize: Functions.toPixels(0.3, speedgauge.outerRadius) 118 | color: "white" 119 | text: speedgauge.value.toFixed() 120 | } 121 | 122 | Text { 123 | id: kmText 124 | text: "km/h" 125 | color: "white" 126 | font.pixelSize: Functions.toPixels(0.09, speedgauge.outerRadius) 127 | anchors.top: topText.bottom 128 | anchors.horizontalCenter: parent.horizontalCenter 129 | } 130 | 131 | Image { 132 | id: tyreLight 133 | anchors.right: parkingLight.left 134 | anchors.bottom: parkingLight.bottom 135 | anchors.bottomMargin: 18 136 | source: ValueSource.flatTire ? "image://etc/Icon_TyreMalfunction_ON.png" 137 | : "image://etc/Icon_TyreMalfunction_OFF.png" 138 | } 139 | 140 | Image { 141 | id: parkingLight 142 | anchors.horizontalCenter: parent.horizontalCenter 143 | anchors.top: kmText.bottom 144 | anchors.topMargin: 20 145 | 146 | source: ValueSource.parkingBrake ? "image://etc/Icon_ParkingBrake_ON.png" 147 | : "image://etc/Icon_ParkingBrake_OFF.png" 148 | } 149 | 150 | Image { 151 | id: fuelLight 152 | anchors.left: parkingLight.right 153 | anchors.bottom: parkingLight.bottom 154 | anchors.bottomMargin: 18 155 | source: (ValueSource.fuelLevel <= 15) ? "image://etc/Icon_Fuel_ON.png" 156 | : "image://etc/Icon_Fuel_OFF.png" 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /qml/dash_sports/designer/RPMFlipableSpecifics.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms 13 | ** and conditions see https://www.qt.io/terms-conditions. For further 14 | ** information use the contact form at https://www.qt.io/contact-us. 15 | ** 16 | ** GNU General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU 18 | ** General Public License version 3 as published by the Free Software 19 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 20 | ** included in the packaging of this file. Please review the following 21 | ** information to ensure the GNU General Public License requirements will 22 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 23 | ** 24 | ****************************************************************************/ 25 | 26 | import QtQuick 2.1 27 | import HelperWidgets 2.0 28 | import QtQuick.Layouts 1.0 29 | import QtQuick.Controls 1.0 as Controls 30 | 31 | Column { 32 | anchors.left: parent.left 33 | anchors.right: parent.right 34 | 35 | Section { 36 | anchors.left: parent.left 37 | anchors.right: parent.right 38 | caption: qsTr("TurboMeter") 39 | SectionLayout { 40 | 41 | Label { 42 | text: qsTr("RPM Value") 43 | } 44 | 45 | SecondColumnLayout { 46 | SpinBox { 47 | backendValue: backendValues.rpmValue 48 | minimumValue: 0 49 | maximumValue: 8000 50 | decimals: 0 51 | } 52 | 53 | Controls.Slider { 54 | id: turboSlider 55 | Layout.preferredWidth: 100 56 | 57 | minimumValue: 0 58 | maximumValue: 8000 59 | updateValueWhileDragging: true 60 | stepSize: 0.1 61 | value: backendValues.rpmValue.value 62 | onValueChanged: { 63 | backendValues.rpmValue.value = turboSlider.value 64 | 65 | } 66 | 67 | } 68 | 69 | ExpandingSpacer { 70 | width: 30 71 | } 72 | } 73 | 74 | 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /qml/dash_sports/designer/SpeedoMeterLoaderSpecifics.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms 13 | ** and conditions see https://www.qt.io/terms-conditions. For further 14 | ** information use the contact form at https://www.qt.io/contact-us. 15 | ** 16 | ** GNU General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU 18 | ** General Public License version 3 as published by the Free Software 19 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 20 | ** included in the packaging of this file. Please review the following 21 | ** information to ensure the GNU General Public License requirements will 22 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 23 | ** 24 | ****************************************************************************/ 25 | 26 | import QtQuick 2.1 27 | import HelperWidgets 2.0 28 | import QtQuick.Layouts 1.0 29 | import QtQuick.Controls 1.0 as Controls 30 | 31 | Column { 32 | anchors.left: parent.left 33 | anchors.right: parent.right 34 | 35 | Section { 36 | anchors.left: parent.left 37 | anchors.right: parent.right 38 | caption: qsTr("TurboMeter") 39 | SectionLayout { 40 | 41 | Label { 42 | text: qsTr("Value") 43 | } 44 | 45 | SecondColumnLayout { 46 | SpinBox { 47 | backendValue: backendValues.value 48 | minimumValue: 0 49 | maximumValue: 240 50 | decimals: 0 51 | } 52 | 53 | Controls.Slider { 54 | id: turboSlider 55 | Layout.preferredWidth: 100 56 | 57 | minimumValue: 0 58 | maximumValue: 240 59 | updateValueWhileDragging: true 60 | stepSize: 0.1 61 | value: backendValues.value.value 62 | onValueChanged: { 63 | backendValues.value.value = turboSlider.value 64 | 65 | } 66 | 67 | } 68 | 69 | ExpandingSpacer { 70 | width: 30 71 | } 72 | } 73 | 74 | 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /qml/functions.js: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms 13 | ** and conditions see https://www.qt.io/terms-conditions. For further 14 | ** information use the contact form at https://www.qt.io/contact-us. 15 | ** 16 | ** GNU General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU 18 | ** General Public License version 3 as published by the Free Software 19 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 20 | ** included in the packaging of this file. Please review the following 21 | ** information to ensure the GNU General Public License requirements will 22 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 23 | ** 24 | ****************************************************************************/ 25 | 26 | .pragma library 27 | 28 | function toPixels(percentage, outerRadius) { 29 | return percentage * outerRadius; 30 | } 31 | 32 | var convertToRad = Math.PI / 180; 33 | function degToRad(degrees) { 34 | return degrees * convertToRad; 35 | } 36 | 37 | var convertToDeg = 180 / Math.PI; 38 | function radToDeg(radians) { 39 | return radians * convertToDeg; 40 | } 41 | -------------------------------------------------------------------------------- /qml/models/Map11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/qml/models/Map11.jpg -------------------------------------------------------------------------------- /qml/models/Map3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/qml/models/Map3.jpg -------------------------------------------------------------------------------- /qml/models/sportscar_15k.qgltf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/qml/models/sportscar_15k.qgltf -------------------------------------------------------------------------------- /qml/models/sportscar_15k_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/savavel/qt-instrument-cluster/748dc9c64ec3db068f2ff4d31bdf2dac34d0ed02/qml/models/sportscar_15k_1.bin -------------------------------------------------------------------------------- /qtcluster-base.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = qtcluster 3 | INCLUDEPATH += . 4 | QT += quick serialbus websockets 5 | 6 | # Enable for static version 7 | #CONFIG += static 8 | #DEFINES += STATIC 9 | 10 | CONFIG += SPORTS_CAR 11 | CONFIG += HYBRID_CAR 12 | 13 | #Enable compile flags based on config flags 14 | SPORTS_CAR: DEFINES += SPORTS_CAR 15 | HYBRID_CAR: DEFINES += HYBRID_CAR 16 | 17 | qtHaveModule(3drender) { 18 | QT += 3dcore 3drender 3dquick 3dquick-private 19 | HEADERS += \ 20 | scenehelper.h 21 | SOURCES += \ 22 | scenehelper.cpp 23 | } 24 | 25 | CONFIG += resources_big 26 | 27 | SOURCES += \ 28 | main.cpp \ 29 | gauge.cpp \ 30 | gaugenode.cpp \ 31 | qtiviclusterdata.cpp \ 32 | etcprovider.cpp \ 33 | circularindicator.cpp 34 | 35 | DEFINES += NO_NETWORK 36 | 37 | RESOURCES += \ 38 | qtcluster.qrc \ 39 | 40 | RESOURCES += images.qrc 41 | 42 | SPORTS_CAR: { 43 | RESOURCES += sportsqml.qrc 44 | 45 | RESOURCES += sportscar_15k.qrc 46 | RESOURCES += sportsimages.qrc 47 | } 48 | 49 | HYBRID_CAR: { 50 | RESOURCES += \ 51 | hybridqml.qrc 52 | 53 | RESOURCES += hybridimages.qrc 54 | } 55 | 56 | RESOURCES += iso-icons.qrc 57 | 58 | ISO_ICONS = \ 59 | iso_grs_7000_4_0083 \ 60 | iso_grs_7000_4_1434A \ 61 | iso_grs_7000_4_0246 \ 62 | iso_grs_7000_4_0245 \ 63 | iso_grs_7000_4_0247 \ 64 | iso_grs_7000_4_1555 \ 65 | iso_grs_7000_4_1702 \ 66 | iso_grs_7000_4_0249 \ 67 | iso_grs_7000_4_0238 \ 68 | iso_grs_7000_4_0456 69 | 70 | 71 | OTHER_FILES += \ 72 | qml/* \ 73 | qml/dash_sports/* \ 74 | qml/dash_hybrid/* \ 75 | qml/dash_hybrid/gauges/* \ 76 | qml/dash_safety/* \ 77 | 78 | #win32 | win64: { 79 | # deploy.path = $$OUT_PWD 80 | #} else { 81 | deploy.path = /data/user/qt 82 | #} 83 | 84 | #message($$deploy.path) 85 | 86 | #qml_data.files += qml/* 87 | #qml_data.path = $$deploy.path/$$TARGET/qml 88 | #font_data.files += fonts/* 89 | #font_data.path = $$deploy.path/$$TARGET/fonts 90 | #image_data.files += images/* 91 | #image_data.path = $$deploy.path/$$TARGET/images 92 | target.path = $$deploy.path/$$TARGET 93 | INSTALLS += \ 94 | target \ 95 | # video_data \ 96 | # qml_data \ 97 | # font_data \ 98 | # image_data 99 | 100 | HEADERS += \ 101 | gauge.h \ 102 | gaugenode.h \ 103 | qtiviclusterdata.h \ 104 | etcprovider.h \ 105 | circularindicator.h 106 | 107 | macos: QMAKE_INFO_PLIST = Info-macos.plist 108 | ios|tvos: QMAKE_INFO_PLIST = Info-ios.plist 109 | 110 | DISTFILES += 111 | 112 | -------------------------------------------------------------------------------- /qtcluster.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | qtcluster-base.pro \ 5 | designerImports\ClusterDemo\plugin.pro 6 | 7 | QML_IMPORT_PATH = $$PWD/imports 8 | QML_DESIGNER_IMPORT_PATH = $$PWD/designerImports 9 | -------------------------------------------------------------------------------- /qtcluster.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/TurnIndicator.qml 4 | qml/ValueSource.qml 5 | qml/MapView.qml 6 | qml/VideoView.qml 7 | qml/functions.js 8 | qml/ConsumptionView.qml 9 | qml/MediaPlayerView.qml 10 | qml/route.txt 11 | qml/VehicleInfoNote.qml 12 | qml/FpsCounter.qml 13 | 14 | 15 | -------------------------------------------------------------------------------- /scenehelper.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** BSD License Usage 18 | ** Alternatively, you may use this file under the terms of the BSD license 19 | ** as follows: 20 | ** 21 | ** "Redistribution and use in source and binary forms, with or without 22 | ** modification, are permitted provided that the following conditions are 23 | ** met: 24 | ** * Redistributions of source code must retain the above copyright 25 | ** notice, this list of conditions and the following disclaimer. 26 | ** * Redistributions in binary form must reproduce the above copyright 27 | ** notice, this list of conditions and the following disclaimer in 28 | ** the documentation and/or other materials provided with the 29 | ** distribution. 30 | ** * Neither the name of The Qt Company Ltd nor the names of its 31 | ** contributors may be used to endorse or promote products derived 32 | ** from this software without specific prior written permission. 33 | ** 34 | ** 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 46 | ** 47 | ** $QT_END_LICENSE$ 48 | ** 49 | ****************************************************************************/ 50 | 51 | #ifndef SCENEHELPER_H 52 | #define SCENEHELPER_H 53 | 54 | #include 55 | #include 56 | 57 | #include 58 | #include 59 | #include 60 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) 61 | #include 62 | #else 63 | #include 64 | #endif 65 | #include 66 | #include 67 | #include 68 | #include 69 | 70 | class SceneHelper : public QObject 71 | { 72 | Q_OBJECT 73 | 74 | public: 75 | Q_INVOKABLE QObject *findEntity(Qt3DRender::QSceneLoader *loader, const QString &name); 76 | Q_INVOKABLE void addListEntry(const QVariant &list, QObject *entry); 77 | Q_INVOKABLE void removeFromScene(Qt3DRender::QSceneLoader *loader, const QStringList &names); 78 | Q_INVOKABLE void addBasicMaterials(Qt3DRender::QSceneLoader *loader, 79 | Qt3DRender::QMaterial *material, QStringList names); 80 | Q_INVOKABLE void addTextureMaterial(Qt3DRender::QSceneLoader *loader, 81 | Qt3DRender::QMaterial *material, QString name); 82 | Q_INVOKABLE void replaceMaterial(Qt3DRender::QSceneLoader *loader, const QString &name, 83 | Qt3DRender::QMaterial *material); 84 | Q_INVOKABLE void searchCamera(Qt3DRender::QSceneLoader *loader, const QString &name); 85 | 86 | private: 87 | void addComponents(QStringList &names, Qt3DCore::QEntity *root, 88 | Qt3DRender::QMaterial *material); 89 | void addComponent(QString &name, Qt3DCore::QEntity *root, Qt3DRender::QMaterial *material); 90 | }; 91 | 92 | #endif // SCENEHELPER_H 93 | -------------------------------------------------------------------------------- /sportscar_15k.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/models/Map11.jpg 4 | qml/models/sportscar_15k.qgltf 5 | qml/models/sportscar_15k_1.bin 6 | 7 | 8 | -------------------------------------------------------------------------------- /sportsimages.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/SportCarForParkSensors.png 4 | images/Gauge_RPM.png 5 | images/Gauge_Speed.png 6 | images/MapLocationSport.png 7 | images/RearCameraOverlaySport.png 8 | images/SportCarFloorShadow.png 9 | images/DashboardFrameSport-mask.png 10 | 11 | 12 | -------------------------------------------------------------------------------- /sportsqml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/dash_sports/Dashboard.qml 4 | qml/dash_sports/DashboardFrame.qml 5 | qml/dash_sports/SpeedoMeter.qml 6 | qml/dash_sports/RPMGauge.qml 7 | qml/dash_sports/Gauge.qml 8 | qml/dash_sports/SpeedoMeter_vertex.qml 9 | qml/dash_sports/RPMGauge_vertex.qml 10 | qml/dash_sports/SpeedoMeter_painter.qml 11 | qml/dash_sports/RPMGauge_painter.qml 12 | qml/dash_sports/RPMFlipable.qml 13 | qml/dash_sports/CenterStack.qml 14 | qml/dash_sports/SpeedoMeterLoader.qml 15 | qml/dash_sports/DashboardForm.ui.qml 16 | qml/dash_sports/DashboardView.qml 17 | qml/dash_sports/CarLoader.qml 18 | qml/dash_sports/CameraLoader.qml 19 | qml/CarParkingSports.qml 20 | qml/CarViewSports.qml 21 | qml/CarModelSports.qml 22 | 23 | 24 | --------------------------------------------------------------------------------