From 20f5c1b9315ab94e512d5b2eaac854b239235161 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Thu, 8 Dec 2016 00:05:07 +0000 Subject: Initial import from CES2017/apps/Controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The content of the source directory was copied as is in this repository. v2 (jsmoeller): Add requested files and also a .gitreview file Change-Id: If3b8eb34cad3c8319d9fe74753bf72d8c4cf3efd Signed-off-by: Stephane Desneux Signed-off-by: Jan-Simon Möller --- .gitreview | 5 +++ Controls.pro | 19 +++++++++ Controls.qml | 63 +++++++++++++++++++++++++++++ config.tests/libhomescreen.cpp | 7 ++++ config.tests/libhomescreen.pro | 5 +++ controls.qrc | 5 +++ images/HMI_HVAC_AC_Active.svg | 90 +++++++++++++++++++++++++++++++++++++++++ images/HMI_HVAC_AC_Inactive.svg | 78 +++++++++++++++++++++++++++++++++++ images/images.qrc | 6 +++ main.cpp | 46 +++++++++++++++++++++ 10 files changed, 324 insertions(+) create mode 100644 .gitreview create mode 100644 Controls.pro create mode 100644 Controls.qml create mode 100644 config.tests/libhomescreen.cpp create mode 100644 config.tests/libhomescreen.pro create mode 100644 controls.qrc create mode 100644 images/HMI_HVAC_AC_Active.svg create mode 100644 images/HMI_HVAC_AC_Inactive.svg create mode 100644 images/images.qrc create mode 100644 main.cpp diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..e9ae5cb --- /dev/null +++ b/.gitreview @@ -0,0 +1,5 @@ +[gerrit] +host=gerrit.automotivelinux.org +port=29418 +project=apps/controls +defaultbranch=master \ No newline at end of file diff --git a/Controls.pro b/Controls.pro new file mode 100644 index 0000000..9d1674d --- /dev/null +++ b/Controls.pro @@ -0,0 +1,19 @@ +TEMPLATE = app +TARGET = controls +QT = quick quickcontrols2 + +load(configure) +qtCompileTest(libhomescreen) + +config_libhomescreen { + CONFIG += link_pkgconfig + PKGCONFIG += homescreen + DEFINES += HAVE_LIBHOMESCREEN +} + +SOURCES = main.cpp + +RESOURCES += \ + controls.qrc \ + images/images.qrc + diff --git a/Controls.qml b/Controls.qml new file mode 100644 index 0000000..87a6abb --- /dev/null +++ b/Controls.qml @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import QtQuick 2.6 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 +import AGL.Demo.Controls 1.0 + +ApplicationWindow { + id: root + + GridLayout { + anchors.fill: parent + anchors.margins: root.width / 10 + columns: 2 + + Label { text: 'Label:' } + Label { + text: 'This is a label' + } + + Label { text: 'Button:' } + Button { + text: 'This is a button' + } + + Label { text: 'Switch:' } + Switch {} + + Label { text: 'Progress Bar:' } + ProgressBar { + NumberAnimation on value { + from: 0 + to: 1 + duration: 5000 + loops: Animation.Infinite + easing.type: Easing.SineCurve + } + } + + Label { text: 'Slider:' } + Slider {} + + Label { text: 'ToogleButton:' } + ToggleButton { + onImage: './images/HMI_HVAC_AC_Active.svg' + offImage: './images/HMI_HVAC_AC_Inactive.svg' + } + } +} diff --git a/config.tests/libhomescreen.cpp b/config.tests/libhomescreen.cpp new file mode 100644 index 0000000..e0fd460 --- /dev/null +++ b/config.tests/libhomescreen.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc,char **argv) +{ + LibHomeScreen libHomeScreen; + return 0; +} diff --git a/config.tests/libhomescreen.pro b/config.tests/libhomescreen.pro new file mode 100644 index 0000000..eb4e8f3 --- /dev/null +++ b/config.tests/libhomescreen.pro @@ -0,0 +1,5 @@ +SOURCES = libhomescreen.cpp + +CONFIG -= qt +CONFIG += link_pkgconfig +PKGCONFIG += homescreen diff --git a/controls.qrc b/controls.qrc new file mode 100644 index 0000000..7554259 --- /dev/null +++ b/controls.qrc @@ -0,0 +1,5 @@ + + + Controls.qml + + diff --git a/images/HMI_HVAC_AC_Active.svg b/images/HMI_HVAC_AC_Active.svg new file mode 100644 index 0000000..67efdb3 --- /dev/null +++ b/images/HMI_HVAC_AC_Active.svg @@ -0,0 +1,90 @@ + + + +image/svg+xmla/c + \ No newline at end of file diff --git a/images/HMI_HVAC_AC_Inactive.svg b/images/HMI_HVAC_AC_Inactive.svg new file mode 100644 index 0000000..1120747 --- /dev/null +++ b/images/HMI_HVAC_AC_Inactive.svg @@ -0,0 +1,78 @@ + + + +image/svg+xmla/c + \ No newline at end of file diff --git a/images/images.qrc b/images/images.qrc new file mode 100644 index 0000000..5c3c803 --- /dev/null +++ b/images/images.qrc @@ -0,0 +1,6 @@ + + + HMI_HVAC_AC_Active.svg + HMI_HVAC_AC_Inactive.svg + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..2adca37 --- /dev/null +++ b/main.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#ifdef HAVE_LIBHOMESCREEN +#include +#endif + +int main(int argc, char *argv[]) +{ +#ifdef HAVE_LIBHOMESCREEN + LibHomeScreen libHomeScreen; + + if (!libHomeScreen.renderAppToAreaAllowed(0, 1)) { + qWarning() << "renderAppToAreaAllowed is denied"; + return -1; + } +#endif + + QGuiApplication app(argc, argv); + + QQuickStyle::setStyle("AGL"); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/Controls.qml"))); + + return app.exec(); +} + -- cgit 1.2.3-korg