More helpful "need active body" message
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: More helpful "need active body" message
Seems to me like a great enhancement!
Re: More helpful "need active body" message
My only serious comment was that it did not appear to be useful for me. I am certainly not opposed unless it creates problems.
If others find it useful, great.
Gene
Re: More helpful "need active body" message
Just an update on the progress on this thing. I've replaced the combo-view with a list and now most of the part design commands use the new dialog. Haven't done the better default selection, though. Additionally, the default action seems to be to create a new body if you just click OK without selecting anything. If anyone could help me out with this Qt related issue I'm having that'd be great.
Re: More helpful "need active body" message
@chrisb, would you have some time to take a look at the needActiveBodyMessage() function and tell me how I could improve the logic to find the selected item?chrisb wrote: Ping
Re: More helpful "need active body" message
I'm sad to say, but I'm the wrong person to answer this. I understand near to nothing from this code.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: More helpful "need active body" message
Re: More helpful "need active body" message
Can you help out?
openBrain wrote: pinged by pinger macro
TheMarkster wrote: pinged by pinger macro
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: More helpful "need active body" message
In a combobox you can use currentIndex() to find the currently selected item.
https://doc.qt.io/qt-5/qcombobox.html#currentIndex-prop
https://doc.qt.io/qt-5/qcombobox.html#currentIndex-prop
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: More helpful "need active body" message
To get the body that contains the active object currently selected:
Code: Select all
PartDesign::Body* bodyOfActiveObject = PartDesign::Body::findBodyOf(doc->getActiveObject());
Re: More helpful "need active body" message
TheMarkster already said it all (except I guess that 'activeObject' can be different from the selected item in some cases).
I quickly read the thread, and should say I would prefer a list rather than a combo box too. Especially if double-click is supported.