Commit Graph

80 Commits

Author SHA1 Message Date
Abdullah Tahiri
64eb85b1ea ElementWidget: remove unnecesary element pointer
================================================

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.
2023-03-18 11:32:22 +01:00
Abdullah Tahiri
522679321c ElementWidget: reorganise implementation class declarations 2023-03-18 11:32:22 +01:00
Abdullah Tahiri
3f19bcbeef Sketcher: Elements Widget - Fix crash when moving external geometry to another layer
====================================================================================

As reported:
https://forum.freecad.org/viewtopic.php?p=667426#p667426

Support for moving external geometry to another layer will come in the future.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
5242f6d048 ElementsWidget: Move ElementFilterList to implementation
========================================================

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
7cc3fe480c ElementsWidget: Move Delegate to implementation
===============================================

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
74f136bbac Sketcher: TaskSketcherElements - Very Basic Layer Management
============================================================

This class needs quite some rework, as it is mixing model-view model and item model.

Eventually, the whole needs to be moved to a QTreeWidget for layers' implementation.

This commit:
1. Moves back implementation only class item to the cpp file.
2. Adds a contextual submenu to change the selection from one layer to another in the
naive fixed 3 layer implementation.
3. Adds checkboxes to hide geometry.

It is the minimal modification to enable a user work with the 3 layer implementation.
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
ddd1ab43d8 Sketcher: Elements Widget - Add Visual Layer metadata 2023-03-02 20:42:48 +01:00
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