[Development] Some Qt3D feedback

Matthew Woehlke mw_triad at users.sourceforge.net
Tue Jun 16 16:21:11 CEST 2015


On 2015-06-15 04:18, Marc Mutz wrote:
> On Monday 15 June 2015 08:24:22 Simon Hausmann wrote:
>> A namespace for functions only, no public classes within.
> 
> _That_ argument again... :)
> 
> Could you explain to me why you think that classes are different from 
> functions, pleaae?

With a small number of exceptions, generally (always?) starting with 'q'
(lower case), there aren't global functions in Qt. There are "static
member" functions (including actual static member functions in
particular, but also namespaced functions), instance member functions,
and global class names.

For naming convention purposes, a namespace is in effect equivalent to a
non-constructible class with only static members.

IOW, there is naming symmetry between e.g.:

  QString::fromUtf8

- and -

  QtConcurrent::run

(Well... except for the 'Qt' vs. just 'Q', but...)

However, there is no e.g. 'QtCore::QThread' which would lead to e.g.
'QtCore::QThread::msleep'.

> There's simply no difference between a class in a namespace and a free 
> function in a namespace

The difference is explained above: with a few exceptions, functions in
Qt public API are (were) qualified by exactly one scope (...until
classes in namespaces started appearing).

-- 
Matthew




More information about the Development mailing list