Qt KDE integration in kdereview.

Albert Astals Cid aacid at kde.org
Tue Nov 3 23:22:53 GMT 2009


A Dimarts, 3 de novembre de 2009, Olivier Goffart va escriure:
> 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?
> 

The license says the file belongs to Nokia while it includes code taken from 
kfiledialog.cpp

The list variable in qt2KdeFilter and kde2QtFilter should be declared const so 
the real const begin() and end() are called on it otherwise will probably fail 
to compile when specifying strict iterators.

One question, how does it decide if it should use the KDE integration or the 
GTK one?

It's nice that Nokia cares about KDE :-)

Albert




More information about the kde-core-devel mailing list