Close document listener

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
sarlaa
Active Member
Posts: 47
Joined: Mon Aug 28, 2017 4:39 pm

Close document listener

Post by sarlaa » Wed Apr 18, 2018 12:50 pm

Hi,

Please is there an adapter for listening close document ?

Thanks in adavance

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

Re: Close document listener

Post by andrew » Wed Apr 18, 2018 1:42 pm

If you want to get notified when user requested to close a document window (but can still cancel the close dialog), you can use the closeRequested signal of RMdiChild:

Code: Select all

var mdiChild = EAction.getMdiChild();
mdiChild.closeRequested.connect(myFunction);

function myFunction(mdiChild) {
    var di = mdiChild.getDocumentInterface();
    ...
}
If you want to get notified when a document is definitely about to close and be destroyed, use signal closeAccepted instead.

sarlaa
Active Member
Posts: 47
Joined: Mon Aug 28, 2017 4:39 pm

Re: Close document listener

Post by sarlaa » Fri Apr 20, 2018 12:31 pm

Thanks

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”