Customize Gui with Plugin

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
moppi
Registered Member
Posts: 2
Joined: Thu Sep 26, 2019 2:15 pm

Customize Gui with Plugin

Post by moppi » Tue Oct 01, 2019 12:42 pm

Hello,

Is it possible to customize the default GUI of QCAD with a plugin?
I want to:
- hide menu entries
- hide buttons / buttonbars / widgets

Result should be a customized default gui of qcad.

Best regards

Moppi

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

Re: Customize Gui with Plugin

Post by andrew » Tue Oct 01, 2019 2:44 pm

Yes, you can do that from either a plugin or a simple script.

Example script to hide the tool Draw > Line > Freehand Line:

File: scripts/Misc/MyCustomUI/MyCustomUI.js

Code: Select all

function MyCustomUI() {
} 

MyCustomUI.init = function() {

    // hide the tool Draw > Line > Freehand Line

    // hide tool from menu:
    RSettings.setValue("LineFreehand/VisibleInMenu", false);

    // hide tool from line tool bar:
    RSettings.setValue("LineFreehand/VisibleInToolBar", false);

    // hide tool from CAD tool bar at the left:
    RSettings.setValue("LineFreehand/VisibleInCadToolBar", false);

    // hide tool from tool matrix (View > Toolbars and Widgets > Widgets > Tool Matrix):
    RSettings.setValue("LineFreehand/VisibleInMatrixPanel", false);
};

moppi
Registered Member
Posts: 2
Joined: Thu Sep 26, 2019 2:15 pm

Re: Customize Gui with Plugin

Post by moppi » Tue Oct 01, 2019 5:44 pm

Hello,

thank you very much.
Is there any overview to take a look what you can change with "setValue"?
I used scripts-directory to take a look, but maybe there is a list for it.

Is it possible to change application name too?

Best regards

moppi

John Hyslop
Premier Member
Posts: 473
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: Customize Gui with Plugin

Post by John Hyslop » Sat Nov 16, 2019 3:21 am

Hi Andrew

Love the ability to be able to switch off tools I may never use or rarely use, so I'm going to
just switch off the toolbar items and leave the menu in case I need to use at some time..

I have these 2 lines that now switch off the Clip Rectangle & Edit Text but I'd like to know if
there is a list somewhere with these values as I pretty much guessed the clip rectangle one
by trying ClipRectangle then ClipRect then ClipToRectangle... is there any documentation
available for these settings on toolbars? these work for me below, added to your JS file MyCustomUI.

// hide tool Edit Text From Toolbar
RSettings.setValue("EditText/VisibleInToolBar", false);

// hide tool Clip Rectangle From Toolbar
RSettings.setValue("ClipToRectangle/VisibleInToolBar", false);
};

Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”