From 89de921c2f6928a691f6aaa2165b5c1739f156cd Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Date: Mon, 13 May 2013 11:19:04 +0200
Subject: [PATCH] Examples: Make example projects work with Qt Creator

It seems pure qml projects don't really work in our
examples architecture at the moment. This change
adds a simple main file and resource bundle to
each of the example folders.

Change-Id: I4758242e71a2cb053252cbb09bf5c4439415691d
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
---
 .../controls/basiclayouts/basiclayouts.pro    | 18 ++++
 .../quick/controls/basiclayouts/resources.qrc |  5 ++
 .../quick/controls/basiclayouts/src/main.cpp  | 42 +++++++++
 .../quick/controls/basiclayouts/src/src.pri   |  2 +
 examples/quick/controls/controls.pro          |  3 +-
 examples/quick/controls/gallery/gallery.pro   | 16 +++-
 examples/quick/controls/gallery/resources.qrc | 22 +++++
 examples/quick/controls/gallery/src/main.cpp  | 42 +++++++++
 examples/quick/controls/gallery/src/src.pri   |  2 +
 .../shared/qt_quick_controls_examplemain.h    | 87 +++++++++++++++++++
 .../quick/controls/splitview/resources.qrc    |  5 ++
 .../quick/controls/splitview/splitview.pro    | 16 +++-
 .../quick/controls/splitview/src/main.cpp     | 42 +++++++++
 examples/quick/controls/splitview/src/src.pri |  2 +
 examples/quick/controls/tableview/main.qml    |  3 +-
 .../quick/controls/tableview/resources.qrc    |  7 ++
 .../quick/controls/tableview/src/main.cpp     | 42 +++++++++
 examples/quick/controls/tableview/src/src.pri |  2 +
 .../quick/controls/tableview/tableview.pro    | 16 +++-
 examples/quick/controls/touch/resources.qrc   | 19 ++++
 examples/quick/controls/touch/src/main.cpp    | 42 +++++++++
 examples/quick/controls/touch/src/src.pri     |  2 +
 examples/quick/controls/touch/touch.pro       | 16 +++-
 23 files changed, 447 insertions(+), 6 deletions(-)
 create mode 100644 examples/quick/controls/basiclayouts/basiclayouts.pro
 create mode 100644 examples/quick/controls/basiclayouts/resources.qrc
 create mode 100644 examples/quick/controls/basiclayouts/src/main.cpp
 create mode 100644 examples/quick/controls/basiclayouts/src/src.pri
 create mode 100644 examples/quick/controls/gallery/resources.qrc
 create mode 100644 examples/quick/controls/gallery/src/main.cpp
 create mode 100644 examples/quick/controls/gallery/src/src.pri
 create mode 100644 examples/quick/controls/shared/qt_quick_controls_examplemain.h
 create mode 100644 examples/quick/controls/splitview/resources.qrc
 create mode 100644 examples/quick/controls/splitview/src/main.cpp
 create mode 100644 examples/quick/controls/splitview/src/src.pri
 create mode 100644 examples/quick/controls/tableview/resources.qrc
 create mode 100644 examples/quick/controls/tableview/src/main.cpp
 create mode 100644 examples/quick/controls/tableview/src/src.pri
 create mode 100644 examples/quick/controls/touch/resources.qrc
 create mode 100644 examples/quick/controls/touch/src/main.cpp
 create mode 100644 examples/quick/controls/touch/src/src.pri

diff --git a/examples/quick/controls/basiclayouts/basiclayouts.pro b/examples/quick/controls/basiclayouts/basiclayouts.pro
new file mode 100644
index 000000000..2a3326aaf
--- /dev/null
+++ b/examples/quick/controls/basiclayouts/basiclayouts.pro
@@ -0,0 +1,18 @@
+QT += qml quick
+TARGET = basiclayouts
+qtHaveModule(widgets) {
+    QT += widgets
+}
+
+include(src/src.pri)
+
+OTHER_FILES += \
+    main.qml
+
+RESOURCES += \
+    resources.qrc
+
+MOC_DIR = ./.moc
+OBJECTS_DIR = ./.obj
+UI_DIR = ./.ui
+RCC_DIR = ./.rcc
diff --git a/examples/quick/controls/basiclayouts/resources.qrc b/examples/quick/controls/basiclayouts/resources.qrc
new file mode 100644
index 000000000..3b111a907
--- /dev/null
+++ b/examples/quick/controls/basiclayouts/resources.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+  <file>main.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/quick/controls/basiclayouts/src/main.cpp b/examples/quick/controls/basiclayouts/src/main.cpp
new file mode 100644
index 000000000..57ba57e35
--- /dev/null
+++ b/examples/quick/controls/basiclayouts/src/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "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 COPYRIGHT
+** OWNER OR CONTRIBUTORS 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."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../shared/qt_quick_controls_examplemain.h"
+QT_QUICK_CONTROLS_EXAMPLE_MAIN(qrc:/main.qml)
diff --git a/examples/quick/controls/basiclayouts/src/src.pri b/examples/quick/controls/basiclayouts/src/src.pri
new file mode 100644
index 000000000..66d903eac
--- /dev/null
+++ b/examples/quick/controls/basiclayouts/src/src.pri
@@ -0,0 +1,2 @@
+SOURCES += \
+    $$PWD/main.cpp
diff --git a/examples/quick/controls/controls.pro b/examples/quick/controls/controls.pro
index 0be155cd7..59423b64a 100644
--- a/examples/quick/controls/controls.pro
+++ b/examples/quick/controls/controls.pro
@@ -5,7 +5,8 @@ SUBDIRS += \
     splitview \
     stackview \
     tableview \
-    touch
+    touch \
+    basiclayouts
 
 qtHaveModule(widgets) {
     SUBDIRS += text \
diff --git a/examples/quick/controls/gallery/gallery.pro b/examples/quick/controls/gallery/gallery.pro
index 82f8b3e28..a5640a3f8 100644
--- a/examples/quick/controls/gallery/gallery.pro
+++ b/examples/quick/controls/gallery/gallery.pro
@@ -1,4 +1,10 @@
-TEMPLATE = aux
+QT += qml quick
+TARGET = gallery
+qtHaveModule(widgets) {
+    QT += widgets
+}
+
+include(src/src.pri)
 
 OTHER_FILES += \
     main.qml \
@@ -8,3 +14,11 @@ OTHER_FILES += \
     content/ModelView.qml \
     content/Panel.qml \
     content/Styles.qml
+
+RESOURCES += \
+    resources.qrc
+
+MOC_DIR = ./.moc
+OBJECTS_DIR = ./.obj
+UI_DIR = ./.ui
+RCC_DIR = ./.rcc
diff --git a/examples/quick/controls/gallery/resources.qrc b/examples/quick/controls/gallery/resources.qrc
new file mode 100644
index 000000000..14e88e52b
--- /dev/null
+++ b/examples/quick/controls/gallery/resources.qrc
@@ -0,0 +1,22 @@
+<RCC>
+    <qresource prefix="/">
+        <file>main.qml</file>
+        <file>content/ChildWindow.qml</file>
+        <file>content/Controls.qml</file>
+        <file>content/ImageViewer.qml</file>
+        <file>content/ModelView.qml</file>
+        <file>content/Panel.qml</file>
+        <file>content/Styles.qml</file>
+        <file>images/document-open.png</file>
+        <file>images/document-open@2x.png</file>
+        <file>images/document-save-as.png</file>
+        <file>images/document-save-as@2x.png</file>
+        <file>images/folder_new.png</file>
+        <file>images/page.png</file>
+        <file>images/tab.png</file>
+        <file>images/tab_selected.png</file>
+        <file>images/window-new.png</file>
+        <file>images/window-new@2x.png</file>
+        <file>images/panel.png</file>
+    </qresource>
+</RCC>
diff --git a/examples/quick/controls/gallery/src/main.cpp b/examples/quick/controls/gallery/src/main.cpp
new file mode 100644
index 000000000..57ba57e35
--- /dev/null
+++ b/examples/quick/controls/gallery/src/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "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 COPYRIGHT
+** OWNER OR CONTRIBUTORS 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."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../shared/qt_quick_controls_examplemain.h"
+QT_QUICK_CONTROLS_EXAMPLE_MAIN(qrc:/main.qml)
diff --git a/examples/quick/controls/gallery/src/src.pri b/examples/quick/controls/gallery/src/src.pri
new file mode 100644
index 000000000..66d903eac
--- /dev/null
+++ b/examples/quick/controls/gallery/src/src.pri
@@ -0,0 +1,2 @@
+SOURCES += \
+    $$PWD/main.cpp
diff --git a/examples/quick/controls/shared/qt_quick_controls_examplemain.h b/examples/quick/controls/shared/qt_quick_controls_examplemain.h
new file mode 100644
index 000000000..e3cae9a09
--- /dev/null
+++ b/examples/quick/controls/shared/qt_quick_controls_examplemain.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_QUICK_CONTROLS_EXAMPLEMAIN_H
+#define QT_QUICK_CONTROLS_EXAMPLEMAIN_H
+
+#include <QtQml>
+#include <QtQuick/QQuickView>
+#include <QtCore/QString>
+
+#ifndef QT_NO_WIDGETS
+#include <QtWidgets/QApplication>
+#else
+#include <QtGui/QGuiApplication>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_WIDGETS
+#define Application QApplication
+#else
+#define Application QGuiApplication
+#endif
+
+#define QT_QUICK_CONTROLS_EXAMPLE_MAIN(url) \
+    int main(int argc, char *argv[]) \
+    { \
+        Application app(argc, argv); \
+        QQmlEngine engine; \
+        QQmlComponent component(&engine); \
+        component.loadUrl(QUrl(#url)); \
+        if ( !component.isReady() ) { \
+            qWarning("%s", qPrintable(component.errorString())); \
+            return -1; \
+        } \
+        QObject *topLevel = component.create(); \
+        QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel); \
+        if ( !window ) { \
+            qWarning("Error: Your root item has to be a Window."); \
+            return -1; \
+        } \
+        QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit())); \
+        window->show(); \
+        return app.exec(); \
+    }
+
+QT_END_NAMESPACE
+
+#endif // QT_QUICK_CONTROLS_EXAMPLEMAIN_H
diff --git a/examples/quick/controls/splitview/resources.qrc b/examples/quick/controls/splitview/resources.qrc
new file mode 100644
index 000000000..3b111a907
--- /dev/null
+++ b/examples/quick/controls/splitview/resources.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+  <file>main.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/quick/controls/splitview/splitview.pro b/examples/quick/controls/splitview/splitview.pro
index 8b88e385c..2db2f2cbd 100644
--- a/examples/quick/controls/splitview/splitview.pro
+++ b/examples/quick/controls/splitview/splitview.pro
@@ -1,4 +1,18 @@
-TEMPLATE = aux
+QT += qml quick
+TARGET = splitview
+qtHaveModule(widgets) {
+    QT += widgets
+}
+
+include(src/src.pri)
 
 OTHER_FILES += \
     main.qml
+
+RESOURCES += \
+    resources.qrc
+
+MOC_DIR = ./.moc
+OBJECTS_DIR = ./.obj
+UI_DIR = ./.ui
+RCC_DIR = ./.rcc
diff --git a/examples/quick/controls/splitview/src/main.cpp b/examples/quick/controls/splitview/src/main.cpp
new file mode 100644
index 000000000..57ba57e35
--- /dev/null
+++ b/examples/quick/controls/splitview/src/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "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 COPYRIGHT
+** OWNER OR CONTRIBUTORS 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."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../shared/qt_quick_controls_examplemain.h"
+QT_QUICK_CONTROLS_EXAMPLE_MAIN(qrc:/main.qml)
diff --git a/examples/quick/controls/splitview/src/src.pri b/examples/quick/controls/splitview/src/src.pri
new file mode 100644
index 000000000..66d903eac
--- /dev/null
+++ b/examples/quick/controls/splitview/src/src.pri
@@ -0,0 +1,2 @@
+SOURCES += \
+    $$PWD/main.cpp
diff --git a/examples/quick/controls/tableview/main.qml b/examples/quick/controls/tableview/main.qml
index 997a22419..17e97bc12 100644
--- a/examples/quick/controls/tableview/main.qml
+++ b/examples/quick/controls/tableview/main.qml
@@ -43,10 +43,11 @@
 
 
 import QtQuick 2.1
+import QtQuick.Window 2.1
 import QtQuick.Controls 1.0
 import QtQuick.XmlListModel 2.0
 
-Rectangle {
+Window {
 
     width: 538 + frame.margins * 2
     height: 360 + frame.margins * 2
diff --git a/examples/quick/controls/tableview/resources.qrc b/examples/quick/controls/tableview/resources.qrc
new file mode 100644
index 000000000..f395013f5
--- /dev/null
+++ b/examples/quick/controls/tableview/resources.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+  <file>main.qml</file>
+  <file>images/selectedrow.png</file>
+  <file>images/header.png</file>
+</qresource>
+</RCC>
diff --git a/examples/quick/controls/tableview/src/main.cpp b/examples/quick/controls/tableview/src/main.cpp
new file mode 100644
index 000000000..57ba57e35
--- /dev/null
+++ b/examples/quick/controls/tableview/src/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "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 COPYRIGHT
+** OWNER OR CONTRIBUTORS 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."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../shared/qt_quick_controls_examplemain.h"
+QT_QUICK_CONTROLS_EXAMPLE_MAIN(qrc:/main.qml)
diff --git a/examples/quick/controls/tableview/src/src.pri b/examples/quick/controls/tableview/src/src.pri
new file mode 100644
index 000000000..66d903eac
--- /dev/null
+++ b/examples/quick/controls/tableview/src/src.pri
@@ -0,0 +1,2 @@
+SOURCES += \
+    $$PWD/main.cpp
diff --git a/examples/quick/controls/tableview/tableview.pro b/examples/quick/controls/tableview/tableview.pro
index 8b88e385c..fa6f3453b 100644
--- a/examples/quick/controls/tableview/tableview.pro
+++ b/examples/quick/controls/tableview/tableview.pro
@@ -1,4 +1,18 @@
-TEMPLATE = aux
+QT += qml quick
+TARGET = tableview
+qtHaveModule(widgets) {
+    QT += widgets
+}
+
+include(src/src.pri)
 
 OTHER_FILES += \
     main.qml
+
+RESOURCES += \
+    resources.qrc
+
+MOC_DIR = ./.moc
+OBJECTS_DIR = ./.obj
+UI_DIR = ./.ui
+RCC_DIR = ./.rcc
diff --git a/examples/quick/controls/touch/resources.qrc b/examples/quick/controls/touch/resources.qrc
new file mode 100644
index 000000000..33da22ccb
--- /dev/null
+++ b/examples/quick/controls/touch/resources.qrc
@@ -0,0 +1,19 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+  <file>main.qml</file>
+  <file>content/AndroidDelegate.qml</file>
+  <file>content/ButtonPage.qml</file>
+  <file>content/ProgressBarPage.qml</file>
+  <file>content/SliderPage.qml</file>
+  <file>content/TabBarPage.qml</file>
+  <file>content/TextInputPage.qml</file>
+  <file>images/button_default.png</file>
+  <file>images/button_pressed.png</file>
+  <file>images/navigation_next_item.png</file>
+  <file>images/navigation_previous_item.png</file>
+  <file>images/tab_selected.png</file>
+  <file>images/tabs_standard.png</file>
+  <file>images/textinput.png</file>
+  <file>images/toolbar.png</file>
+</qresource>
+</RCC>
diff --git a/examples/quick/controls/touch/src/main.cpp b/examples/quick/controls/touch/src/main.cpp
new file mode 100644
index 000000000..57ba57e35
--- /dev/null
+++ b/examples/quick/controls/touch/src/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "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 COPYRIGHT
+** OWNER OR CONTRIBUTORS 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."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../shared/qt_quick_controls_examplemain.h"
+QT_QUICK_CONTROLS_EXAMPLE_MAIN(qrc:/main.qml)
diff --git a/examples/quick/controls/touch/src/src.pri b/examples/quick/controls/touch/src/src.pri
new file mode 100644
index 000000000..66d903eac
--- /dev/null
+++ b/examples/quick/controls/touch/src/src.pri
@@ -0,0 +1,2 @@
+SOURCES += \
+    $$PWD/main.cpp
diff --git a/examples/quick/controls/touch/touch.pro b/examples/quick/controls/touch/touch.pro
index f81aa0585..adeb5e461 100644
--- a/examples/quick/controls/touch/touch.pro
+++ b/examples/quick/controls/touch/touch.pro
@@ -1,4 +1,10 @@
-TEMPLATE = aux
+QT += qml quick
+TARGET = touch
+qtHaveModule(widgets) {
+    QT += widgets
+}
+
+include(src/src.pri)
 
 OTHER_FILES += \
     main.qml \
@@ -8,3 +14,11 @@ OTHER_FILES += \
     content/SliderPage.qml \
     content/TabBarPage.qml \
     content/TextInputPage.qml
+
+RESOURCES += \
+    resources.qrc
+
+MOC_DIR = ./.moc
+OBJECTS_DIR = ./.obj
+UI_DIR = ./.ui
+RCC_DIR = ./.rcc
-- 
GitLab