<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi,</p>
<p><br>
</p>
<p>By the time this aspect of the QML engine was implemented, C++11 scoped enums did not exist. I think it would be fine</p>
<p>to add this feature to the JavaScript bindings for C++ classes.</p>
<p><br>
</p>
<p>Simon</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Development <development-bounces+simon.hausmann=qt.io@qt-project.org> on behalf of BogDan Vatra <bogdan@kdab.com><br>
<b>Sent:</b> Tuesday, July 26, 2016 4:50:38 PM<br>
<b>To:</b> development@qt-project.org<br>
<b>Subject:</b> [Development] QML: Why C++11 scoped enums are not scoped in QML ?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi,<br>
<br>
Is there any reason why C++11 scoped enums are not scoped in QML ?<br>
If I have something like the following code in C++<br>
<br>
class MyClass : public QObject<br>
{<br>
 Q_OBJECT<br>
public:<br>
 enum class MyEnum : uint16_t {<br>
   Val1,<br>
   Val2,<br>
 }<br>
 Q_ENUM(MyEnum)<br>
);<br>
<br>
// register the class <br>
<br>
I'd like to use it in QML as:<br>
console.log(MyClass.MyEnum.Val1)<br>
not as <br>
console.log(MyClass.Val1)<br>
<br>
Cheers,<br>
BogDan.<br>
_______________________________________________<br>
Development mailing list<br>
Development@qt-project.org<br>
<a href="http://lists.qt-project.org/mailman/listinfo/development">http://lists.qt-project.org/mailman/listinfo/development</a><br>
</div>
</span></font>
</body>
</html>