[Development] Some Qt3D feedback

Matthew Woehlke mw_triad at users.sourceforge.net
Thu Jun 18 18:16:30 CEST 2015


On 2015-06-18 11:17, Marc Mutz wrote:
> On Thursday 18 June 2015 15:45:06 Matthew Woehlke wrote:
>> Reasons I have used <QtGlobal>:
>>
>> - I want only the macros
>> - I want only the platform / compiler feature symbols
>> - I want only some free function (e.g. qRound)
>> - I want only the convenience typedefs (e.g. qint64, qreal)
>>
>> So I definitely would not say that there is no use for having a header
>> with a module's global entities separate from the per-class headers.
>>
>> In fact, I'm annoyed that <QtNumeric> is missing... IMHO if it's a
>> public header, it should have a <CamelCaseName> wrapper. (Well, *was*
>> missing; it was added in Qt5, thankfully!)
> 
> I believe people with so narrow use-cases can be bothered to include 
> <QtCore/qglobal.h>.

"Bothered", yes, but it's ugly and inconsistent.

> IIRC, the alternative proposal was to let people include 
> the whole module (<QtCore>) to get the namespace.

Unacceptable. This drags in a HUGE amount of stuff when I only want a
small piece. From a compile perspective, it would be much better, though
still not optimal, to include some small but irrelevant class, but then
that's bad from a semantic perspective ("why does this header include
<QtCore/QString> when it never mentioned QString?").

> If you step back a bit, you'll notice that both <QtGlobal> and <QtNumeric>, as 
> well as <QtNamespace> are big, fat, mistakes.

Why? How can QtNumeric, in particular, be a mistake unless qnumeric.h is
also a mistake?

-- 
Matthew




More information about the Development mailing list