Commit 99b18fe2 authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Application data deployment on the mac

Using the QMAKE_BUNDLE_DATA variable to copy the data into
the Resource directory in the application bundle.
parent dc613c01
......@@ -67,6 +67,15 @@ symbian {
}
target.path = /opt/bin
INSTALLS += target
} else:macx {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemsources = $${item}.files
$$itemsources = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath = Resources/$$eval($${deploymentfolder}.target)
QMAKE_BUNDLE_DATA += $$item
}
} else { #linux
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
......
#include "qmlapplicationview.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtDeclarative/QDeclarativeComponent>
......@@ -23,7 +24,12 @@ QmlApplicationView::QmlApplicationView(const QString &mainQmlFile, QWidget *pare
: QDeclarativeView(parent)
, m_d(new QmlApplicationViewPrivate)
{
#ifdef Q_OS_MAC
m_d->mainQmlFile = QCoreApplication::applicationDirPath()
+ QLatin1String("/../../Resources/") + mainQmlFile;
#else
m_d->mainQmlFile = mainQmlFile;
#endif
setSource(QUrl(m_d->mainQmlFile));
connect(engine(), SIGNAL(quit()), SLOT(close()));
setResizeMode(QDeclarativeView::SizeRootObjectToView);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment