diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-09-17 11:22:59 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-19 13:04:51 +0200 |
commit | bf249abee98727d517f52b1126dc7fda8af4e302 (patch) | |
tree | ffa65d8d74a48552ae4f7f7577f013871cd09c8f /examples/svg/embedded/fluidlauncher/demoapplication.cpp | |
parent | ee083ce7fe84c2173ee4d19666d5547210c63266 (diff) | |
download | qtsvg-bf249abee98727d517f52b1126dc7fda8af4e302.tar.gz |
Fix shadow build behavior of fluidlauncher example
All files are embedded into a qrc file.
The image lookup first assumes that local dirs are used. If nothing is
found the lookup moves to the qrc file. This enables flexibility whereby
the app can still be customized after having been built.
Task-number: QTBUG-28377
Change-Id: I99371ecce08a45321e475a7c32d5b368716bdb18
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'examples/svg/embedded/fluidlauncher/demoapplication.cpp')
-rw-r--r-- | examples/svg/embedded/fluidlauncher/demoapplication.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/svg/embedded/fluidlauncher/demoapplication.cpp b/examples/svg/embedded/fluidlauncher/demoapplication.cpp index a01894f..dfba309 100644 --- a/examples/svg/embedded/fluidlauncher/demoapplication.cpp +++ b/examples/svg/embedded/fluidlauncher/demoapplication.cpp @@ -48,6 +48,11 @@ DemoApplication::DemoApplication(QString executableName, QString caption, QStrin else executablePath = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + executableName); +#ifdef WIN32 + if (!executablePath.endsWith(QLatin1String(".exe"))) + executablePath.append(QLatin1String(".exe")); +#endif + arguments = args; process.setProcessChannelMode(QProcess::ForwardedChannels); @@ -69,7 +74,17 @@ void DemoApplication::launch() QImage DemoApplication::getImage() const { - return imagePath.isEmpty() ? QImage() : QImage(imagePath); + if (imagePath.isEmpty()) + return QImage(); + + // in local dir? + QImage result(imagePath); + if (!result.isNull()) + return result; + + // provided by qrc + result = QImage(QString(":/fluidlauncher/%1").arg(imagePath)); + return result; } QString DemoApplication::getCaption() |