summaryrefslogtreecommitdiff
path: root/examples/location
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-12-03 13:15:33 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-12-06 13:26:24 +0000
commitad620973ea45b79fd17c6b0d31a613b35ba6566b (patch)
tree23ae20cfddd2141febe86b7ba7b77e86176fd1d9 /examples/location
parent335116ea024f51e1693bba39f78e15131870f1b0 (diff)
downloadqtlocation-ad620973ea45b79fd17c6b0d31a613b35ba6566b.tar.gz
Add support for additional library paths to the MapViewer example
This patch makes the MapViewer example fetch and add additional library paths from the environment variable "QTLOCATION_EXTRA_LIBRARY_PATH". This path is colon separated, and can be used to add and test additional plugins easily, without the need to modify the example. Change-Id: I61563e1062d2ea860f4288ff17b54067b6bf9c8d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/location')
-rw-r--r--examples/location/mapviewer/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/location/mapviewer/main.cpp b/examples/location/mapviewer/main.cpp
index a58dcd44..1d44a31b 100644
--- a/examples/location/mapviewer/main.cpp
+++ b/examples/location/mapviewer/main.cpp
@@ -84,6 +84,10 @@ static bool parseArgs(QStringList& args, QVariantMap& parameters)
int main(int argc, char *argv[])
{
+ const QByteArray additionalLibraryPaths = qgetenv("QTLOCATION_EXTRA_LIBRARY_PATH");
+ for (const QByteArray &p : additionalLibraryPaths.split(':'))
+ QCoreApplication::addLibraryPath(QString(p));
+
QGuiApplication application(argc, argv);
QVariantMap parameters;