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 --- Controls.pro | 19 -- Controls.qml | 63 ----- 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 ++++ config.tests/libhomescreen.cpp | 7 - config.tests/libhomescreen.pro | 5 - controls.pro | 3 + controls.qrc | 5 - images/HMI_HVAC_AC_Active.svg | 90 ------- images/HMI_HVAC_AC_Inactive.svg | 78 ------ images/images.qrc | 6 - main.cpp | 46 ---- package/config.xml | 11 + package/icon.svg | 489 ++++++++++++++++++++++++++++++++++++ package/package.pro | 19 ++ 23 files changed, 894 insertions(+), 319 deletions(-) delete mode 100644 Controls.pro delete mode 100644 Controls.qml 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 delete mode 100644 config.tests/libhomescreen.cpp delete mode 100644 config.tests/libhomescreen.pro create mode 100644 controls.pro delete mode 100644 controls.qrc delete mode 100644 images/HMI_HVAC_AC_Active.svg delete mode 100644 images/HMI_HVAC_AC_Inactive.svg delete mode 100644 images/images.qrc delete mode 100644 main.cpp create mode 100644 package/config.xml create mode 100644 package/icon.svg create mode 100644 package/package.pro diff --git a/Controls.pro b/Controls.pro deleted file mode 100644 index 9d1674d..0000000 --- a/Controls.pro +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 87a6abb..0000000 --- a/Controls.qml +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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/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(); +} + diff --git a/config.tests/libhomescreen.cpp b/config.tests/libhomescreen.cpp deleted file mode 100644 index e0fd460..0000000 --- a/config.tests/libhomescreen.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int argc,char **argv) -{ - LibHomeScreen libHomeScreen; - return 0; -} diff --git a/config.tests/libhomescreen.pro b/config.tests/libhomescreen.pro deleted file mode 100644 index eb4e8f3..0000000 --- a/config.tests/libhomescreen.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = libhomescreen.cpp - -CONFIG -= qt -CONFIG += link_pkgconfig -PKGCONFIG += homescreen diff --git a/controls.pro b/controls.pro new file mode 100644 index 0000000..579a952 --- /dev/null +++ b/controls.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS = app package +package.depends += app diff --git a/controls.qrc b/controls.qrc deleted file mode 100644 index 7554259..0000000 --- a/controls.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - Controls.qml - - diff --git a/images/HMI_HVAC_AC_Active.svg b/images/HMI_HVAC_AC_Active.svg deleted file mode 100644 index 67efdb3..0000000 --- a/images/HMI_HVAC_AC_Active.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - -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 deleted file mode 100644 index 1120747..0000000 --- a/images/HMI_HVAC_AC_Inactive.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - -image/svg+xmla/c - \ No newline at end of file diff --git a/images/images.qrc b/images/images.qrc deleted file mode 100644 index 5c3c803..0000000 --- a/images/images.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - HMI_HVAC_AC_Active.svg - HMI_HVAC_AC_Inactive.svg - - diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 2adca37..0000000 --- a/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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(); -} - diff --git a/package/config.xml b/package/config.xml new file mode 100644 index 0000000..5e5b9eb --- /dev/null +++ b/package/config.xml @@ -0,0 +1,11 @@ + + + Controls + + + This is a demo application to show UI components + Tasuku Suzuki <tasuku.suzuki@qt.io> + APL 2.0 + + + diff --git a/package/icon.svg b/package/icon.svg new file mode 100644 index 0000000..411d130 --- /dev/null +++ b/package/icon.svg @@ -0,0 +1,489 @@ + + + +image/svg+xmlHVAC + \ No newline at end of file diff --git a/package/package.pro b/package/package.pro new file mode 100644 index 0000000..b879036 --- /dev/null +++ b/package/package.pro @@ -0,0 +1,19 @@ + +DISTFILES = icon.svg config.xml + +copy_icon.target = $$OUT_PWD/root/icon.svg +copy_icon.depends = $$_PRO_FILE_PWD_/icon.svg +copy_icon.commands = $(COPY_FILE) \"$$replace(copy_icon.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_icon.target, /, $$QMAKE_DIR_SEP)\" +QMAKE_EXTRA_TARGETS += copy_icon +PRE_TARGETDEPS += $$copy_icon.target + +copy_config.target = $$OUT_PWD/root/config.xml +copy_config.depends = $$_PRO_FILE_PWD_/config.xml +copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_config.target, /, $$QMAKE_DIR_SEP)\" +QMAKE_EXTRA_TARGETS += copy_config +PRE_TARGETDEPS += $$copy_config.target + +wgt.target = package +wgt.commands = wgtpkg-pack -f -o controls.wgt root + +QMAKE_EXTRA_TARGETS += wgt -- cgit 1.2.3-korg