Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Is there a way to use Switch Statements in QML UI files?
GoldRatio last edited by
Hi @GoldRatio, *.ui.qml files are meant to only contain elements that are editable via the Qt Quick Designer. Switch statements are not declarative code, so they are not supported in *.ui.qml files: http://doc.qt.io/qtcreator/creator-quick-ui-forms.html
If you want, you can put everything (graphical items AND switch statements) inside a single *.qml file. This is actually how QML originally worked. *ui.qml files are a recent addition, created to support the Qt Quick Designer.