summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_x11.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-19 13:50:45 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-07 08:58:49 (GMT)
commitee383b89f16a9a75a934076255bddbef5a075fa3 (patch)
tree22118d8368e89aae2ebf09e41b79f3d69d811cae /src/gui/kernel/qapplication_x11.cpp
parentc14455b78904f25e724cd928652c49f9583c6aa0 (diff)
downloadQt-ee383b89f16a9a75a934076255bddbef5a075fa3.zip
Qt-ee383b89f16a9a75a934076255bddbef5a075fa3.tar.gz
Qt-ee383b89f16a9a75a934076255bddbef5a075fa3.tar.bz2
Integrate the GuiPlatformPlugin interface
This is an internal interface for plugins that can be provided by the platform to give platform-specific features by platforms built on top of Qt. We can easlily integrate Qt on Windows, Mac, Gnome, ... without any plugin because we can link to their respective library (dynamically if we don't want to depend on it). On Gnome, we can dynamically resolve Gtk+ symbols. This is however not possible for KDE or other platform built on top of Qt: we can't link against their library because they depend on us and we can't dynamically resolve the symbols because they are mangled (C++) So this plugin provides hooks inside Qt to be able to do things like native File or Color dialog, native icons, accurate reading of the config file, and so on. This is currently private API. Task-number: QT-406 Reviewed-by: Jens Bache-Wiig Reviewed-by: Oswald Buddenhagen
Diffstat (limited to 'src/gui/kernel/qapplication_x11.cpp')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp42
1 files changed, 3 insertions, 39 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index e46a370..bf95684 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -85,6 +85,7 @@
#include "qtimer.h"
#include "qlibrary.h"
#include <private/qgraphicssystemfactory_p.h>
+#include "qguiplatformplugin_p.h"
#include "qkde_p.h"
#if !defined (QT_NO_TABLET)
@@ -919,7 +920,7 @@ bool QApplicationPrivate::x11_apply_settings()
QString stylename = settings.value(QLatin1String("style")).toString();
if (stylename.isEmpty() && QApplicationPrivate::styleOverride.isNull() && X11->use_xrender) {
- stylename = x11_desktop_style();
+ stylename = qt_guiPlatformPlugin()->styleName();
}
static QString currentStyleName = stylename;
@@ -1313,8 +1314,7 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
pal.setColor(QPalette::Disabled, QPalette::Highlight, Qt::darkBlue);
}
- if (kdeColors)
- pal = QKde::kdePalette().resolve(pal);
+ pal = qt_guiPlatformPlugin()->palette().resolve(pal);
QApplicationPrivate::setSystemPalette(pal);
QColor::setAllowX11ColorNames(allowX11ColorNames);
}
@@ -2560,42 +2560,6 @@ void qt_init(QApplicationPrivate *priv, int,
#endif
}
-
- // run-time search for default style
-/*!
- \internal
-*/
-QString QApplicationPrivate::x11_desktop_style()
-{
- QString stylename;
- switch(X11->desktopEnvironment) {
- case DE_KDE:
- stylename = QKde::kdeStyle();
- break;
- case DE_GNOME: {
- QStringList availableStyles = QStyleFactory::keys();
- // Set QGtkStyle for GNOME if available
- QString gtkStyleKey = QString::fromLatin1("GTK+");
- if (availableStyles.contains(gtkStyleKey)) {
- stylename = gtkStyleKey;
- break;
- }
- if (X11->use_xrender)
- stylename = QLatin1String("cleanlooks");
- else
- stylename = QLatin1String("windows");
- break;
- }
- case DE_CDE:
- stylename = QLatin1String("cde");
- break;
- default:
- // Don't do anything
- break;
- }
- return stylename;
-}
-
void QApplicationPrivate::initializeWidgetPaletteHash()
{
}