Qt KDE integration in kdereview.

Olivier Goffart ogoffart at kde.org
Tue Nov 3 15:55:51 GMT 2009


Hello.

I have just submitted a new plugin in kdereview:  qguiplatformplugin_kde

The objective of this plugin is to allow pure Qt Application (not KDE ones) to 
get better integration into KDE.


Qt tries already to make KDE (and GNOME) as much as it can. For instance, we 
try to guess the KDE style and the
KDE palette from the KDE config files.   This however not 100% reliable: For 
instance, we do not know the location of KDEHOME (when $KDEHOME is not set). 
Is it ~/.kde or ~/.kde4 or other? We use QSettings to parse the KDE config file 
(which does not understand every KDE tricks)

To get the Gtk+ integration Qt dynamically link against Gtk+ itself.  It 
cannot do that with KDE because kdelbis are in C++ (name mangling)
and they depends on Qt (circular dependence)

So the only way to go is to introduce hook inside Qt that KDE would use.
And there it is:  the QGuiPlatformPlugin.
It is a kind of private hooks inside Qt to get KDE integration (and in the 
future any platform based on KDE such as the future Maemo)

Qt will load the Kde plugin if the Qt application is running on KDE

The Plugin currently provides:
  * Reading the KDE style name from the config
  * Reading the KDE palette from The KDE config
  * Finding the right icon them for QIcon::fromTheme
  * Some Options such as the toolbar icon size, or the single/double click 
options
  * Finding the icon for a given file (for the QFileSystemModel)
  * KFileDialog as native backend for a QFileDialog (without the need of using 
the static function, just like in mac or windows)
  * KColorDialog for the QColorDialog

The plugin should go either in kdeextragear, or kdebase/runtime whatever is 
the most appropriate.
(kdebase/runtime would ease the release,  but it is more related to the 
version of Qt than the version of KDE)

I am also open to any suggestions of others things the plugin should provide 
(for Qt 4.7)

Comments?


-- 
Olivier




More information about the kde-core-devel mailing list