Updating techbase wiki page according to KF5 policies

David Faure faure at kde.org
Sat Nov 7 13:33:31 UTC 2015


On Friday 06 November 2015 23:42:21 Martin Walch wrote:
> Hi,
> 
> the techbase wiki says
> 
> > If you add #includes for Qt classes, use both the module and class name.
> > This allows library code to be used by applications without excessive
> > compiler include paths.

Urgh, that's indeed outdated, it's the Qt4/kdelibs4 recommendation.

> * Is <QClass> really preferred over <QtModule/QClass> since KF5?

Yes.

> * What is the reason for this?

So that code keeps compiling no matter where QClass is moved.
See <QtGui/QLabel> (Qt4) vs <QtWidgets/QLabel> (Qt5).
It's also faster (just copy/paste the classname).

The old idea of "keeping the buildsystem simple" has been deemed
no longer relevant. Nobody writes Makefiles by hand anymore.
qmake and cmake make it easy to have the right include paths.

> * Is that wiki page meant to apply to KF5?
> * If it shall apply to KF5 is it safe to update it accordingly?

Don't know. Technically the naming is wrong, there's no "kdelibs"
in KF5. Maybe you could make a new wiki page instead?

> * Should the coding style for kdelibs from KDE4 be kept around?

Can't hurt to keep it, there might references to it, and some people
still write Qt4/kdelibs4 based code (e.g. I do, in my company).

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list