summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-06-17 18:20:39 +0200
committerPierre Rossi <pierre.rossi@digia.com>2013-06-17 18:26:20 +0200
commitc6144131d1f97bcd69682bb733a54f2cd777f127 (patch)
treef44ff4d3c2955636ceb811bd59ed90ed22a1a58f
parent4a08bd334b661d00a9fd908d054728ab9e9a5d8d (diff)
Split out the example into two distinct ones
Cleaner than deciding on startup with an env variable
-rw-r--r--example/example.pro18
-rw-r--r--examples/common.pri10
-rw-r--r--examples/examples.pro4
-rw-r--r--examples/qtquick/icons/go-next.png (renamed from example/icons/go-next.png)bin930 -> 930 bytes
-rw-r--r--examples/qtquick/icons/go-previous.png (renamed from example/icons/go-previous.png)bin955 -> 955 bytes
-rw-r--r--examples/qtquick/icons/process-stop.png (renamed from example/icons/process-stop.png)bin1272 -> 1272 bytes
-rw-r--r--examples/qtquick/icons/view-refresh.png (renamed from example/icons/view-refresh.png)bin1364 -> 1364 bytes
-rw-r--r--examples/qtquick/main.cpp (renamed from example/main.cpp)23
-rw-r--r--examples/qtquick/qtquick.pro12
-rw-r--r--examples/qtquick/quickwindow.cpp (renamed from example/quickwindow.cpp)2
-rw-r--r--examples/qtquick/quickwindow.h (renamed from example/quickwindow.h)0
-rw-r--r--examples/qtquick/quickwindow.qml (renamed from example/quickwindow.qml)0
-rw-r--r--examples/widgets/main.cpp53
-rw-r--r--examples/widgets/widgets.pro9
-rw-r--r--examples/widgets/widgetwindow.cpp (renamed from example/widgetwindow.cpp)0
-rw-r--r--examples/widgets/widgetwindow.h (renamed from example/widgetwindow.h)0
-rw-r--r--qtwebengine.pro2
17 files changed, 92 insertions, 41 deletions
diff --git a/example/example.pro b/example/example.pro
deleted file mode 100644
index dda3c5cf4..000000000
--- a/example/example.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TEMPLATE = app
-TARGET = example
-
-HEADERS = quickwindow.h widgetwindow.h
-SOURCES = quickwindow.cpp widgetwindow.cpp main.cpp
-
-OTHER_FILES += quickwindow.qml
-
-INCLUDEPATH += ../lib
-
-LIBPATH = $$getOutDir()/$$getConfigDir()/lib
-
-LIBS += -L$$LIBPATH -lQt5WebEngine
-QMAKE_RPATHDIR += $$LIBPATH
-
-QT += widgets quick
-MOC_DIR=$$PWD
-
diff --git a/examples/common.pri b/examples/common.pri
new file mode 100644
index 000000000..b85159ce8
--- /dev/null
+++ b/examples/common.pri
@@ -0,0 +1,10 @@
+INCLUDEPATH += $$absolute_path(../lib, $$PWD)
+
+LIBPATH = $$getOutDir()/$$getConfigDir()/lib
+
+LIBS += -L$$LIBPATH -lQt5WebEngine
+QMAKE_RPATHDIR += $$LIBPATH
+
+# Quick hack for now as we mess with that for the gyp generation step.
+MOC_DIR=$$PWD/.moc
+
diff --git a/examples/examples.pro b/examples/examples.pro
new file mode 100644
index 000000000..4613dc8d8
--- /dev/null
+++ b/examples/examples.pro
@@ -0,0 +1,4 @@
+TEMPLATE=subdirs
+
+SUBDIRS += qtquick \
+ widgets
diff --git a/example/icons/go-next.png b/examples/qtquick/icons/go-next.png
index 6f3f65d33..6f3f65d33 100644
--- a/example/icons/go-next.png
+++ b/examples/qtquick/icons/go-next.png
Binary files differ
diff --git a/example/icons/go-previous.png b/examples/qtquick/icons/go-previous.png
index 93be3d1ee..93be3d1ee 100644
--- a/example/icons/go-previous.png
+++ b/examples/qtquick/icons/go-previous.png
Binary files differ
diff --git a/example/icons/process-stop.png b/examples/qtquick/icons/process-stop.png
index b68290bf1..b68290bf1 100644
--- a/example/icons/process-stop.png
+++ b/examples/qtquick/icons/process-stop.png
Binary files differ
diff --git a/example/icons/view-refresh.png b/examples/qtquick/icons/view-refresh.png
index cab4d02c7..cab4d02c7 100644
--- a/example/icons/view-refresh.png
+++ b/examples/qtquick/icons/view-refresh.png
Binary files differ
diff --git a/example/main.cpp b/examples/qtquick/main.cpp
index 129d8c6c1..ca92eb72c 100644
--- a/example/main.cpp
+++ b/examples/qtquick/main.cpp
@@ -40,21 +40,10 @@
****************************************************************************/
#include "quickwindow.h"
-#include "widgetwindow.h"
-
#include "qquickwebcontentsview.h"
+#include <QApplication>
-int mainWidget(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- WidgetWindow window;
- window.show();
-
- return app.exec();
-}
-
-int mainQuick(int argc, char **argv)
+int main(int argc, char **argv)
{
QApplication app(argc, argv);
@@ -64,11 +53,3 @@ int mainQuick(int argc, char **argv)
return app.exec();
}
-
-int main(int argc, char **argv)
-{
- if (qgetenv("QQUICKWEBENGINE").isNull())
- return mainWidget(argc, argv);
- else
- return mainQuick(argc, argv);
-}
diff --git a/examples/qtquick/qtquick.pro b/examples/qtquick/qtquick.pro
new file mode 100644
index 000000000..6d3e8a62e
--- /dev/null
+++ b/examples/qtquick/qtquick.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+TARGET = qtquick-nano-browser
+
+include(../common.pri)
+
+HEADERS = quickwindow.h
+SOURCES = quickwindow.cpp main.cpp
+
+OTHER_FILES += quickwindow.qml
+
+QT += quick \
+ widgets # QApplication is required to get native styling with QtQuickControls
diff --git a/example/quickwindow.cpp b/examples/qtquick/quickwindow.cpp
index 018f1c937..fed881fc0 100644
--- a/example/quickwindow.cpp
+++ b/examples/qtquick/quickwindow.cpp
@@ -65,5 +65,5 @@ public:
ApplicationEngine::ApplicationEngine()
{
rootContext()->setContextProperty("utils", new Utils(this));
- load(QUrl("example/quickwindow.qml"));
+ load(QUrl("quickwindow.qml"));
}
diff --git a/example/quickwindow.h b/examples/qtquick/quickwindow.h
index 3f1f944ca..3f1f944ca 100644
--- a/example/quickwindow.h
+++ b/examples/qtquick/quickwindow.h
diff --git a/example/quickwindow.qml b/examples/qtquick/quickwindow.qml
index 3fe0389bf..3fe0389bf 100644
--- a/example/quickwindow.qml
+++ b/examples/qtquick/quickwindow.qml
diff --git a/examples/widgets/main.cpp b/examples/widgets/main.cpp
new file mode 100644
index 000000000..f6c9a37b0
--- /dev/null
+++ b/examples/widgets/main.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebEngine 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$
+**
+****************************************************************************/
+
+#include "widgetwindow.h"
+#include <QApplication>
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ WidgetWindow window;
+ window.show();
+
+ return app.exec();
+}
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
new file mode 100644
index 000000000..3d0d17d7f
--- /dev/null
+++ b/examples/widgets/widgets.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = widget-nano-browser
+
+include(../common.pri)
+
+HEADERS = widgetwindow.h
+SOURCES = widgetwindow.cpp main.cpp
+
+QT += widgets
diff --git a/example/widgetwindow.cpp b/examples/widgets/widgetwindow.cpp
index 159952715..159952715 100644
--- a/example/widgetwindow.cpp
+++ b/examples/widgets/widgetwindow.cpp
diff --git a/example/widgetwindow.h b/examples/widgets/widgetwindow.h
index 334f815ea..334f815ea 100644
--- a/example/widgetwindow.h
+++ b/examples/widgets/widgetwindow.h
diff --git a/qtwebengine.pro b/qtwebengine.pro
index c08945a44..ddf013d55 100644
--- a/qtwebengine.pro
+++ b/qtwebengine.pro
@@ -8,7 +8,7 @@ SUBDIRS = shared \
lib \
process \
build \ # This is where we use the generated qt_generated.gypi and run gyp
- example \
+ examples \
# Ninja executable location needs to be determined early for extra targets. Should be fetched from cache most of the time anyway.
NINJA_EXECUTABLE = $$findNinja()