[Development] Qt Coding Guidelines

Koehne Kai Kai.Koehne at theqtcompany.com
Thu Mar 17 15:30:03 CET 2016

> -----Original Message-----
> From: Development [mailto:development-
> bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of
> Sergio Martins
> Sent: Thursday, March 17, 2016 1:15 PM
> To: development at qt-project.org
> Subject: Re: [Development] Qt Coding Guidelines
> On Thursday, March 17, 2016 11:24:10 AM Mathias Hasselmann wrote:
> > Am 17.03.2016 um 10:01 schrieb Sorvig Morten:
> > > How about treating the coding guidelines as \internal documentation?
> > > We could then at some point build and publish it together with the
> > > rest of the \internal's. (suitably separated from the public user
> > > documentation)
> >
> > Actually having the Qt code style as public document proved to be
> > extremely useful in the past to quickly shutdown this inevitable and
> > highly annoying bike shed discussion about code style that happens at
> > the start of every other project. Also in the future I'd like to say:
> >
> > "We do a Qt based project and for consistency I propose to follow the
> > Qt code style: It's a good and proven style guide. Just read it
> > http://wiki.qt.io/Coding_Conventions and then focus on real problems."
> I like this, public .qdoc makes it easier to make a case for Qt coding style
> among our customers.

The current Coding Conventions are right now a mixture of code _style_
(which http://wiki.qt.io/Qt_Coding_Style covers, too), and coding 
guidelines. IMO they should be (again) split up: Basically the 
first one is about whitespace, naming conventions etc, while the second
one is higher-level stuff like which C++ features to use.

In addition, I was thinking about whether it makes sense to split up stuff
of general interest ("Use Q_DECLARE_TYPEINFO") from advice pretty
specific to the Qt libraries itself (BC advice, namespace awareness ...).
Anyhow, the line is probably somewhat blurry there, so I wouldn't go
for this from the beginning.

Completely orthogonal to this is though in which format the documents
are. You're specifically mentioning .qdoc, but I assume it wouldn't really
matter if it's Markdown (from the 'reusability' perspective)?



More information about the Development mailing list