touch example: Added main.cpp and putting qml files into resource.
authorTomasz Olszak <olszak.tomasz@gmail.com>
Mon, 17 Jun 2013 21:23:56 +0000 (21:23 +0000)
committerJarosław Staniek <staniek@kde.org>
Tue, 18 Jun 2013 20:26:43 +0000 (22:26 +0200)
Additionally added qt.conf file for deploying application to arm target.

Change-Id: I0e6af7f2d42f5b2f058e3d30b05271c178954a8d
Reviewed-by: Jarosław Staniek <staniek@kde.org>
examples/touch/main.cpp [new file with mode: 0644]
examples/touch/main.qml
examples/touch/qt.conf [new file with mode: 0644]
examples/touch/touch.pro
examples/touch/touch.qrc [new file with mode: 0644]

diff --git a/examples/touch/main.cpp b/examples/touch/main.cpp
new file mode 100644 (file)
index 0000000..56aa793
--- /dev/null
@@ -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);
+}
index f601ae7..5b6a226 100644 (file)
@@ -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 (file)
index 0000000..9205357
--- /dev/null
@@ -0,0 +1,6 @@
+[Paths]
+Prefix=/opt/usr/apps/HtoZbhWbHx
+Libraries=lib
+Binaries=bin
+Plugins=data/plugins
+Qml2Imports=data/qml
index e1b30cf..5c50c9d 100644 (file)
@@ -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 (file)
index 0000000..2ab6595
--- /dev/null
@@ -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>