[SOLVED] Close the application

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
sinase
Active Member
Posts: 47
Joined: Sat Jan 30, 2021 11:12 pm

[SOLVED] Close the application

Post by sinase » Fri Mar 26, 2021 10:30 am

Hello,

I am trying to close the application by .js code and i don't find that. I try with scripts/Window/CloseAll/CloseAll.js or scripts/File/CloseFile/CloseFile.js but these only terminate the current files.

Is there any other way?

Thanks.
Last edited by sinase on Wed Mar 31, 2021 8:13 am, edited 3 times in total.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Close the application

Post by andrew » Fri Mar 26, 2021 12:48 pm

Try this:

Code: Select all

var appWin = EAction.getMainWindow();
appWin.quit();

sinase
Active Member
Posts: 47
Joined: Sat Jan 30, 2021 11:12 pm

Re: Close the application

Post by sinase » Fri Mar 26, 2021 1:35 pm

Many thanks.

sinase
Active Member
Posts: 47
Joined: Sat Jan 30, 2021 11:12 pm

Re: Close the application

Post by sinase » Mon Mar 29, 2021 8:59 am

Hello,

With the previous code, qcad is running on the background yet ( i can see that in the task manager). I would need to terminate the execution completely, is there other option that i can try?

Thank you.
Regards.

sinase
Active Member
Posts: 47
Joined: Sat Jan 30, 2021 11:12 pm

Re: Close the application

Post by sinase » Wed Mar 31, 2021 8:13 am

Hello,

it works as follows:

var appWin = EAction.getMainWindow();
appWin.quit();
this.terminate();
return;

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”