0

I want to do something like

if(x == 0){
quit() ; 
}

is there a way to do this in a Qt Script?

1 Answers1

1

Enclose your code inside a function like this:

function main(){
   // the code before
   if(x == 0){
      return;
   }
   // the code if condition not met
}

So you can exit javascript the code using the return statement. Make sure the main function is the only one called in your action (so it really quits from JS).

RandomGuy
  • 648
  • 6
  • 21