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

cannot set property of undefined

$
0
0
Hi, i build my project without errors, but when i tried start EXE files, i got this error. Cannot set ‘focus’ of undefined function create_newgame(num) {     sound_main.stop();     if (num==5)     {         var component = Qt.createComponent("Big_game.qml");         if (component.status == Component.Ready)             var bg_game = component.createObject(main_Window, {});         bg_game.focus = true;     }     else     {     var component = Qt.createComponent("Game.qml");     if (component.status == Component.Ready)         var game = component.createObject(main_Window, {});     game.focus = true;         //THIS IS ERROR       switch (num)     {     case 1:         game.image_number = "qrc:/image/num_1.png";         break;     case 2:         game.image_number = "qrc:/image/num_2.png";         break;     case 3:         game.image_number = "qrc:/image/num_3.png";         break;     case 4:         game.image_number = "qrc:/image/num_4.png";         break;     }     }     if(num!=4)         game.multiplier = num;     else         game.multiplier = 1; }

Viewing all articles
Browse latest Browse all 4972

Trending Articles