diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-09-09 14:01:45 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-09-10 06:18:20 +0300 |
commit | 2cd23faa1fe1ae68de64b21c89e4a78cc289dc1d (patch) | |
tree | b4e093e3de340cc5803866509e3c3b1bdac2a038 /examples | |
parent | 0153f9889ee757b0a215e5c36c14a9561cc9b098 (diff) |
QML support for surface added
Task-number: QTRD-2253
- incomplete (as is surface itself)
- documentation incomplete
- example needs better data
Change-Id: I87063925749448c6cad2f1b529f2669514fb1cb9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/examples.pro | 1 | ||||
-rw-r--r-- | examples/qmlbarchart/doc/src/qmlbarchart.qdoc | 2 | ||||
-rw-r--r-- | examples/qmlscatter/doc/src/qmlscatter.qdoc | 2 | ||||
-rw-r--r-- | examples/qmlsurface/doc/src/qmlsurface.qdoc | 29 | ||||
-rw-r--r-- | examples/qmlsurface/main.cpp | 45 | ||||
-rw-r--r-- | examples/qmlsurface/qml/qmlsurface/button.qml | 59 | ||||
-rw-r--r-- | examples/qmlsurface/qml/qmlsurface/data.qml | 58 | ||||
-rw-r--r-- | examples/qmlsurface/qml/qmlsurface/main.qml | 92 | ||||
-rw-r--r-- | examples/qmlsurface/qmlsurface.desktop | 11 | ||||
-rw-r--r-- | examples/qmlsurface/qmlsurface.pro | 22 | ||||
-rw-r--r-- | examples/qmlsurface/qmlsurface.qrc | 7 | ||||
-rw-r--r-- | examples/qmlsurface/qmlsurface64.png | bin | 0 -> 3400 bytes | |||
-rw-r--r-- | examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.cpp | 81 | ||||
-rw-r--r-- | examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.h | 33 | ||||
-rw-r--r-- | examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.pri | 170 |
15 files changed, 610 insertions, 2 deletions
diff --git a/examples/examples.pro b/examples/examples.pro index 41cccfc1..46ed44e5 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -4,6 +4,7 @@ SUBDIRS += barchart \ widget \ qmlbarchart \ qmlscatter \ + qmlsurface \ surfacechart \ scatterchart diff --git a/examples/qmlbarchart/doc/src/qmlbarchart.qdoc b/examples/qmlbarchart/doc/src/qmlbarchart.qdoc index becc5d8b..091d4b77 100644 --- a/examples/qmlbarchart/doc/src/qmlbarchart.qdoc +++ b/examples/qmlbarchart/doc/src/qmlbarchart.qdoc @@ -20,7 +20,7 @@ \example qmlbarchart \title Qt Quick 2 Barchart Example - The Qt Quick 2 barchart example shows how to make a simple 3D bar chart using Q3DBars using Qt + The Qt Quick 2 barchart example shows how to make a simple 3D bar chart using Q3DBars and Qt Quick 2. \image qmlbarchart-example.png diff --git a/examples/qmlscatter/doc/src/qmlscatter.qdoc b/examples/qmlscatter/doc/src/qmlscatter.qdoc index d52798c2..4c1d8c2f 100644 --- a/examples/qmlscatter/doc/src/qmlscatter.qdoc +++ b/examples/qmlscatter/doc/src/qmlscatter.qdoc @@ -21,7 +21,7 @@ \title Qt Quick 2 Scatter Example The Qt Quick 2 scatter example shows how to make a simple scatter chart visualization using - Q3DScatter using Qt Quick 2. + Q3DScatter and Qt Quick 2. \image qmlscatter-example.png diff --git a/examples/qmlsurface/doc/src/qmlsurface.qdoc b/examples/qmlsurface/doc/src/qmlsurface.qdoc new file mode 100644 index 00000000..23a5a67d --- /dev/null +++ b/examples/qmlsurface/doc/src/qmlsurface.qdoc @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVis3D module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +/*! + \example qmlsurface + \title Qt Quick 2 Surface Example + + The Qt Quick 2 surface example shows how to make a simple 3D surface plot using Q3DSurface with + Qt Quick 2. + + \image qmlsurface-example.png + + TODO +*/ diff --git a/examples/qmlsurface/main.cpp b/examples/qmlsurface/main.cpp new file mode 100644 index 00000000..b58e66f8 --- /dev/null +++ b/examples/qmlsurface/main.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVis3D module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#include <QtGui/QGuiApplication> +#include "qtquick2applicationviewer.h" +#ifdef Q_OS_ANDROID +#include <QDir> +#include <QQmlEngine> +#endif +#include <QDebug> + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QtQuick2ApplicationViewer viewer; +#ifdef Q_OS_ANDROID + viewer.addImportPath(QString::fromLatin1("assets:/qml")); + viewer.engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(), + QString::fromLatin1("lib"))); +#else + viewer.addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), + QString::fromLatin1("qml"))); +#endif + viewer.setSource(QUrl("qrc:/qml/main.qml")); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.show(); + + return app.exec(); +} diff --git a/examples/qmlsurface/qml/qmlsurface/button.qml b/examples/qmlsurface/qml/qmlsurface/button.qml new file mode 100644 index 00000000..75032c39 --- /dev/null +++ b/examples/qmlsurface/qml/qmlsurface/button.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVis3D module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.1 + +Item { + id: button + + property alias text: buttonText.text + property alias color: buttonRectangle.color + property alias radius: buttonRectangle.radius + + property color defaultColor: "steelblue" + property color pressedColor: "lightsteelblue" + property color borderColor: "darkblue" + + signal clicked + + height: 75 + + Rectangle { + id: buttonRectangle + width: parent.width + height: parent.height + color: defaultColor + radius: 5 + border.color: borderColor + + Text { + id: buttonText + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + anchors.fill: parent + } + + MouseArea { + anchors.fill: parent + onPressed: buttonRectangle.color = pressedColor + onReleased: buttonRectangle.color = defaultColor + onClicked: button.clicked() + } + } +} diff --git a/examples/qmlsurface/qml/qmlsurface/data.qml b/examples/qmlsurface/qml/qmlsurface/data.qml new file mode 100644 index 00000000..c1601e71 --- /dev/null +++ b/examples/qmlsurface/qml/qmlsurface/data.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVis3D module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.1 +import com.digia.QtDataVis3D 1.0 + +Item { + property alias mapping: surfaceMapping + property alias model: dataModel + property alias proxy: modelProxy + + SurfaceDataMapping { + id: surfaceMapping + rowRole: "year" + columnRole: "month" + valueRole: "expenses" + rowCategories: ["2000", "2001", "2002", "2003"] + columnCategories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + } + + ItemModelSurfaceDataProxy { + id: modelProxy + activeMapping: surfaceMapping + itemModel: dataModel + } + + ListModel { + id: dataModel + ListElement{ year: "2000"; month: "Jan"; expenses: "3"; } + ListElement{ year: "2000"; month: "Feb"; expenses: "8"; } + ListElement{ year: "2000"; month: "Mar"; expenses: "10"; } + ListElement{ year: "2000"; month: "Apr"; expenses: "12"; } + ListElement{ year: "2000"; month: "May"; expenses: "10"; } + ListElement{ year: "2000"; month: "Jun"; expenses: "5"; } + ListElement{ year: "2000"; month: "Jul"; expenses: "1"; } + ListElement{ year: "2000"; month: "Aug"; expenses: "7"; } + ListElement{ year: "2000"; month: "Sep"; expenses: "4"; } + ListElement{ year: "2000"; month: "Oct"; expenses: "22"; } + ListElement{ year: "2000"; month: "Nov"; expenses: "16"; } + ListElement{ year: "2000"; month: "Dec"; expenses: "2"; } + } +} diff --git a/examples/qmlsurface/qml/qmlsurface/main.qml b/examples/qmlsurface/qml/qmlsurface/main.qml new file mode 100644 index 00000000..b5b0cc87 --- /dev/null +++ b/examples/qmlsurface/qml/qmlsurface/main.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVis3D module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import com.digia.QtDataVis3D 1.0 +import "." + +Item { + id: mainview + width: 1280 + height: 1024 + visible: true + + Data { + id: surfaceData + } + + Item { + id: surfaceView + width: mainview.width - surfaceGridToggle.width + height: mainview.height + anchors.right: mainview.right; + + Surface3D { + id: surfaceplot + width: surfaceView.width + height: surfaceView.height + //shadowQuality: Surface3D.ShadowMedium + font.pointSize: 35 + cameraPreset: Surface3D.PresetIsometricLeft + itemLabelFormat: "X:@xLabel Y:@yLabel Z:@zLabel" + dataProxy: surfaceData.proxy +// axisX.segmentCount: 4 +// axisX.subSegmentCount: 1 +// axisX.labelFormat: "%.2f" +// axisZ.segmentCount: 1 +// axisZ.subSegmentCount: 1 +// axisZ.labelFormat: "%.2f" +// axisY.segmentCount: 1 +// axisY.subSegmentCount: 1 +// axisY.labelFormat: "%.2f" + } + } + + Button { + id: surfaceGridToggle + anchors.left: parent.left + width: 200 + text: "Hide Surface Grid" + onClicked: { + if (surfaceplot.surfaceGrid == false) { + surfaceplot.surfaceGrid = true; + text = "Hide Surface Grid" + } else { + surfaceplot.surfaceGrid = false; + text = "Show Surface Grid" + } + } + } + + Button { + id: smoothSurfaceToggle + anchors.top: surfaceGridToggle.bottom + width: surfaceGridToggle.width + text: "Show Smooth" + onClicked: { + if (surfaceplot.smoothSurface == true) { + surfaceplot.smoothSurface = false; + text = "Show Smooth" + } else { + surfaceplot.smoothSurface = true; + text = "Show Flat" + } + } + } +} diff --git a/examples/qmlsurface/qmlsurface.desktop b/examples/qmlsurface/qmlsurface.desktop new file mode 100644 index 00000000..66dd0a72 --- /dev/null +++ b/examples/qmlsurface/qmlsurface.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=qmlsurface +Exec=/opt/qmlsurface/bin/qmlsurface +Icon=qmlsurface64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/qmlsurface/qmlsurface.pro b/examples/qmlsurface/qmlsurface.pro new file mode 100644 index 00000000..251619cf --- /dev/null +++ b/examples/qmlsurface/qmlsurface.pro @@ -0,0 +1,22 @@ +!include( ../examples.pri ) { + error( "Couldn't find the examples.pri file!" ) +} + +QT += widgets + +# Add more folders to ship with the application, here +folder_01.source = qml/qmlsurface +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +include(qtquick2applicationviewer/qtquick2applicationviewer.pri) +qtcAddDeployment() + +RESOURCES += qmlsurface.qrc diff --git a/examples/qmlsurface/qmlsurface.qrc b/examples/qmlsurface/qmlsurface.qrc new file mode 100644 index 00000000..87883d07 --- /dev/null +++ b/examples/qmlsurface/qmlsurface.qrc @@ -0,0 +1,7 @@ +<RCC> + <qresource prefix="/qml"> + <file alias="main.qml">qml/qmlsurface/main.qml</file> + <file alias="Button.qml">qml/qmlsurface/button.qml</file> + <file alias="Data.qml">qml/qmlsurface/data.qml</file> + </qresource> +</RCC> diff --git a/examples/qmlsurface/qmlsurface64.png b/examples/qmlsurface/qmlsurface64.png Binary files differnew file mode 100644 index 00000000..707d5c4e --- /dev/null +++ b/examples/qmlsurface/qmlsurface64.png diff --git a/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.cpp new file mode 100644 index 00000000..10709d7a --- /dev/null +++ b/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -0,0 +1,81 @@ +// checksum 0x4f6f version 0x90005 +/* + This file was generated by the Qt Quick 2 Application wizard of Qt Creator. + QtQuick2ApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#include "qtquick2applicationviewer.h" + +#include <QtCore/QCoreApplication> +#include <QtCore/QDir> +#include <QtQml/QQmlEngine> + +class QtQuick2ApplicationViewerPrivate +{ + QString mainQmlFile; + friend class QtQuick2ApplicationViewer; + static QString adjustPath(const QString &path); +}; + +QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) +{ +#if defined(Q_OS_MAC) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/../Resources/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_BLACKBERRY) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("app/native/%1").arg(path); +#elif !defined(Q_OS_ANDROID) + QString pathInInstallDir = + QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; + pathInInstallDir = + QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; +#endif + return path; +} + +QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent) + : QQuickView(parent) + , d(new QtQuick2ApplicationViewerPrivate()) +{ + connect(engine(), SIGNAL(quit()), SLOT(close())); + setResizeMode(QQuickView::SizeRootObjectToView); +} + +QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() +{ + delete d; +} + +void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file) +{ + d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file); +#ifdef Q_OS_ANDROID + setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); +#else + setSource(QUrl::fromLocalFile(d->mainQmlFile)); +#endif +} + +void QtQuick2ApplicationViewer::addImportPath(const QString &path) +{ + engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path)); +} + +void QtQuick2ApplicationViewer::showExpanded() +{ +#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX) + showFullScreen(); +#else + show(); +#endif +} diff --git a/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.h b/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.h new file mode 100644 index 00000000..cf66f140 --- /dev/null +++ b/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.h @@ -0,0 +1,33 @@ +// checksum 0xfde6 version 0x90005 +/* + This file was generated by the Qt Quick 2 Application wizard of Qt Creator. + QtQuick2ApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#ifndef QTQUICK2APPLICATIONVIEWER_H +#define QTQUICK2APPLICATIONVIEWER_H + +#include <QtQuick/QQuickView> + +class QtQuick2ApplicationViewer : public QQuickView +{ + Q_OBJECT + +public: + explicit QtQuick2ApplicationViewer(QWindow *parent = 0); + virtual ~QtQuick2ApplicationViewer(); + + void setMainQmlFile(const QString &file); + void addImportPath(const QString &path); + + void showExpanded(); + +private: + class QtQuick2ApplicationViewerPrivate *d; +}; + +#endif // QTQUICK2APPLICATIONVIEWER_H diff --git a/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.pri b/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.pri new file mode 100644 index 00000000..a071e63d --- /dev/null +++ b/examples/qmlsurface/qtquick2applicationviewer/qtquick2applicationviewer.pri @@ -0,0 +1,170 @@ +# checksum 0x7b0d version 0x90005 +# This file was generated by the Qt Quick 2 Application wizard of Qt Creator. +# The code below adds the QtQuick2ApplicationViewer to the project and handles +# the activation of QML debugging. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. + +QT += qml quick + +SOURCES += $$PWD/qtquick2applicationviewer.cpp +HEADERS += $$PWD/qtquick2applicationviewer.h +INCLUDEPATH += $$PWD +# This file was generated by an application wizard of Qt Creator. +# The code below handles deployment to Android and Maemo, aswell as copying +# of the application data to shadow build directories on desktop. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. + +defineTest(qtcAddDeployment) { +for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + greaterThan(QT_MAJOR_VERSION, 4) { + itemsources = $${item}.files + } else { + itemsources = $${item}.sources + } + $$itemsources = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath= $$eval($${deploymentfolder}.target) + export($$itemsources) + export($$itempath) + DEPLOYMENT += $$item +} + +MAINPROFILEPWD = $$PWD + +android-no-sdk { + for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemfiles = $${item}.files + $$itemfiles = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath = /data/user/qt/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + + target.path = /data/user/qt + + export(target.path) + INSTALLS += target +} else:android { + for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemfiles = $${item}.files + $$itemfiles = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath = /assets/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + INSTALLS += target +} else:win32 { + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, /, \\) + sourcePathSegments = $$split(source, \\) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) + target = $$replace(target, /, \\) + target ~= s,\\\\\\.?\\\\,\\, + !isEqual(source,$$target) { + !isEmpty(copyCommand):copyCommand += && + isEqual(QMAKE_DIR_SEP, \\) { + copyCommand += $(COPY_DIR) \"$$source\" \"$$target\" + } else { + source = $$replace(source, \\\\, /) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + target = $$replace(target, \\\\, /) + copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\" + } + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + desktopfile.files = $${TARGET}.desktop + desktopfile.path = /usr/share/applications/hildon + icon.files = $${TARGET}64.png + icon.path = /usr/share/icons/hicolor/64x64/apps + } else:!isEmpty(MEEGO_VERSION_MAJOR) { + desktopfile.files = $${TARGET}_harmattan.desktop + desktopfile.path = /usr/share/applications + icon.files = $${TARGET}80.png + icon.path = /usr/share/icons/hicolor/80x80/apps + } else { # Assumed to be a Desktop Unix + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, \\\\, /) + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + target = $$replace(target, \\\\, /) + sourcePathSegments = $$split(source, /) + targetFullPath = $$target/$$last(sourcePathSegments) + targetFullPath ~= s,/\\.?/,/, + !isEqual(source,$$targetFullPath) { + !isEmpty(copyCommand):copyCommand += && + copyCommand += $(MKDIR) \"$$target\" + copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\" + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } + } + !isEmpty(target.path) { + installPrefix = $${target.path} + } else { + installPrefix = /opt/$${TARGET} + } + for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemfiles = $${item}.files + $$itemfiles = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + + !isEmpty(desktopfile.path) { + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + INSTALLS += icon desktopfile + } + + isEmpty(target.path) { + target.path = $${installPrefix}/bin + export(target.path) + } + INSTALLS += target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} |