Close document listener

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

Moderator: andrew

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: 5701
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 Developers and Contributors”