Hi,

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. Is 
it supposed to work somehow?

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'

I also tried to rename the signal parameter type to MyObject::MyEnum, but this 
did not work either. I can use the value correctly if I access it as a 
property, or if I assign enum values such as "property int myvalue: 
MyObject.Value1".

Thanks,
Olli
_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to