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

Q_NAMESPACE and Q_ENUM_NS behaviour is inconsistent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.14.0 Alpha
    • 5.12.0 RC
    • Core: Object Model
    • None
    • ae9be1a63d7b579fb5bb8b4bf903f1a3efe7168f

      Consider the example:

      There are two almost identical namespaces with Q_NAMESPACE. Each one has an enum, with a Q_ENUM_NS, and a Q_DECLARE_METATYPE. In the same header as one of them (foo.h) there are two more classes, one QObject, and one Q_GADGET. Each of them contains a property for each of the enums.

      One would expect that reading the properties through the meta object system would result in the same behavior for both enums.

      Yet, the enum included in the same header as the class declarations is treated as plain int, and the one from a separate header is treated as named enum with a proper type. This can easily be seen when passing them all through qDebug() as main.cpp does.

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

            ulherman Ulf Hermann
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes