[Development] 64-bit QFlags support

Thiago Macieira thiago.macieira at intel.com
Fri Aug 9 22:26:12 CEST 2024


On Friday 9 August 2024 01:36:22 GMT-7 Ivan Solovev via Development wrote:
> Do I understand it correctly that the approach with constexpr functions will
> allow us to solve the problems with moc (point 2 from the first e-mail of
> the thread)?

I've thrown together a sample of what it may look like for the Qt namespace.  
I have not modified moc yet, so I generated from the moc JSON output and manual 
editing. I've tested Clang 18, GCC 13.3 and VS 2022 and they all compiled, 
producing a std::array<uint, 3007>. I also noted in editing this that there's 
an opportunity for reduction by reusing the definitions of flags that are 
Q_ENUMs too.

moc_qnamespace.cpp is by far the largest in qtbase:
$ find -name 'moc*cpp' -printf '%-6s %p\n' | sort -n | tail -3
49965  ./src/corelib/Core_autogen/include/moc_qlocale.cpp
70502  ./src/corelib/Core_autogen/include/moc_qabstractitemmodel.cpp
87549  ./src/corelib/Core_autogen/43AIQRLLGG/moc_qnamespace.cpp

I've thrown it at the CI to check more:
https://codereview.qt-project.org/c/qt/qtbase/+/582313

But not for all of Qt:
$ find -name 'moc*cpp' -size +115168c  -printf '%-6s %p\n'
88679  ./qtdeclarative/src/quick/Quick_autogen/include/
moc_qquickvaluetypes_p.cpp
90699  ./qtcharts/src/chartsqml2/ChartsQml_autogen/include/
moc_declarativebarseries_p.cpp
92547  ./qtdeclarative/src/quick/Quick_autogen/include/moc_qquickitem_p.cpp
101065 ./qtquick3d/src/quick3d/Quick3D_autogen/EWIEGA46WW/
moc_qquick3dspecularglossymaterial_p.cpp
104656 ./qtdeclarative/src/quick/Quick_autogen/include/moc_qquickpath_p.cpp
128155 ./qtquick3d/src/quick3d/Quick3D_autogen/EWIEGA46WW/
moc_qquick3dprincipledmaterial_p.cpp
140925 ./qttools/src/designer/src/components/lib/
DesignerComponentsPrivate_autogen/include/moc_qtpropertymanager.cpp
2844668 ./qtopcua/src/opcua/OpcUa_autogen/include/moc_qopcuanodeids.cpp

QOpcUa::NodeIds contains a single enum with 16162 entries. I'll need to test 
that too. The other ones are not big meta objects; the files are big because 
there are multiple classes in them and the content for signals and slots is 
large.

-- 
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/20240809/fd46fb74/attachment-0001.bin>


More information about the Development mailing list