[Development] Qt API review with clazy

Ulf Hermann ulf.hermann at qt.io
Mon Sep 12 10:41:43 CEST 2016

On 09/12/2016 10:25 AM, Mathias Hasselmann wrote:
> Am 12.09.2016 um 09:33 schrieb Konstantin Tokarev:
>>> Use Q_ENUM instead of Q_ENUMS
>> Q_ENUM increases amount of metacode generated for enum. Is it really a good idea to replace Q_ENUMS everywhere?
> One thing that makes Qt easy to use is consistency. Once you know enough of its classes using most other class is trivial as you know what to expect, what to look for.
> So if ease of use and therefore consistency is a goal of Qt
> I am happily paying that price.
> Anywhere: Where would you draw the line for Q_ENUM vs. Q_ENUMS enums? Any rule about this would be arbitrary and therefore hard to remember, hard to get consistent.

Following this argument you'll have to draw the line at public Qt headers vs other other Qt code. The user will see the nice consistency and we can still save some metacode where we don't need the benefits of Q_ENUM. I haven't checked how much space it actually saves, though.


More information about the Development mailing list