diff options
author | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2016-12-15 19:50:17 +0900 |
---|---|---|
committer | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2016-12-16 23:59:45 +0900 |
commit | f4ae987a32db4715b07ff4357b21562964e325ff (patch) | |
tree | 081706bd8b85eb3835cb7315e19bb8885aeef826 /app | |
parent | 20f5c1b9315ab94e512d5b2eaac854b239235161 (diff) |
pull latest UI from CES2017
Change-Id: I6623af60246d702c91a8bd9f0a317256344187c1
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'app')
-rw-r--r-- | app/Controls.qml | 110 | ||||
-rw-r--r-- | app/app.pri | 12 | ||||
-rw-r--r-- | app/app.pro | 11 | ||||
-rw-r--r-- | app/config.tests/libhomescreen.cpp | 7 | ||||
-rw-r--r-- | app/config.tests/libhomescreen.pro | 5 | ||||
-rw-r--r-- | app/controls.qrc | 5 | ||||
-rw-r--r-- | app/images/HMI_HVAC_AC_Active.svg | 90 | ||||
-rw-r--r-- | app/images/HMI_HVAC_AC_Inactive.svg | 78 | ||||
-rw-r--r-- | app/images/images.qrc | 6 | ||||
-rw-r--r-- | app/main.cpp | 48 |
10 files changed, 372 insertions, 0 deletions
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 <libhomescreen.hpp> + +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 @@ +<RCC> + <qresource prefix="/"> + <file>Controls.qml</file> + </qresource> +</RCC> 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 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> + +<svg + xmlns:i="&ns_ai;" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Layer_2" + x="0px" + y="0px" + viewBox="0 0 318 219" + style="enable-background:new 0 0 318 219;" + xml:space="preserve" + inkscape:version="0.91 r13725" + sodipodi:docname="HMI_HVAC_AC_Active.svg"><metadata + id="metadata30"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs28" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="2560" + inkscape:window-height="1464" + id="namedview26" + showgrid="false" + inkscape:zoom="1.0776256" + inkscape:cx="-271.57627" + inkscape:cy="109.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_2" /><style + type="text/css" + id="style3"> + .st0{fill:#66FF99;} + .st1{font-family:'Roboto-Light';} + .st2{font-size:88.6888px;} + .st3{letter-spacing:3;} + .st4{letter-spacing:-3;} + .st5{fill:none;stroke:url(#SVGID_1_);stroke-miterlimit:10;} +</style><switch + id="switch5"><g + i:extraneous="self" + id="g7"><g + id="g9"><text + transform="matrix(1 5.460000e-03 -5.460000e-03 1 90.8639 132.3301)" + id="text11"><tspan + x="0" + y="0" + class="st0 st1 st2 st3" + id="tspan13">a</tspan><tspan + x="54.5" + y="0" + class="st0 st1 st2 st4" + id="tspan15">/</tspan><tspan + x="86.2" + y="0" + class="st0 st1 st2" + id="tspan17">c</tspan></text> +<linearGradient + id="SVGID_1_" + gradientUnits="userSpaceOnUse" + x1="20.6039" + y1="240.7292" + x2="297.3961" + y2="-21.7292"><stop + offset="0" + style="stop-color:#59FF7F" + id="stop20" /><stop + offset="1" + style="stop-color:#6BFBFF" + id="stop22" /></linearGradient><rect + x="0.5" + y="0.5" + class="st5" + width="317" + height="218" + id="rect24" /></g></g></switch></svg>
\ 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 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> + +<svg + xmlns:i="&ns_ai;" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Layer_2" + x="0px" + y="0px" + viewBox="0 0 318 219" + style="enable-background:new 0 0 318 219;" + xml:space="preserve" + inkscape:version="0.91 r13725" + sodipodi:docname="HMI_HVAC_AC_Inactive.svg"><metadata + id="metadata25"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs23" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="2560" + inkscape:window-height="1464" + id="namedview21" + showgrid="false" + inkscape:zoom="1.0776256" + inkscape:cx="-264.15254" + inkscape:cy="109.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_2" /><style + type="text/css" + id="style3"> + .st0{fill:#848286;} + .st1{font-family:'Roboto-Light';} + .st2{font-size:88.6888px;} + .st3{letter-spacing:3;} + .st4{letter-spacing:-3;} + .st5{fill:none;stroke:#848286;stroke-miterlimit:10;} +</style><switch + id="switch5"><g + i:extraneous="self" + id="g7"><g + id="g9"><text + transform="matrix(1 5.460000e-03 -5.460000e-03 1 90.8639 132.3301)" + id="text11"><tspan + x="0" + y="0" + class="st0 st1 st2 st3" + id="tspan13">a</tspan><tspan + x="54.5" + y="0" + class="st0 st1 st2 st4" + id="tspan15">/</tspan><tspan + x="86.2" + y="0" + class="st0 st1 st2" + id="tspan17">c</tspan></text> +<rect + x="0.5" + y="0.5" + class="st5" + width="317" + height="218" + id="rect19" /></g></g></switch></svg>
\ 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 @@ +<RCC> + <qresource prefix="/images"> + <file>HMI_HVAC_AC_Active.svg</file> + <file>HMI_HVAC_AC_Inactive.svg</file> + </qresource> +</RCC> 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 <QtCore/QDebug> +#include <QtGui/QGuiApplication> +#include <QtQml/QQmlApplicationEngine> +#include <QtQuickControls2/QQuickStyle> + +#ifdef HAVE_LIBHOMESCREEN +#include <libhomescreen.hpp> +#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(); +} + |