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

QMetaType::typename() doesn't return the registered typedef for a QFlag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.0, 6.2
    • Core: Other
    • None

      Given a QObject derived class defining a QFlag like this:

      class TestObject : public QObject
      {
          Q_OBJECT
          enum TestFlag {
            Value1 = 0x1,
            Value2 = 0x2
          }
          Q_DECLARE_FLAG(TestFlags, TestFlag)
          Q_FLAG(TestFlags)
      }
      

      When trying to retrieve the typename using QMetaObject the value has changed from Qt 5.13 to Qt6:

      QMetaType::typeName(QMetaTypeId<TestObject::TestFlags>());
      

      With 5.13 this returns: TestObject::TestFlags
      Qt 6 returns: QFlags<TestObject::TestFlag>

        For Gerrit Dashboard: QTBUG-83664
        # Subject Branch Project Status CR V

            fabiankosmale Fabian Kosmale
            gagi Dominik Holland
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change