diff options
author | Tomasz Olszak <olszak.tomasz@gmail.com> | 2013-06-17 21:23:56 +0000 |
---|---|---|
committer | Jarosław Staniek <staniek@kde.org> | 2013-06-18 22:26:43 +0200 |
commit | 4b43c743f1f34090562f3a506a2e9647a44e2b66 (patch) | |
tree | 9d26c16f04186faf7d800614e0a1d413c4d858df | |
parent | 61e291a8bb23b1ed4af44995146f621ec0cb6ff6 (diff) | |
download | qtquickcontrols-tizen-4b43c743f1f34090562f3a506a2e9647a44e2b66.tar.gz qtquickcontrols-tizen-4b43c743f1f34090562f3a506a2e9647a44e2b66.tar.bz2 qtquickcontrols-tizen-4b43c743f1f34090562f3a506a2e9647a44e2b66.zip |
touch example: Added main.cpp and putting qml files into resource.
Additionally added qt.conf file for deploying application to arm target.
Change-Id: I0e6af7f2d42f5b2f058e3d30b05271c178954a8d
Reviewed-by: Jarosław Staniek <staniek@kde.org>
-rw-r--r-- | examples/touch/main.cpp | 53 | ||||
-rw-r--r-- | examples/touch/main.qml | 14 | ||||
-rw-r--r-- | examples/touch/qt.conf | 6 | ||||
-rw-r--r-- | examples/touch/touch.pro | 18 | ||||
-rw-r--r-- | examples/touch/touch.qrc | 27 |
5 files changed, 111 insertions, 7 deletions
diff --git a/examples/touch/main.cpp b/examples/touch/main.cpp new file mode 100644 index 0000000..56aa793 --- /dev/null +++ b/examples/touch/main.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com> + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <QGuiApplication> +#include <QQuickWindow> +#include <QtDebug> +#include <QtGlobal> +#include <QQmlApplicationEngine> + +extern "C" int OspMain(int argc, char *argv[]) +{ + qputenv("QT_QUICK_CONTROLS_STYLE","Tizen"); + QGuiApplication app(argc,argv); + + QQmlApplicationEngine engine(QUrl("qrc:///main.qml")); + QQuickWindow *window = qobject_cast<QQuickWindow *>(engine.rootObjects().at(0)); + if (window) { + window->show(); + return app.exec(); + } else { + qWarning() << "null window"; + return -1; + } +} + + +int main(int argc, char *argv[]) { + return OspMain(argc,argv); +} diff --git a/examples/touch/main.qml b/examples/touch/main.qml index f601ae7..5b6a226 100644 --- a/examples/touch/main.qml +++ b/examples/touch/main.qml @@ -44,13 +44,21 @@ import QtQuick.Controls.Tizen 1.0 import "content" ApplicationWindow { + y: 60 width: 720 - height: 1280 + height: 1220 Rectangle { color: "#F8F6EF" anchors.fill: parent } + property bool active:Qt.application.active + + onActiveChanged: { + if (!active) { + Qt.quit() + } + } // Implements back key navigation Keys.onReleased: { @@ -132,10 +140,6 @@ ApplicationWindow { title: "SplitView" page: "content/SplitViewPage.qml" } - ListElement { - title: "TextInput" - page: "content/TextInputPage.qml" - } } StackView { diff --git a/examples/touch/qt.conf b/examples/touch/qt.conf new file mode 100644 index 0000000..9205357 --- /dev/null +++ b/examples/touch/qt.conf @@ -0,0 +1,6 @@ +[Paths] +Prefix=/opt/usr/apps/HtoZbhWbHx +Libraries=lib +Binaries=bin +Plugins=data/plugins +Qml2Imports=data/qml diff --git a/examples/touch/touch.pro b/examples/touch/touch.pro index e1b30cf..5c50c9d 100644 --- a/examples/touch/touch.pro +++ b/examples/touch/touch.pro @@ -1,4 +1,10 @@ -TEMPLATE=aux +TEMPLATE=app + +QMAKE_LFLAGS+=-pie -rdynamic + +TARGET=QtControls.exe + +QT += qml quick OTHER_FILES += \ main.qml \ @@ -10,6 +16,14 @@ OTHER_FILES += \ content/CheckBoxPage.qml \ content/TextInputPage.qml \ content/ContextMenuPage.qml \ - content/SplitViewPage.qml + content/SplitViewPage.qml \ + qt.conf + +SOURCES += \ + main.cpp + +RESOURCES += \ + touch.qrc + diff --git a/examples/touch/touch.qrc b/examples/touch/touch.qrc new file mode 100644 index 0000000..2ab6595 --- /dev/null +++ b/examples/touch/touch.qrc @@ -0,0 +1,27 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>images/toolbar.png</file> + <file>images/textinput.png</file> + <file>images/tabs_standard.png</file> + <file>images/tab_selected.png</file> + <file>images/navigation_previous_item.png</file> + <file>images/navigation_next_item.png</file> + <file>images/internet-web-browser.png</file> + <file>images/internet-mail.png</file> + <file>images/button_pressed.png</file> + <file>images/button_default.png</file> + <file>content/ContextMenuPage.qml</file> + <file>content/SplitViewPage.qml</file> + <file>content/TextInputPage.qml</file> + <file>content/TabBarPage.qml</file> + <file>content/SliderPage.qml</file> + <file>content/ProgressBarPage.qml</file> + <file>content/CheckBoxPage.qml</file> + <file>content/ButtonPage.qml</file> + <file>content/AndroidDelegate.qml</file> + </qresource> + <qresource prefix="/qt/etc"> + <file>qt.conf</file> + </qresource> +</RCC> |