FreeCAD: master 9752de86

Author Committer Branch Timestamp Parent
abdullah abdullahtahiriyo master 2020-04-05 09:41:02 master 9b2e7b22
Changeset Sketcher: Element Widget External/Construction icons fixes

==========================================================

Changes:
- Move multIcon structure to be internal to TaskSketcherElements class
- Change Caps to MultIcon for consistency
- Move tamperIcon from TaskSketcherElements to MultIcon struct
- Change tamperIcon method to be the constructor of MultIcon and change from struct to class
- Update the tamperIcon algorithm, so that only the point that is not marked in green as selected
is made pink.

Bug fix:

UpdateIcons and SlotElementsChanged are methods sharing code (they could benefit from a refactoring), but
they are conceptually different and are called in very different circumnstances.

UpdateIcons preserves selection. This means that one may select the stating point of line1, press z to switch
to edges, select the edge of line 2 and do a point on object constraint all without touching the 3D view.

SlotElementsChanged occurs when there are additions or removals in the number of geometry elements of the widget.

Warning:

This code requires QT 5.6 because of function pixelColour(int, int):
https://doc.qt.io/qt-5/qimage.html#pixelColor-1

Travis without QT5 complains with:

/home/travis/build/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp:1120:31: error: ‘class QImage’ has no member named ‘pixelColor’; did you mean ‘setColor’?
mod - src/Mod/Sketcher/Gui/TaskSketcherElements.cpp Diff File
mod - src/Mod/Sketcher/Gui/TaskSketcherElements.h Diff File