summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-12 12:27:31 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-02-13 06:23:16 +0200
commit396a01b4748decf4080add69471ee846a3d2dc46 (patch)
treebd28fe86dede542ae54c6410ddb5af9c941231de /tests
parentda3a9d21f5dbbc50d6db9cde81a96f7af9bba093 (diff)
Take qml_plugin.prf into use
Enables us to lose a bunch of hacks. Change-Id: Id7641012004428aa9782cfb5dbaf9fc9c4629706 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qmlcamera/main.cpp17
-rw-r--r--tests/qmldynamicdata/main.cpp21
-rw-r--r--tests/tests.pri105
3 files changed, 21 insertions, 122 deletions
diff --git a/tests/qmlcamera/main.cpp b/tests/qmlcamera/main.cpp
index c93502f7..e486601b 100644
--- a/tests/qmlcamera/main.cpp
+++ b/tests/qmlcamera/main.cpp
@@ -16,9 +16,11 @@
**
****************************************************************************/
+#include "qtquick2applicationviewer.h"
#include <QtDataVisualization/qutils.h>
+
#include <QtGui/QGuiApplication>
-#include "qtquick2applicationviewer.h"
+#include <QtCore/QDir>
int main(int argc, char *argv[])
{
@@ -29,13 +31,14 @@ int main(int argc, char *argv[])
// Enable antialiasing
viewer.setFormat(QtDataVisualization::qDefaultSurfaceFormat());
-#ifdef Q_OS_ANDROID
- viewer.addImportPath(QString::fromLatin1("assets:/qml"));
- viewer.engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(),
- QString::fromLatin1("lib")));
+ // The following are needed to make examples run without having to install the module
+ // in desktop environments.
+#ifdef Q_OS_WIN
+ viewer.addImportPath(QString::fromLatin1("%1/../../../%2").arg(QGuiApplication::applicationDirPath(),
+ QString::fromLatin1("qml")));
#else
- viewer.addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(),
- QString::fromLatin1("qml")));
+ viewer.addImportPath(QString::fromLatin1("%1/../../%2").arg(QGuiApplication::applicationDirPath(),
+ QString::fromLatin1("qml")));
#endif
viewer.setMainQmlFile(QStringLiteral("qml/qmlcamera/main.qml"));
viewer.setResizeMode(QQuickView::SizeRootObjectToView);
diff --git a/tests/qmldynamicdata/main.cpp b/tests/qmldynamicdata/main.cpp
index c6bbd9e8..25f58e66 100644
--- a/tests/qmldynamicdata/main.cpp
+++ b/tests/qmldynamicdata/main.cpp
@@ -16,14 +16,11 @@
**
****************************************************************************/
+#include "qtquick2applicationviewer.h"
#include <QtDataVisualization/qutils.h>
+
#include <QtGui/QGuiApplication>
-#include "qtquick2applicationviewer.h"
-#ifdef Q_OS_ANDROID
-#include <QDir>
-#include <QQmlEngine>
-#endif
-#include <QDebug>
+#include <QtCore/QDir>
int main(int argc, char *argv[])
{
@@ -34,10 +31,14 @@ int main(int argc, char *argv[])
// Enable antialiasing
viewer.setFormat(QtDataVisualization::qDefaultSurfaceFormat());
-#ifdef Q_OS_ANDROID
- viewer.addImportPath(QString::fromLatin1("assets:/qml"));
- viewer.engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(),
- QString::fromLatin1("lib")));
+ // The following are needed to make examples run without having to install the module
+ // in desktop environments.
+#ifdef Q_OS_WIN
+ viewer.addImportPath(QString::fromLatin1("%1/../../../%2").arg(QGuiApplication::applicationDirPath(),
+ QString::fromLatin1("qml")));
+#else
+ viewer.addImportPath(QString::fromLatin1("%1/../../%2").arg(QGuiApplication::applicationDirPath(),
+ QString::fromLatin1("qml")));
#endif
viewer.setTitle(QStringLiteral("QML Dynamic Data Test"));
diff --git a/tests/tests.pri b/tests/tests.pri
index 59253152..c4de656d 100644
--- a/tests/tests.pri
+++ b/tests/tests.pri
@@ -1,16 +1,3 @@
-android {
- target.path = /libs/$$ANDROID_TARGET_ARCH
-} else {
- target.path = $$[QT_INSTALL_TESTS]/datavisualization/$$TARGET
-}
-
-win32 {
- CONFIG(debug, release|debug):DESTDIR = $$OUT_PWD/debug
- CONFIG(release, release|debug):DESTDIR = $$OUT_PWD/release
-} else {
- DESTDIR = $$OUT_PWD
-}
-
INCLUDEPATH += ../../include
LIBS += -L$$OUT_PWD/../../lib
@@ -18,95 +5,3 @@ LIBS += -L$$OUT_PWD/../../lib
TEMPLATE = app
QT += datavisualization
-
-!static:android {
- # Add Qt library to be loaded in shared android build
- vis_lib_name = DataVisualization
- vis_src_lib = lib$${vis_lib_name}.so
- vis_lib_dir = $$OUT_PWD/../../lib/$$vis_src_lib
- vis_lib_formatted = $$replace(vis_lib_dir, /, $$QMAKE_DIR_SEP)
- ANDROID_EXTRA_LIBS = $$vis_lib_formatted
-}
-
-contains(TARGET, qml.*) {
- uri = QtDataVisualization
- lib_name = datavisualizationqml2
-
- uri_replaced = $$replace(uri, \\., $$QMAKE_DIR_SEP)
- make_qmldir_path = $$DESTDIR/$$uri_replaced
- !exists($$make_qmldir_path) {
- make_qmldir_target = \"$$replace(make_qmldir_path, /, $$QMAKE_DIR_SEP)\"
- system($$QMAKE_MKDIR $$make_qmldir_target)
- }
- copy_qmldir.target = $$make_qmldir_path/qmldir
- copy_qmldir.depends = $$_PRO_FILE_PWD_/../../src/$$lib_name/qmldir
- copy_qmldir_formatted = \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
- copy_qmldir.commands = $(COPY_FILE) $$copy_qmldir_formatted
- QMAKE_EXTRA_TARGETS += copy_qmldir
- PRE_TARGETDEPS += $$copy_qmldir.target
-
- static:contains(QT_CONFIG, static) {
- # Make import scan find our copied qmldir & statically built qml lib
- !win32 {
- LIB_EXTENSION = a
- } else {
- LIB_EXTENSION = lib
- }
- QMLPATHS += $$DESTDIR
- # We need to copy the qmldir & lib already at qmake run stage as import scan is done then
- exists($$copy_qmldir.depends): system($$QMAKE_COPY $$copy_qmldir_formatted)
- } else {
- win32 {
- LIB_EXTENSION = dll
- } else {
- mac|ios {
- LIB_EXTENSION = dylib
- } else {
- LIB_EXTENSION = so
- }
- }
- }
-
- win32 {
- CONFIG(debug, release|debug) {
- src_dir = /debug
- src_lib = $${lib_name}d.$$LIB_EXTENSION
- }
- CONFIG(release, release|debug){
- src_dir = /release
- src_lib = $${lib_name}.$$LIB_EXTENSION
- }
- } else {
- src_dir =
- mac|ios {
- CONFIG(debug, release|debug) {
- src_lib = lib$${lib_name}_debug.$$LIB_EXTENSION
- }
- CONFIG(release, release|debug){
- src_lib = lib$${lib_name}.$$LIB_EXTENSION
- }
- } else {
- # linux, android
- src_lib = lib$${lib_name}.$$LIB_EXTENSION
- }
- }
- copy_lib.target = $$make_qmldir_path/$$src_lib
- copy_lib.depends = $$OUT_PWD/../../src/$$lib_name$$src_dir/$$src_lib
- copy_lib_formatted = \"$$replace(copy_lib.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_lib.target, /, $$QMAKE_DIR_SEP)\"
- copy_lib.commands = $(COPY_FILE) $$copy_lib_formatted
- QMAKE_EXTRA_TARGETS += copy_lib
- PRE_TARGETDEPS += $$copy_lib.target
-
- android {
- system($$QMAKE_COPY $$copy_qmldir_formatted)
- android_qmldir.files = $$copy_qmldir.target
- android_qmldir.path = /assets/qml/$$uri_replaced
- INSTALLS += android_qmldir
- }
- android|ios {
- system($$QMAKE_COPY $$copy_lib_formatted)
- android_qmlplugin.files = $$copy_lib.target
- android_qmlplugin.path = $$target.path
- INSTALLS += android_qmlplugin
- }
-}