[QT] How to use enumeration in QML?

Linux specific forum
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 543
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

[QT] How to use enumeration in QML?

Post by bbanelli »

http://doc.qt.io/qt-5/qml-enumeration.html
For backwards compatibility, the enumeration value may also be specified as a string, e.g. "AlignRight". This form is not recommended for new code.
This actually works just fine, i.e.:

Code: Select all

If OpenWindow(0, 0, 0, 322, 205, "qt placeholder", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 8,  10, 306, 20, "123")
  StringGadget(1, 8,  40, 306, 20, "456")
  QtScript(~"gadget(0).echoMode = \"PasswordEchoOnEdit\";")
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
However, what would be the proper way to use it according to the docs?
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/