[Development] Qt API review with clazy

Mathias Hasselmann mathias at taschenorakel.de
Mon Sep 12 10:25:53 CEST 2016


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.

I am a big fan of Q_ENUMS, the benefits it adds for QML and the benefits 
it adds for debugging, the benefits it adds for reliable data serialization.

Ciao,
Mathias



More information about the Development mailing list