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

Provide API functionality to determine whether a registered type refers to an enum

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • Core: Object Model
    • None

      In the declarative module it is necessary to determine whether a typename from a signal parameter type refers to an enum, so that the parameter value can be passed to QML as an integer type rather than a wrapped QVariant type. Currently this is implemented by inspecting the meta object that emits the signal, to see if the typename matches an enum in the meta object; so, this solution won't work if the enum type is emitted from a signal outside of the class that declared the enum.

      To implement a generic solution for enum types, there would need to be a way to determine whether a registered type is an enum. As discussed, one method would be to add functionality to automatically determine this from the use of Q_ENUMS and/or Q_DECLARE_METATYPE.

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

            ogoffart Olivier Goffart (Woboq GmbH)
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes