How to use nested if else block in QML
QML and Qt Quick
2
Posts
2
Posters
5.3k
Views
1
Watching
-
wrote on 1 Feb 2013, 09:38 last edited by
Hi,
i am writing a javascript function in QML. In this function i want to use nested if else block as
@if(statusText.text === "Active")
{
contextMenuModel.clear()
contextMenuModel.append({"menuItem":"Block"})
}
if(statusText.text === "Terminated")
{
contextMenuModel.clear()
contextMenuModel.append({"menuItem":"Allow"})
}
if(statusText.text === "Pending")
{
contextMenuModel.clear()
contextMenuModel.append({"menuItem":"Allow"})
contextMenuModel.append({"menuItem":"Block"})
}@when i am displaying this model, using list view... in last codition it display only "Allow"..
-
wrote on 1 Feb 2013, 13:07 last edited by
Overall it should work unless you do something with worker threads. In that case you are missing model.sync().
1/2