Leader Line issues

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Leader Line issues

Post by uwestoehr »

wandererfan wrote: Sun Jan 26, 2020 6:05 pm Ahh, you've run into the great FC divide between App and Gui! Gui is allowed to call App, but App is not allowed to call Gui.
OK. The idea was only to add the properties LineWidth etc. if the parameter ShowFrame is set.
So if it is possible to evaluate ShowFrame in ViewProviderRichAnno.cpp then my idea can work, otherwise i don't see a ways to implement a conditional hiding of the line parameters when there is no frame.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Leader Line issues

Post by wandererfan »

uwestoehr wrote: Sun Jan 26, 2020 9:57 pm I don't know about the internals. What i did was just what i see for other TD components and they do a QGIView updateView(true).
Usually Qt figures out all the repainting for you. In this case it was not, so we need to force it with the update() call.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Leader Line issues

Post by wandererfan »

uwestoehr wrote: Sun Jan 26, 2020 10:01 pm OK. The idea was only to add the properties LineWidth etc. if the parameter ShowFrame is set.
So if it is possible to evaluate ShowFrame in ViewProviderRichAnno.cpp then my idea can work, otherwise i don't see a ways to implement a conditional hiding of the line parameters when there is no frame.

Code: Select all

if (getViewObject()->ShowFrame.getValue()) {
       LineWidth.setStatus(App::Property::ReadOnly,true);    //or
//       LineWidth.setStatus(App::Property::Hidden,true);
       ....
}
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Leader Line issues

Post by wandererfan »

uwestoehr wrote: Sun Jan 26, 2020 10:01 pm OK. The idea was only to add the properties LineWidth etc. if the parameter ShowFrame is set.
So if it is possible to evaluate ShowFrame in ViewProviderRichAnno.cpp then my idea can work, otherwise i don't see a ways to implement a conditional hiding of the line parameters when there is no frame.

Code: Select all

if (!getViewObject()->ShowFrame.getValue()) {
       LineWidth.setStatus(App::Property::ReadOnly,true);    //or
//       LineWidth.setStatus(App::Property::Hidden,true);
       ....
}
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Leader Line issues

Post by uwestoehr »

wandererfan wrote: Mon Jan 27, 2020 12:50 am

Code: Select all

if (getViewObject()->ShowFrame.getValue()) {
       LineWidth.setStatus(App::Property::ReadOnly,true);    //or
Thank you. I tried this but chose the wrong position directly after the addition of the parameters.
In this PR: https://github.com/FreeCAD/FreeCAD/pull/2956
it works now as it should: only enabled if there is a frame.
Post Reply