contextuel dock widget

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
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: 9037
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 Programming, Script Programming and Contributing”