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

QML cannot use registered enums as signal handler parameters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 4.7.0
    • None
    • Tested on Maemo 6 i486 target

    Description

      I have declared an enum in a class and use it as an argument in a signal. I can use the enum in QML, but I cannot read the parameter in the signal handler. Example:

      class MyObject {
      Q_OBJECT
      Q_ENUMS(MyEnum)
      Q_PROPERTY(MyEnum value READ value NOTIFY valueChanged)
      public:
      enum MyEnum

      { Value1, Value2}

      ;
      signals:
      void valueChanged(MyEnum value);
      }

      Qml file
      ----------
      MyObject {
      onValueChanged: console.debug("Value is " + value)
      }

      This fails with the following output:
      QMetaProperty::read: Unable to handle unregistered datatype 'MyEnum' for property 'QDeclarativeBoundSignalParameters::value'

      Attachments

        Issue Links

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

          Activity

            People

              aakenned Aaron Kennedy
              saolli Olli Salonen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes