help locating class definition
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
help locating class definition
Hi,
I'm trying to work on some issues in PathWB and I'm having a little trouble exploring the many branches of the source code tree to find what I need.
I want to change the minimum property on an instance of quantitySpinBox. I suspect that this is part of a derivative class grouping a number of widgets: InputField, quantitySpinBox and the little "f(x)" glyph which opens the function evaluation dlg.
I'm looking at a Job.Operations.DressupBoundary.Stock.Placement.Position.x entry in the tree-view and this seems to use the same widget as Body.Placement.Position.x , for example. These are pretty ubiquitous , so I'm guessing they are defined as a class. Can anyone tell me the class name? That would save some time.
many thanks.
I'm trying to work on some issues in PathWB and I'm having a little trouble exploring the many branches of the source code tree to find what I need.
I want to change the minimum property on an instance of quantitySpinBox. I suspect that this is part of a derivative class grouping a number of widgets: InputField, quantitySpinBox and the little "f(x)" glyph which opens the function evaluation dlg.
I'm looking at a Job.Operations.DressupBoundary.Stock.Placement.Position.x entry in the tree-view and this seems to use the same widget as Body.Placement.Position.x , for example. These are pretty ubiquitous , so I'm guessing they are defined as a class. Can anyone tell me the class name? That would save some time.
many thanks.
- Attachments
-
- Tree-view-Xpos.png (23.2 KiB) Viewed 1000 times
Re: help locating class definition
Thanks but the default for the standard GUI:QuantitySpinBox is: minimum(-DOUBLE_MAX) , not zero. I need to find out how and where it is getting set to zero. I won't get far searching for "0" so I need to know the class name, so I can find where it is set up .
I'm pretty sure the must a class for the this composed widget. ie it's the enhanced InputField I'm after not the spinbox on it, though I'm fairly sure it is the spinbox which is controlling the input values. It has that ability.
I haven't yet found out how the new "stock" item gets pushed into the tree-view tree object.
I'm pretty sure the must a class for the this composed widget. ie it's the enhanced InputField I'm after not the spinbox on it, though I'm fairly sure it is the spinbox which is controlling the input values. It has that ability.
Code: Select all
void QuantitySpinBox::setValue(const Base::Quantity& value)
{
Q_D(QuantitySpinBox);
d->quantity = value;
// check limits
if (d->quantity.getValue() > d->maximum)
d->quantity.setValue(d->maximum);
if (d->quantity.getValue() < d->minimum)
d->quantity.setValue(d->minimum);
d->unit = value.getUnit();
updateText(value);
}
Re: help locating class definition
According the .ui panel resource of BoundaryDressUp, it seems that this is of class "Gui::InputField" and not "Gui::QuantitySpinBox".
Re: help locating class definition
You are probably talking about the Boundary dialog.Please note, that this is the same dialog which is used in the Job definition. There it is sensible to have 0 as minimum value.
If I understood it right, it was a mere time saver to reuse the dialog. From what we know now it may be discussed if a new dialog is sensible.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: help locating class definition
Reference to discussion in Path forum: https://forum.freecadweb.org/viewtopic. ... 13#p353213.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: help locating class definition
Indeed Chris, I'll discuss that in the other thread. I wanted to hack the code a bit and see what happens so I can have something concrete to discuss.
I posted this question here, since I need to find out how all this hangs together and it is not specific to PathWB, since it inherited from the tree-view and more global parts of FreeCAD. I thought it is probably more relevent to ask that here.
I posted this question here, since I need to find out how all this hangs together and it is not specific to PathWB, since it inherited from the tree-view and more global parts of FreeCAD. I thought it is probably more relevent to ask that here.
Re: help locating class definition
It's allright to be discussed here, just wanted to give the pointer, because I had later seen, that were already aware of my warning.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: help locating class definition
Thanks. That is why I'm trying not to discussing BoundaryDressUp here. There is a rather opaque thing going in here where InputField accepts downkey and will display values < 0 but the bounds box display does not match it. That input seems to be connected to the "Gui::QuantitySpinBox" in the tree-view, and that is what has minimum fixed on it.
Heck I was trying not mix the two but OK. It seems the Gui::QuantitySpinBox is the class I was looking for. After a close look this is indeed to one with the f(x) glyph etc. I still have not found where minimum is being set. I need to change this.
In this case, the property is Stock.Placement.Position.x but I can't find where it is being given the minimum of zero.deepSOIC wrote:This is typically controlled by the definition of the property, not by some spinbox.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: help locating class definition
That's not a property, Placement is the property. And its spinboxes don't have constraints, as far as I know. Can you provide a file with such an object? (I'm not familiar with Path )
EDIT: never mind, I figured out just creating a job is enough to have myself a Stock object to play with