-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Replace the Qt Meta-Object Compiler (moc) with native C+26 reflection capabilities to be able to support C+20 modules.
Possible challenges:
- Toolchain support: C++26 reflection not yet widely available in production compilers
- Build system integration: CMake, qmake, and other build systems need updates to remove moc dependencies
- Legacy code migration: Existing Q_OBJECT macros need migration path to reflection-based equivalents
- Feature parity: Ensuring all current moc features work with reflection
- Standard compliance: Waiting for stable C++26 reflection specification
- Ecosystem compatibility: Third-party tools and libraries that depend on moc-generated files
Components requiring reflection support:
- Enum to string conversion (Q_ENUM/Q_FLAG)
- Signal/slot mechanism (connect(), emit, Q_SIGNAL, Q_SLOT)
- Property system (Q_PROPERTY with READ/WRITE/NOTIFY)
- Meta-method invocation (QMetaObject::invokeMethod)
- Object introspection (QMetaObject, property enumeration)
- Class information (Q_CLASSINFO)
- Invokable registration (Q_INVOKABLE constructors)
- Interface declarations (Q_INTERFACE)
- Namespace meta-objects (Q_NAMESPACE)
- Plugin metadata (Q_PLUGIN_METADATA)
- QML integration (QML_ELEMENT)
- Property bindings (BINDABLE properties)
See also:
- QTBUG-86697: C++23 moc modules support
- Bloomberg C++26 reflection implementation: https://github.com/bloomberg/clang-p2996
- Verdigris library as proof-of-concept: https://github.com/woboq/verdigris