[solved]Saving the state of widgets in Options toolbar

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
User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

[solved]Saving the state of widgets in Options toolbar

Post by petevick » Mon Mar 08, 2021 9:07 pm

In the PolyLineBreakSymbol ui (named changed to stop conflict with LineBreakSymbol ) I have a checkbox, a spinbox and a pair of radiobuttons in the ui of Options toolbar, when I exit the tool, the state of the radiobuttons is not being saved, the checkbox and spinbox states are being saved. I've deleted the PolyLineBreakSymbol section in Qcad3.conf, and on restarting Qcad, the state of the radiobuttons is saved only once, ie I start PolyLineBreakSymbol, draw a break, exit the tool, restart the tool, radiobutton state was saved, change the state, draw a break and exit the tool, the next time I start the tool the radiobutton state is not as the previous session.

I think it's a Linux thing as I've tried it in Windows (running under Wine) and the radiobutton states are saved every time.
Last edited by petevick on Mon Mar 08, 2021 9:35 pm, edited 1 time in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

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

Re: Saving the state of widgets in Options toolbar

Post by andrew » Mon Mar 08, 2021 9:23 pm

Can you try putting the radio buttons into a button group:
1. Select both radio buttons
2. Right-click on one of them and choose
Assign to button group > New button group

You also might want to give the button group a meaningful name. Make sure that the button group is set to "exclusive", so only one of the radio buttons can be checked.

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Saving the state of widgets in Options toolbar

Post by petevick » Mon Mar 08, 2021 9:26 pm

Thanks Andrew, I'll get on to it. :wink:
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

Re: Saving the state of widgets in Options toolbar

Post by CVH » Mon Mar 08, 2021 9:28 pm

Pete,
In a qcad.ini it looks like it is stored fine.

Exclusive QRadiobutoons are stored in bulk.
The name of checked one is stored. :wink:

Regards,
CVH

Code: Select all

[PLineBreakSymbol]
VisibleInMenu=true
VisibleInToolBar=true
VisibleInCadToolBar=true
VisibleInMatrixPanel=true
RemoveSegment=true
BreakHeight=3
IncSeg=IncSeg

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Saving the state of widgets in Options toolbar

Post by petevick » Mon Mar 08, 2021 9:34 pm

I love quick fixes. That did the job, thanks Andrew
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”