summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/kernel.pri6
-rw-r--r--src/gui/kernel/qguiapplication.cpp21
-rw-r--r--src/gui/kernel/qguiapplication_p.h9
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp29
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.h16
-rw-r--r--src/gui/kernel/qplatformtheme_qpa.cpp70
-rw-r--r--src/gui/kernel/qplatformtheme_qpa.h74
-rw-r--r--src/gui/kernel/qplatformthemefactory_qpa.cpp108
-rw-r--r--src/gui/kernel/qplatformthemefactory_qpa_p.h77
-rw-r--r--src/gui/kernel/qplatformthemeplugin_qpa.cpp55
-rw-r--r--src/gui/kernel/qplatformthemeplugin_qpa.h92
11 files changed, 520 insertions, 37 deletions
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index d01e39c962..c6f6cab5da 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -16,6 +16,9 @@ HEADERS += \
kernel/qplatforminputcontext_qpa.h \
kernel/qplatformintegrationfactory_qpa_p.h \
kernel/qplatformintegrationplugin_qpa.h \
+ kernel/qplatformtheme_qpa.h\
+ kernel/qplatformthemefactory_qpa_p.h \
+ kernel/qplatformthemeplugin_qpa.h \
kernel/qplatformwindow_qpa.h \
kernel/qplatformopenglcontext_qpa.h \
kernel/qopenglcontext.h \
@@ -60,6 +63,9 @@ SOURCES += \
kernel/qplatformscreen_qpa.cpp \
kernel/qplatformintegrationfactory_qpa.cpp \
kernel/qplatformintegrationplugin_qpa.cpp \
+ kernel/qplatformtheme_qpa.cpp \
+ kernel/qplatformthemefactory_qpa.cpp \
+ kernel/qplatformthemeplugin_qpa.cpp \
kernel/qplatformwindow_qpa.cpp \
kernel/qplatformopenglcontext_qpa.cpp \
kernel/qopenglcontext.cpp \
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 1dab8a7d62..07e9489ddc 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -62,6 +62,8 @@
#include <QtGui/QGenericPluginFactory>
#include <QtGui/qstylehints.h>
#include <QtGui/qinputpanel.h>
+#include <QtGui/qplatformtheme_qpa.h>
+
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
@@ -69,6 +71,7 @@
#include "private/qkeymapper_p.h"
#include "private/qcursor_p.h"
#include "private/qdnd_p.h"
+#include <private/qplatformthemefactory_qpa_p.h>
#ifndef QT_NO_CURSOR
#include "qplatformcursor_qpa.h"
#endif
@@ -89,6 +92,7 @@ Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier;
QPointF QGuiApplicationPrivate::lastCursorPosition(0.0, 0.0);
QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0;
+QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0;
QList<QObject *> QGuiApplicationPrivate::generic_plugin_list;
@@ -257,6 +261,7 @@ static void init_platform(const QString &pluginArgument, const QString &platform
}
}
+ // Create the platform integration.
QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, platformPluginPath);
if (!QGuiApplicationPrivate::platform_integration) {
QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
@@ -268,6 +273,22 @@ static void init_platform(const QString &pluginArgument, const QString &platform
qFatal("%s", fatalMessage.toLocal8Bit().constData());
return;
}
+
+ // Create the platform theme:
+ // 1) Ask the platform integration to create a platform theme
+ QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->platformTheme();
+
+ // 2) If none found, look for a theme plugin. Theme plugins are located in the
+ // same directory as platform plugins.
+ if (!QGuiApplicationPrivate::platform_theme) {
+ QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(name, platformPluginPath);
+ // No error message; not having a theme plugin is allowed.
+ }
+
+ // 3) Fall back on the built-in "null" platform theme.
+ if (!QGuiApplicationPrivate::platform_theme)
+ QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
+
// Set arguments as dynamic properties on the native interface as
// boolean 'foo' or strings: 'foo=bar'
if (!arguments.isEmpty()) {
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index bd42fa1904..af1c71d478 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -51,7 +51,8 @@
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
-#include "QtGui/qplatformintegration_qpa.h"
+#include <QtGui/qplatformintegration_qpa.h>
+#include <QtGui/qplatformtheme_qpa.h>
QT_BEGIN_HEADER
@@ -81,6 +82,12 @@ public:
static QPlatformIntegration *platformIntegration()
{ return platform_integration; }
+ static QPlatformTheme *platform_theme;
+
+ static QPlatformTheme *platformTheme()
+ { return platform_theme; }
+
+
enum KeyPlatform {
KB_Win = 1,
KB_Mac = 2,
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 605cc5de59..956180c728 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -238,30 +238,6 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return 0;
}
-QPlatformMenu *QPlatformIntegration::createPlatformMenu(QMenu *menu) const
-{
- Q_UNUSED(menu);
- return 0;
-}
-
-QPlatformMenuBar *QPlatformIntegration::createPlatformMenuBar(QMenuBar *menuBar) const
-{
- Q_UNUSED(menuBar);
- return 0;
-}
-
-bool QPlatformIntegration::usePlatformNativeDialog(QDialog *dialog) const
-{
- Q_UNUSED(dialog);
- return false;
-}
-
-QPlatformDialogHelper * QPlatformIntegration::createPlatformDialogHelper(QDialog *dialog) const
-{
- Q_UNUSED(dialog);
- return 0;
-}
-
/*!
Should be called by the implementation whenever a new screen is added.
@@ -282,4 +258,9 @@ void QPlatformIntegration::screenAdded(QPlatformScreen *ps)
}
}
+class QPlatformTheme *QPlatformIntegration::platformTheme() const
+{
+ return 0;
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h
index 6dd87495b4..d5eb14bc50 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration_qpa.h
@@ -63,12 +63,8 @@ class QPlatformOpenGLContext;
class QGuiGLFormat;
class QAbstractEventDispatcher;
class QPlatformInputContext;
-class QMenu;
-class QMenuBar;
-class QPlatformMenu;
-class QPlatformMenuBar;
class QPlatformAccessibility;
-class QPlatformDialogHelper;
+class QPlatformTheme;
class Q_GUI_EXPORT QPlatformIntegration
{
@@ -100,15 +96,9 @@ public:
virtual QPlatformDrag *drag() const;
#endif
virtual QPlatformInputContext *inputContext() const;
-
- virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const;
- virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const;
virtual QPlatformAccessibility *accessibility() const;
- virtual bool usePlatformNativeDialog(QDialog *dialog = 0) const;
- virtual QPlatformDialogHelper *createPlatformDialogHelper(QDialog *dialog = 0) const;
-
-// Access native handles. The window handle is already available from Wid;
+ // Access native handles. The window handle is already available from Wid;
virtual QPlatformNativeInterface *nativeInterface() const;
enum StyleHint {
@@ -121,6 +111,8 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
+ virtual QPlatformTheme *platformTheme() const;
+
protected:
void screenAdded(QPlatformScreen *screen);
};
diff --git a/src/gui/kernel/qplatformtheme_qpa.cpp b/src/gui/kernel/qplatformtheme_qpa.cpp
new file mode 100644
index 0000000000..c887d78edb
--- /dev/null
+++ b/src/gui/kernel/qplatformtheme_qpa.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qplatformtheme_qpa.h"
+
+QT_BEGIN_NAMESPACE
+
+QPlatformMenu *QPlatformTheme::createPlatformMenu(QMenu *menu) const
+{
+ Q_UNUSED(menu);
+ return 0;
+}
+
+QPlatformMenuBar *QPlatformTheme::createPlatformMenuBar(QMenuBar *menuBar) const
+{
+ Q_UNUSED(menuBar);
+ return 0;
+}
+
+bool QPlatformTheme::usePlatformNativeDialog(const QDialog *dialog) const
+{
+ Q_UNUSED(dialog);
+ return false;
+}
+
+QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(QDialog *dialog) const
+{
+ Q_UNUSED(dialog);
+ return 0;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformtheme_qpa.h b/src/gui/kernel/qplatformtheme_qpa.h
new file mode 100644
index 0000000000..2090ce37e1
--- /dev/null
+++ b/src/gui/kernel/qplatformtheme_qpa.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMTHEME_H
+#define QPLATFORMTHEME_H
+
+#include <QtCore/QtGlobal>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QMenu;
+class QMenuBar;
+class QPlatformMenu;
+class QPlatformMenuBar;
+class QPlatformDialogHelper;
+class QDialog;
+
+class Q_GUI_EXPORT QPlatformTheme
+{
+public:
+ virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const;
+ virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const;
+
+ virtual bool usePlatformNativeDialog(const QDialog *dialog = 0) const;
+ virtual QPlatformDialogHelper *createPlatformDialogHelper(QDialog *dialog = 0) const;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPLATFORMTHEME_H
diff --git a/src/gui/kernel/qplatformthemefactory_qpa.cpp b/src/gui/kernel/qplatformthemefactory_qpa.cpp
new file mode 100644
index 0000000000..87f96762c2
--- /dev/null
+++ b/src/gui/kernel/qplatformthemefactory_qpa.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qplatformthemefactory_qpa_p.h"
+#include <QPlatformThemePlugin>
+#include "private/qfactoryloader_p.h"
+#include "qmutex.h"
+
+#include "qguiapplication.h"
+#include "qdebug.h"
+
+QT_BEGIN_NAMESPACE
+
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
+ (QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive))
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
+ (QPlatformThemeFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
+#endif
+
+QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath)
+{
+ QPlatformTheme *ret = 0;
+ QStringList paramList = key.split(QLatin1Char(':'));
+ QString platform = paramList.takeFirst().toLower();
+
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+ // Try loading the plugin from platformPluginPath first:
+ if (!platformPluginPath.isEmpty()) {
+ QCoreApplication::addLibraryPath(platformPluginPath);
+ if (QPlatformThemeFactoryInterface *factory =
+ qobject_cast<QPlatformThemeFactoryInterface*>(directLoader()->instance(platform)))
+ ret = factory->create(key, paramList);
+
+ if (ret)
+ return ret;
+ }
+ if (QPlatformThemeFactoryInterface *factory = qobject_cast<QPlatformThemeFactoryInterface*>(loader()->instance(platform)))
+ ret = factory->create(platform, paramList);
+#endif
+
+ return ret;
+}
+
+/*!
+ Returns the list of valid keys, i.e. the keys this factory can
+ create styles for.
+
+ \sa create()
+*/
+QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
+{
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+ QStringList list;
+
+ if (!platformPluginPath.isEmpty()) {
+ QCoreApplication::addLibraryPath(platformPluginPath);
+ foreach (const QString &key, directLoader()->keys()) {
+ list += key + QString(QLatin1String(" (from %1)")).arg(platformPluginPath);
+ }
+ }
+
+ list += loader()->keys();
+#else
+ QStringList list;
+#endif
+ return list;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformthemefactory_qpa_p.h b/src/gui/kernel/qplatformthemefactory_qpa_p.h
new file mode 100644
index 0000000000..b65e6e197a
--- /dev/null
+++ b/src/gui/kernel/qplatformthemefactory_qpa_p.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMTHEMEFACTORY_H
+#define QPLATFORMTHEMEFACTORY_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qstringlist.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QPlatformTheme;
+
+class QPlatformThemeFactory
+{
+public:
+ static QStringList keys(const QString &platformPluginPath = QString());
+ static QPlatformTheme *create(const QString &key, const QString &platformPluginPath = QString());
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPLATFORMTHEMEFACTORY_H
diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.cpp b/src/gui/kernel/qplatformthemeplugin_qpa.cpp
new file mode 100644
index 0000000000..e17e36fc3d
--- /dev/null
+++ b/src/gui/kernel/qplatformthemeplugin_qpa.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qplatformthemeplugin_qpa.h"
+
+QT_BEGIN_NAMESPACE
+
+QPlatformThemePlugin::QPlatformThemePlugin(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QPlatformThemePlugin::~QPlatformThemePlugin()
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.h b/src/gui/kernel/qplatformthemeplugin_qpa.h
new file mode 100644
index 0000000000..0df9a8842d
--- /dev/null
+++ b/src/gui/kernel/qplatformthemeplugin_qpa.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMTHEMEPLUGIN_H
+#define QPLATFORMTHEMEPLUGIN_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qplugin.h>
+#include <QtCore/qfactoryinterface.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QPlatformTheme;
+
+struct QPlatformThemeFactoryInterface : public QFactoryInterface
+{
+ virtual QPlatformTheme *create(const QString &key, const QStringList &paramList) = 0;
+};
+
+#define QPlatformThemeFactoryInterface_iid "com.nokia.Qt.QPlatformThemeFactoryInterface"
+
+Q_DECLARE_INTERFACE(QPlatformThemeFactoryInterface, QPlatformThemeFactoryInterface_iid)
+
+class Q_GUI_EXPORT QPlatformThemePlugin : public QObject, public QPlatformThemeFactoryInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QPlatformThemeFactoryInterface:QFactoryInterface)
+public:
+ explicit QPlatformThemePlugin(QObject *parent = 0);
+ ~QPlatformThemePlugin();
+
+ virtual QStringList keys() const = 0;
+ virtual QPlatformTheme *create(const QString &key, const QStringList &paramList) = 0;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPLATFORMTHEMEPLUGIN_H