Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QtQuick function if else condition issue

$
0
0
Have you tried checking the console output? It’s hard to say without more code, but it could be that one of them opens in one iteration, and the other opens in another. The for loop is quick so it could look like it’s happening at the same time. Try changing it to this and see what happens: function matchString() {     for(var i=0;i<imei.count;i++)     if(imei.get(i).imeistring === deviceInfo.imei ) {         console.log("Iteration: " + i + ", true");         dialogone.open();     }     else {         console.log("Iteration: " + i + ", false");         dialogtwo.open()     } }

Viewing all articles
Browse latest Browse all 4972