> On 19 Mar 2020, at 15:04, Jason H <jh...@gmx.com> wrote:
> It seems that enums should be class with a value and label
> console.log(camera.position.label) => "BackFace"
> console.log(camera.position.value) => 1

Yes I have often wished for a way to do that too.  qDebug() << enumValue works 
so well in C++ as long as you used the Q_ENUM macro, so it would be nice to 
have an idiomatic way to access the same debug operator in JS.  Then again, I 
wish we had ubiquitous toString() like Java has, instead of the debug operators 
only being accessible when you’re using qDebug.  (I think the reason we don’t 
is that people might think of toString() as a serialization mechanism?  But I’m 
not sure.). Maybe there’s another idiom on JS that I don’t know about.

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to