Commit Graph

73 Commits

Author SHA1 Message Date
wmayer
7f8b136dae Sketcher: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
wmayer
7ccee344c7 Sketcher: move to new style connect() 2023-01-13 20:17:53 +01:00
wmayer
3e58513c24 Mod: fix some compiler warnings:
* QString::indexOf() is now marked as [[nodiscard]]
* QApplication::fontMetrics() is deprecated, use the constructor of QFontMetricsF
* fix -Wunused-result
* fix -Wunused-but-set-variable
2022-12-31 21:54:45 +01:00
Uwe
a912e8aa95 [Sketch] Gui:Task*: remove unused headers
- also some sorting
2022-12-14 03:48:40 +01:00
luz paz
80efe8191e Cleanup: move return statement to new line + trailing
Follow-up to #6497
2022-12-12 11:38:06 +01:00
wmayer
9388cea9c7 Sketcher: [skip ci] don't mix QCheckBox::setChecked() with tristate API 2022-11-29 11:03:29 +01:00
Paddle
33f81cd0e1 Sketcher: Element widget: - FilterBox and filter state is now registered as preference to be cross-session. 2022-11-24 01:14:43 +01:00
0penBrain
80308c0105 Sketcher: fix warning about QStringLiteral used without argument 2022-11-21 09:57:54 +01:00
0penBrain
7b2a6a3bf7 Sketcher: filter list strings are updated at language change (include fix commits) 2022-11-20 15:14:19 +01:00
Paddle
15dd77512e Sketcher: Element widget: Improve filter widget. 2022-11-20 15:14:19 +01:00
wmayer
fce59ca723 Sketcher: fix clazy warnings:
* Wclazy-connect-by-name
* Wclazy-unused-non-trivial-variable
* Wclazy-detaching-temporary
2022-11-13 15:39:27 +01:00
Paddle
0a5358c24f Sketcher: Fix element widget repaint delay bug
Related to https://github.com/FreeCAD/FreeCAD/pull/7567#issuecomment-1304724547
2022-11-13 07:13:06 +01:00
Paddle
d22e049930 Fix issues raised by OpenBrain. 2022-10-29 20:25:34 +02:00
Paddle
deff1f42e4 ElementWidget: Fix extended naming settings not initializing. Adds 'Collapse filter' option. 2022-10-29 20:25:34 +02:00
Abdullah Tahiri
1104a84587 Sketcher: ElementWidget - Rename ElementType to SubElementType - make SubElementType nested to ElementItem 2022-10-29 20:25:34 +02:00
Abdullah Tahiri
6ff553fa5d Sketcher: ElementItem - do not select/preselect invalid 2022-10-29 20:25:34 +02:00
Paddle
a656ffbd53 SKETCHER: Element widget rework see https://forum.freecadweb.org/viewtopic.php?f=8&t=72239&sid=b7787fadb4c2a7e9682d28f31ede5eb8 2022-10-29 20:25:34 +02:00
wmayer
82866db0ca Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
0penBrain
26aaf0af45 Sketcher : optimize code that was present for Qt4 compatibility
Was introduced by 634e47f31, new code only supported by Qt5
2022-10-03 11:12:35 -07:00
berniev
ddafb98813 Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
wmayer
d344ccc4eb Sketcher: [skip ci] Fix several clazy issues:
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Unused QString [-Wclazy-unused-non-trivial-variable]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]
* Don't call QList::operator[]() on temporary [-Wclazy-detaching-temporary]
* Use multi-arg instead [-Wclazy-qstring-arg]
* Maybe you meant to call ViewProvider2DObjectGrid::onChanged() instead [-Wclazy-skipped-base-method]
2022-07-25 12:56:09 +02:00
Uwe
88a06f8f10 Mod: remove some unnecessary nullptr checks 2022-07-18 12:58:12 +02:00
Abdullah Tahiri
19a69df0fc Sketcher: Bug fix
https://forum.freecadweb.org/viewtopic.php?p=606581&sid=70cfe557d7d1985e45ea1b298282c759#p606581
2022-07-01 13:56:16 +02:00
mosfet80
620c273c4e Boost version <=1.60 is never used in freecad 0.20 (#7038)
* Boost version 1.60 is never used in freecad 0.20
2022-06-24 02:20:26 +02:00
Uwe
68a499574a [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
1ee046788d Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00
wmayer
ead5154b18 Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
0penBrain
30daaa66bc Sketcher: add GeoID on extended naming of geometries 2022-02-15 14:02:07 +01:00
0penBrain
6037553f3c Sketcher: add construction mode display for points in element list 2022-02-15 14:02:07 +01:00
Abdullah Tahiri
97c82a6703 Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
wmayer
ca5c799ce2 Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
Abdullah Tahiri
e333225a12 Sketcher: use addSelections for group selecions in TaskSketcherElements 2021-10-06 13:44:06 +02:00
0penBrain
ea1e6595b5 [Sketcher] Radiam : make the command basically usable into Gui 2021-06-12 07:07:28 +02:00
donovaly
28c66fc501 [Sketcher] make pointers to the UI std::unique_ptr
Same as PR #4293, just for Sketcher

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all Sketcher dialogs that don't already use a unique_ptr.
2021-02-04 10:37:44 +01:00
Abdullah Tahiri
395a0f19b4 Part/Sketcher - Construction Migration - step 3: Removal of Geometry construction data member
=============================================================================================

This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
1f46b72491 Part: Geometry - encapsulate construction access 2020-10-25 03:52:51 +01:00
vocx-fc
68c7b1f078 Sketcher: rename constraint icons to be more consistent with the rest
`Sketcher_ConstrainBlock` to `Constraint_Block`.
`Sketcher_ConstrainLock` to `Constraint_Lock`, and the corresponding
`_Driven` variant.

Adjust the icons in the taskpanel for the sketcher constraints,
elements, and for the action menu for constraints.

Adjust the icon order in the `Sketcher.qrc` resource file.
2020-10-01 09:59:26 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
0penBrain
cbefa8e6fe [Sketcher] Improve elements color tampering with edge coloring
Use HSV colorspace for maximum Qt4 compatibility
2020-04-07 17:05:37 +02:00
0penBrain
634e47f318 [Sketcher] Fix Qt4 compatibility in MultIcon + minor improvement 2020-04-07 17:05:37 +02:00
Abdullah Tahiri
9752de8602 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’?
2020-04-07 17:05:37 +02:00
0penBrain
9b2e7b22c5 [Sketcher] Distinguish normal/reference/construction elements in task dialog 2020-04-07 17:05:37 +02:00
Joshua Call
61c88918bc Rename Sketcher icons
Renamed Sketcher_AlterConstruction.svg to
Sketcher_ToggleConstruction.svg, and renamed the original
Sketcher_ToggleConstruction.svg to Sketcher_ToggleConstruction_old.svg
as per the directions of vocx in this forum post:
https://forum.freecadweb.org/viewtopic.php?f=21&t=42131&p=357725#p357725
2020-01-05 15:29:47 +01:00
Abdullah Tahiri
e9f3551f8f Sketcher: Mode filter of Elements Widget
========================================

A combobox type filter to filter out on Normal geometry, Construction geometry, External geometry.

Useful, for example, to select and or delete only construction geometry.

It also fixes a bug, that external geometry was wrongly indexed in non-extended naming mode.
2019-07-01 13:49:06 +02:00
Abdullah Tahiri
dc32a0685b Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
triplus
43b081947f Improved icon themes support 2019-02-13 10:42:46 -02:00
Abdullah Tahiri
2830f107ae Sketcher: Improve element widget name of external geometry
===========================================================

fixes #3719

what?
https://forum.freecadweb.org/viewtopic.php?f=3&t=32693&p=274634#p274634
2018-12-19 10:27:30 -02:00