[Development] API style guide: scoped enum or not?

Volker Hilsheimer volker.hilsheimer at qt.io
Tue Jun 20 15:55:33 CEST 2023


> On 14 Jun 2023, at 14:59, Marc Mutz via Development <development at qt-project.org> wrote:

[…]

> C) scoped enums SHOULD NOT repeat (part of) an enum's type name in the 
> enumerators²

[…]

> I have been told today that QML allows scoped C++ enums to be used 
> without the scope. If this is true, it should be fixed to always require 
> the scope, because otherwise the argument goes "but in QML, the scope 
> isn't visible, so a part of the enum type name must be included in the 
> enumerators”.

What’s the view from the QML maintainers on this particular point? 

That QML allows using an enum value without scope if the C++ enum is scoped seems like a bug to me, although I assume that changing this will come with some incompatibility fallout.

Volker



More information about the Development mailing list