Page 1 of 1

contextuel dock widget

Posted: Tue Jan 16, 2018 4:27 pm
by dalida
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

Re: contextuel dock widget

Posted: Wed Feb 21, 2018 3:10 pm
by andrew
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
};

Re: contextuel dock widget

Posted: Wed Mar 14, 2018 2:37 pm
by dalida
Thanks !

Re: contextuel dock widget

Posted: Wed Mar 14, 2018 2:37 pm
by dalida
Thanks !