When a geometry element is selected and then hidden using the visibility
checkbox in the Elements panel, it remains in the selection.
Subsequently, if another geometry element is selected and deleted, both
the visible element AND the hidden element are deleted.
Root cause of that is basically that `changeLayer()` functions change
the geometry's visual layer, but never clear the geometry from
`Gui::Selection()`.
So, this patch adds the handling to collect every sub-element name of
the hidden geometry and then formats it and calls remove selection on
the geometry during layer change transaction.
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
* Sketcher: Auto-scroll to selected geometry elements
Currently if user selects a geometry element on sketch, listview is not
scrolling to it.
So, this patch moves the previously added logic to constraints into a
separate helper function call and calls it for Geometry Elements as
well, resulting in scrolling in both lists - constraints and elements.
* Sketcher: Add QListWidget to enable QListWidget symbols for CI
This commit is generated using regex based find and replace:
```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```
To regenerate if needed.
* fix selection from Sketcher Task Panel
* fix selection from 3D View
* Synchronize selection between Task Panel and 3D View
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
Sketcher_ConstrainLock after Sketcher_ConstrainAngle.
Sketcher_ConstrainRadiam before Sketcher_ConstrainRadius.
This was not always correct.
See also #12667.
This creates new method overload for changing layer of exact
ElementItem. This fixes strange behavior of the checkboxes for elements
that were dependent not on what user clicked but on what is selected.
Fixes: #8814
This commit like previous one introduces ability to style list of
elements in the sketcher. It also completely refactors the rendering
delegate introducing dedicated method for calculating rects of each
element and method for rendering each sub control. Thanks to this
refactor we can be sure that areas drawn are the same as areas checked
for events in editorEvent.
This ensures that checkboxes drawn in the Elements UI of the sketcher
can be styled using the correct style.
Three changes are introduced:
1. paint() method uses style provided by the widget, not application.
2. Indicator is drawn using PE_IndicatorCheckBox not CE_CheckBox - it
allows to use ::indicator in qss to style it properly. This works the
same as TreeView.
3. Fix for minor issues with text alignement and extension of selected items
background to cover checkbox. This is how other controls of this kind
work.
In the Elements context menu (Sketcher task panel) the menu text for Sketcher_ToggleConstruction is "Toggle construction line", this should be "Toggle construction geometry". It is not just lines that can be toggled, and this is also the menu text in the main Sketcher menu.
================================================
This should fix this (I cannot reproduce it):
https://forum.freecad.org/viewtopic.php?p=667579#p667579
Lately I added the geometry pointer to the item. This has indeed
the potential for an already deleted pointer being accessed.
This PR removes the geometry pointer from the item and relies on the
ViewProvider to indirectly access an updated pointer.
====================================================================================
As reported:
https://forum.freecad.org/viewtopic.php?p=667426#p667426
Support for moving external geometry to another layer will come in the future.