summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_qpa.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2011-01-06 09:30:18 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2011-01-07 07:58:37 (GMT)
commite24d7c9cab4a50fe682478d43ac74e867666d48b (patch)
treec6f8d0213631db68178d6115a9c7cd7df833e958 /src/gui/kernel/qapplication_qpa.cpp
parentcc8877068dc6ae8f3142ffec0b85f6fbac4a0d81 (diff)
downloadQt-e24d7c9cab4a50fe682478d43ac74e867666d48b.zip
Qt-e24d7c9cab4a50fe682478d43ac74e867666d48b.tar.gz
Qt-e24d7c9cab4a50fe682478d43ac74e867666d48b.tar.bz2
Lighthouse: Support external plugins.
Add -platformpluginpath command line option that spesifies an additional directory to scan for plugins. Also read QT_QPA_PLATFORM_PLUGIN_PATH. QlatformIntegrationFacgtory::create() now tries to load the plugin from the external path first. Similarly, keys() returns the keys from the extra path in addition to the "internal" keys API changes: QPlatformIntegration::create() and keys() now take an optional const QString &platformPluginPath. New file: externalplugin.pri, contains instructions and a base setup for building external plugins.
Diffstat (limited to 'src/gui/kernel/qapplication_qpa.cpp')
-rw-r--r--src/gui/kernel/qapplication_qpa.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp
index a164c2d..fdbb931 100644
--- a/src/gui/kernel/qapplication_qpa.cpp
+++ b/src/gui/kernel/qapplication_qpa.cpp
@@ -444,11 +444,11 @@ void QApplication::alert(QWidget *, int)
{
}
-static void init_platform(const QString &name)
+static void init_platform(const QString &name, const QString &platformPluginPath)
{
- QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name);
+ QApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, platformPluginPath);
if (!QApplicationPrivate::platform_integration) {
- QStringList keys = QPlatformIntegrationFactory::keys();
+ QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
QString fatalMessage =
QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name);
foreach(QString key, keys) {
@@ -513,6 +513,7 @@ void qt_init(QApplicationPrivate *priv, int type)
}
QList<QByteArray> pluginList;
+ QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
QString platformName = QLatin1String(qgetenv("QT_QPA_PLATFORM"));
// Get command line params
@@ -527,6 +528,9 @@ void qt_init(QApplicationPrivate *priv, int type)
if (arg == "-fn" || arg == "-font") {
if (++i < argc)
appFont = QString::fromLocal8Bit(argv[i]);
+ } else if (arg == "-platformpluginpath") {
+ if (++i < argc)
+ platformPluginPath = QLatin1String(argv[i]);
} else if (arg == "-platform") {
if (++i < argc)
platformName = QLatin1String(argv[i]);
@@ -550,7 +554,7 @@ void qt_init(QApplicationPrivate *priv, int type)
}
#endif
- init_platform(platformName);
+ init_platform(platformName, platformPluginPath);
init_plugins(pluginList);
QColormap::initialize();