I have a screen containing frame (as one qml file) - the content of it is stored as separate widgets in separate files. Currently it looks like:
//screen qml
MyScreen
{
...
//other stuff
Widget1
{
visible: isWidget1Active
...
}
Widget2
{
visible: isWidget2Active
...
}
}
//widget1 qml
Widget1
{
//label
//button
}
//widget2 qml
Widget2
{
//label
//button1
//button2
//button3
}
The widgets will cover the same area (but they have different content) and I want to show only one of them in the same time. Of course I can change the visibility by checking which widget should be currenlty active but I'm not sure it's the correct approach. I want to have support for much more than two widgets. In this case the screen qml will be much bigger and will have much more conditions.
Is possible to switch the widget qml instead of setting the visibility for each widget?