Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140912

Remove Qt moc in favor of C++26 reflection

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • Build tools: moc
    • None
    • All

      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:

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            fabiankosmale Fabian Kosmale
            kelteseth Elias Steurer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes