Hi,

By the time this aspect of the QML engine was implemented, C++11 scoped enums 
did not exist. I think it would be fine

to add this feature to the JavaScript bindings for C++ classes.


Simon

________________________________
From: Development <[email protected]> on 
behalf of BogDan Vatra <[email protected]>
Sent: Tuesday, July 26, 2016 4:50:38 PM
To: [email protected]
Subject: [Development] QML: Why C++11 scoped enums are not scoped in QML ?

Hi,

Is there any reason why C++11 scoped enums are not scoped in QML ?
If I have something like the following code in C++

class MyClass : public QObject
{
 Q_OBJECT
public:
 enum class MyEnum : uint16_t {
   Val1,
   Val2,
 }
 Q_ENUM(MyEnum)
);

// register the class

I'd like to use it in QML as:
console.log(MyClass.MyEnum.Val1)
not as
console.log(MyClass.Val1)

Cheers,
BogDan.
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to