[Development] Naming convention for (scoped) enums

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Tue Aug 14 15:38:31 CEST 2018



> On 14 Aug 2018, at 15:29, Allan Sandfeld Jensen <kde at carewolf.com> wrote:
> 
> I agree, at least in most cases. There are still cases where I would prefer 
> unscoped enums. For instance in my recent QColorSpace patch, I ended up using 
> both types of enums under QColorSpace. The enum that represented specific 
> colorspaces that looked best without an extra scope I left unscoped (e.g. 
> QColorSpace::SRgb as opposed to QColorSpace::PredefinedColorSpace::SRgb), 
> enums that represented specific property types that couldn't be used alone to 
> construct a QColorSpace, I scoped (E.g. QColorSpace::Gamut::AdobeRgb).

A policy not mandating use of scoped enums everywhere would still allow you to use them where it makes sense :)

Tor Arne 


More information about the Development mailing list