diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-19 13:50:45 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-07 08:58:49 (GMT) |
commit | ee383b89f16a9a75a934076255bddbef5a075fa3 (patch) | |
tree | 22118d8368e89aae2ebf09e41b79f3d69d811cae /src/gui/kernel/qkde.cpp | |
parent | c14455b78904f25e724cd928652c49f9583c6aa0 (diff) | |
download | Qt-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/qkde.cpp')
-rw-r--r-- | src/gui/kernel/qkde.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/gui/kernel/qkde.cpp b/src/gui/kernel/qkde.cpp index 6c8909f..edc53ac 100644 --- a/src/gui/kernel/qkde.cpp +++ b/src/gui/kernel/qkde.cpp @@ -141,14 +141,33 @@ QString QKde::kdeStyle() return QLatin1String("windows"); } -/*!\internal - placeholder to load icon from kde. - to be implemented - */ -QIcon QKde::kdeIcon(const QString &name) + +int QKde::kdeToolButtonStyle() +{ + QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), + QSettings::IniFormat); + settings.beginGroup(QLatin1String("Toolbar style")); + QString toolbarStyle = settings.value(QLatin1String("ToolButtonStyle"), QLatin1String("TextBesideIcon")).toString(); + if (toolbarStyle == QLatin1String("TextBesideIcon")) + return Qt::ToolButtonTextBesideIcon; + else if (toolbarStyle == QLatin1String("TextOnly")) + return Qt::ToolButtonTextOnly; + else if (toolbarStyle == QLatin1String("TextUnderIcon")) + return Qt::ToolButtonTextUnderIcon; + + return Qt::ToolButtonTextBesideIcon; +} + +int QKde::kdeToolBarIconSize() { - //###todo - return QIcon(); + static int iconSize = -1; + if (iconSize == -1) { + QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), + QSettings::IniFormat); + settings.beginGroup(QLatin1String("ToolbarIcons")); + iconSize = settings.value(QLatin1String("Size")).toInt(); + } + return iconSize; } QT_END_NAMESPACE |