[Development] Proposing to change https://wiki.qt.io/API_Design_Principles#Enums_in_classes to require scoped enums

Thiago Macieira thiago.macieira at intel.com
Sat Jan 18 01:18:57 CET 2025


On Friday 17 January 2025 15:12:36 Pacific Standard Time Marco Bubke via 
Development wrote:
> TouchPoint::Pressed -> Touch::Pressed
> 
> enum class  Touch : int {
>    Pressed,
>    ...
> };
> 
> They than could be forward declared too.

As a side-effect, that means they can't be extracted by moc using Q_FLAG / 
Q_ENUM. The enumeration values must be in the class body for moc to work.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250117/338e05ed/attachment-0001.bin>


More information about the Development mailing list