contextuel dock widget

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
dalida
Newbie Member
Posts: 3
Joined: Tue Jan 16, 2018 4:19 pm

contextuel dock widget

Post by dalida » Tue Jan 16, 2018 4:27 pm

Hi,

New to qcad, I'm wondering if I can add a dock widget and keep it contextuel to document (as Property editor).
In this way if I switch between 2 documents oppened, content dock widget will be related to actif document.

Many thanks
Dalida

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

Re: contextuel dock widget

Post by andrew » Wed Feb 21, 2018 3:10 pm

You can use a focus listener to get notified when the current document changes. In ECMAScript:

Code: Select all

var fl = new RFocusListenerAdapter();
appWin.addFocusListener(fl);
fl.focusUpdated.connect(MyClass, "doSomething");

...

MyClass.doSomething = function(document) {
    // called when current document has changed
};

dalida
Newbie Member
Posts: 3
Joined: Tue Jan 16, 2018 4:19 pm

Re: contextuel dock widget

Post by dalida » Wed Mar 14, 2018 2:37 pm

Thanks !

dalida
Newbie Member
Posts: 3
Joined: Tue Jan 16, 2018 4:19 pm

Re: contextuel dock widget

Post by dalida » Wed Mar 14, 2018 2:37 pm

Thanks !

Post Reply

Return to “QCAD Developers and Contributors”