From f4ae987a32db4715b07ff4357b21562964e325ff Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Thu, 15 Dec 2016 19:50:17 +0900 Subject: pull latest UI from CES2017 Change-Id: I6623af60246d702c91a8bd9f0a317256344187c1 Signed-off-by: Tasuku Suzuki --- app/Controls.qml | 110 ++++++++++++++++++++++++++++++++++++ app/app.pri | 12 ++++ app/app.pro | 11 ++++ app/config.tests/libhomescreen.cpp | 7 +++ app/config.tests/libhomescreen.pro | 5 ++ app/controls.qrc | 5 ++ app/images/HMI_HVAC_AC_Active.svg | 90 +++++++++++++++++++++++++++++ app/images/HMI_HVAC_AC_Inactive.svg | 78 +++++++++++++++++++++++++ app/images/images.qrc | 6 ++ app/main.cpp | 48 ++++++++++++++++ 10 files changed, 372 insertions(+) create mode 100644 app/Controls.qml create mode 100644 app/app.pri create mode 100644 app/app.pro create mode 100644 app/config.tests/libhomescreen.cpp create mode 100644 app/config.tests/libhomescreen.pro create mode 100644 app/controls.qrc create mode 100644 app/images/HMI_HVAC_AC_Active.svg create mode 100644 app/images/HMI_HVAC_AC_Inactive.svg create mode 100644 app/images/images.qrc create mode 100644 app/main.cpp (limited to 'app') diff --git a/app/Controls.qml b/app/Controls.qml new file mode 100644 index 0000000..211c86f --- /dev/null +++ b/app/Controls.qml @@ -0,0 +1,110 @@ +/* + * 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 QtQuick.Window 2.0 +import QtQuick.VirtualKeyboard 2.1 +import AGL.Demo.Controls 1.0 + +ApplicationWindow { + id: root + Item { + anchors.fill: parent + anchors.bottom: inputPanel.top + GridLayout { + anchors.fill: parent + anchors.margins: root.width / 20 + columns: 2 + rowSpacing: 20 + + Label { text: 'Label:' } + Label { + text: 'This is a label' + } + + Label { text: 'Button:' } + Row { + spacing: 20 + Button { + text: 'Normal' + } + Button { + text: 'Highlighted' + highlighted: true + } + } + + Label { text: 'Switch:' } + Switch {} + + Label { text: 'ProgressBar:' } + ProgressBar { + Layout.fillWidth: true + NumberAnimation on value { + from: 0 + to: 1 + duration: 5000 + loops: Animation.Infinite + easing.type: Easing.SineCurve + } + } + + Label { text: 'Slider:' } + Slider { + Layout.fillWidth: true + } + + Label { text: 'TextField:' } + TextField {} + + Label { text: 'Password:' } + TextField { + echoMode: TextInput.Password + inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText + } + + Label { text: 'ToggleButton:' } + ToggleButton { + onImage: './images/HMI_HVAC_AC_Active.svg' + offImage: './images/HMI_HVAC_AC_Inactive.svg' + } + + Label { text: 'Tumbler:' } + RowLayout { + Tumbler { + model: 12 + } + Label { text: ':' } + Tumbler { + model: 60 + } + Tumbler { + model: ['AM', 'PM'] + } + } + Item { Layout.fillHeight: true } + } + } + InputPanel { + id: inputPanel + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + visible: active + } +} diff --git a/app/app.pri b/app/app.pri new file mode 100644 index 0000000..014646f --- /dev/null +++ b/app/app.pri @@ -0,0 +1,12 @@ +TEMPLATE = app + +load(configure) +qtCompileTest(libhomescreen) + +config_libhomescreen { + CONFIG += link_pkgconfig + PKGCONFIG += homescreen + DEFINES += HAVE_LIBHOMESCREEN +} + +DESTDIR = $${OUT_PWD}/../package/root/bin diff --git a/app/app.pro b/app/app.pro new file mode 100644 index 0000000..8b3bc4e --- /dev/null +++ b/app/app.pro @@ -0,0 +1,11 @@ +TARGET = controls +QT = quickcontrols2 + +SOURCES = main.cpp + +RESOURCES += \ + controls.qrc \ + images/images.qrc + +include(app.pri) + diff --git a/app/config.tests/libhomescreen.cpp b/app/config.tests/libhomescreen.cpp new file mode 100644 index 0000000..e0fd460 --- /dev/null +++ b/app/config.tests/libhomescreen.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc,char **argv) +{ + LibHomeScreen libHomeScreen; + return 0; +} diff --git a/app/config.tests/libhomescreen.pro b/app/config.tests/libhomescreen.pro new file mode 100644 index 0000000..eb4e8f3 --- /dev/null +++ b/app/config.tests/libhomescreen.pro @@ -0,0 +1,5 @@ +SOURCES = libhomescreen.cpp + +CONFIG -= qt +CONFIG += link_pkgconfig +PKGCONFIG += homescreen diff --git a/app/controls.qrc b/app/controls.qrc new file mode 100644 index 0000000..7554259 --- /dev/null +++ b/app/controls.qrc @@ -0,0 +1,5 @@ + + + Controls.qml + + diff --git a/app/images/HMI_HVAC_AC_Active.svg b/app/images/HMI_HVAC_AC_Active.svg new file mode 100644 index 0000000..67efdb3 --- /dev/null +++ b/app/images/HMI_HVAC_AC_Active.svg @@ -0,0 +1,90 @@ + + + +image/svg+xmla/c + \ No newline at end of file diff --git a/app/images/HMI_HVAC_AC_Inactive.svg b/app/images/HMI_HVAC_AC_Inactive.svg new file mode 100644 index 0000000..1120747 --- /dev/null +++ b/app/images/HMI_HVAC_AC_Inactive.svg @@ -0,0 +1,78 @@ + + + +image/svg+xmla/c + \ No newline at end of file diff --git a/app/images/images.qrc b/app/images/images.qrc new file mode 100644 index 0000000..5c3c803 --- /dev/null +++ b/app/images/images.qrc @@ -0,0 +1,6 @@ + + + HMI_HVAC_AC_Active.svg + HMI_HVAC_AC_Inactive.svg + + diff --git a/app/main.cpp b/app/main.cpp new file mode 100644 index 0000000..2f19da1 --- /dev/null +++ b/app/main.cpp @@ -0,0 +1,48 @@ +/* + * 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 + + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + + QGuiApplication app(argc, argv); + + QQuickStyle::setStyle("AGL"); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/Controls.qml"))); + + return app.exec(); +} + -- cgit