Commit Graph

81 Commits

Author SHA1 Message Date
Roy-043
2107270847 Sketcher: improve context menu text for Sketcher_ToggleConstruction
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.
2023-05-07 19:52:12 +02:00
Abdullah Tahiri
a7853a088c 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
4e815584c3 ElementWidget: reorganise implementation class declarations 2023-03-18 11:32:22 +01:00
Abdullah Tahiri
adf6d81ebb 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
6c77d5ae44 ElementsWidget: Move ElementFilterList to implementation
========================================================

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

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
d86686029c 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
dbdd04e05b Sketcher: Elements Widget - Add Visual Layer metadata 2023-03-02 20:42:48 +01:00
wmayer
d25e171ef3 Sketcher: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
wmayer
7a8f48d4e0 Sketcher: move to new style connect() 2023-01-13 20:17:53 +01:00
wmayer
91613cc24c 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
4e55c4b46d [Sketch] Gui:Task*: remove unused headers
- also some sorting
2022-12-14 03:48:40 +01:00
luz paz
f17b73a7bf Cleanup: move return statement to new line + trailing
Follow-up to #6497
2022-12-12 11:38:06 +01:00
wmayer
a21c454387 Sketcher: [skip ci] don't mix QCheckBox::setChecked() with tristate API 2022-11-29 11:03:29 +01:00
Paddle
8284f6bae8 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
34bfb9bbc2 Sketcher: fix warning about QStringLiteral used without argument 2022-11-21 09:57:54 +01:00
0penBrain
283ee6f1a3 Sketcher: filter list strings are updated at language change (include fix commits) 2022-11-20 15:14:19 +01:00
Paddle
1ab352040a Sketcher: Element widget: Improve filter widget. 2022-11-20 15:14:19 +01:00
wmayer
3335f03f3b 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
cf383d709d 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
cd3b7e26c6 Fix issues raised by OpenBrain. 2022-10-29 20:25:34 +02:00
Paddle
3f87aa90b1 ElementWidget: Fix extended naming settings not initializing. Adds 'Collapse filter' option. 2022-10-29 20:25:34 +02:00
Abdullah Tahiri
d8b89b2253 Sketcher: ElementWidget - Rename ElementType to SubElementType - make SubElementType nested to ElementItem 2022-10-29 20:25:34 +02:00
Abdullah Tahiri
098a154ad3 Sketcher: ElementItem - do not select/preselect invalid 2022-10-29 20:25:34 +02:00
Paddle
fef871320b 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
840fc70106 Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
0penBrain
b02d549c98 Sketcher : optimize code that was present for Qt4 compatibility
Was introduced by a2b53be76, new code only supported by Qt5
2022-10-03 11:12:35 -07:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
wmayer
50ef527ded 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
763a575b23 Mod: remove some unnecessary nullptr checks 2022-07-18 12:58:12 +02:00
Abdullah Tahiri
276020c313 Sketcher: Bug fix
https://forum.freecadweb.org/viewtopic.php?p=606581&sid=70cfe557d7d1985e45ea1b298282c759#p606581
2022-07-01 13:56:16 +02:00
mosfet80
c48a569696 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
61be686687 [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
589369a2cc Sketcher: PR6497 move return statement to new line 2022-03-29 13:25:06 -05:00
wmayer
51186c018e Sketcher: modernize C++11
* use nullptr
2022-03-23 19:26:15 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
0penBrain
44edfa37c7 Sketcher: add GeoID on extended naming of geometries 2022-02-15 14:02:07 +01:00
0penBrain
9eb6ac2c4d Sketcher: add construction mode display for points in element list 2022-02-15 14:02:07 +01:00
Abdullah Tahiri
44567167ff Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
wmayer
a6838cf58f Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
Abdullah Tahiri
eff309b591 Sketcher: use addSelections for group selecions in TaskSketcherElements 2021-10-06 13:44:06 +02:00
0penBrain
7b5a23968c [Sketcher] Radiam : make the command basically usable into Gui 2021-06-12 07:07:28 +02:00
donovaly
c88bee029b [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
994bd9d92b 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
00a1aa6225 Part: Geometry - encapsulate construction access 2020-10-25 03:52:51 +01:00
vocx-fc
ec0acf44f1 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
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 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
8c33c43532 [Sketcher] Improve elements color tampering with edge coloring
Use HSV colorspace for maximum Qt4 compatibility
2020-04-07 17:05:37 +02:00