![](/img/trans.png)
[英]How do i switch between two webcams (connected to computer) when a condition is met?
[英]How do I exit a Qt script if a condition is met?
我想做類似的事情
if(x == 0){
quit() ;
}
有沒有辦法在Qt腳本中做到這一點?
將您的代碼封裝在這樣的函數中:
function main(){
// the code before
if(x == 0){
return;
}
// the code if condition not met
}
因此,您可以使用return語句退出javascript代碼。 確保main函數是您的操作中唯一調用的函數(因此它實際上已從JS中退出)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.