Commit Graph

39 Commits

Author SHA1 Message Date
wmayer
d25e171ef3 Sketcher: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
Ajinkya Dahale
e25896df37 [Sketcher] Prevent dereferencing nullptr in ConstraintView
Fixes #8104.

As described in that issue, a crash happens under the following
conditions:
1. A `DrawSketchHandler` is active.
2. No constraint is selected.
3. Context menu on the `ConstraintView` is triggered.
2023-01-13 15:06:39 +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
Uwe
2b9a28e0ec remove some unnecessary Boolean checks
- checks for true/false and nullptr
2022-12-12 21:17:49 -06:00
0penBrain
12be235ca9 Sketcher: TaskSketcherConstraints: defensive support of nested signal blocking 2022-12-01 16:21:50 +01:00
0penBrain
64e3b1f9a3 Sketcher: correctly restore constraints display according filters 2022-12-01 16:21:50 +01:00
0penBrain
8d6dda700d Sketcher: cleanup TaskSketcherConstraints 2022-12-01 16:21:50 +01:00
0penBrain
e9adbfae4f Sketcher: also save advanced filters + minor fix 2022-12-01 16:21:50 +01:00
0penBrain
f2e4fe03f5 Sketcher: constraint settings are kept in sync with user parameters 2022-12-01 16:21:50 +01:00
0penBrain
28df9d6f72 Sketcher: 'HideInternalAlignment' also has effect when constraint filter is disabled 2022-12-01 16:21:50 +01:00
0penBrain
98500bf453 Sketcher: settings in Task Constraint are translatable 2022-12-01 16:21:50 +01:00
0penBrain
3ab4427658 Sketcher: fix basic issues in Task Constraint 2022-12-01 16:21:50 +01:00
wmayer
6653991a97 Gui/Mod: handle several compiler warnings:
* ignore -Wfree-nonheap-object for generated code
* replace 0 with Qt::NoModifier when creating a QKeyEvent
* in Qt 5.14 QCombobox::activated(QString) is deprecated, use textActivated
* don't mix QCheckBox::setChecked() with tristate API
2022-11-29 10:36:02 +01:00
wmayer
68da5ea5cf Sketcher: [skip ci] fix compiler warning 2022-11-24 10:55:24 +01:00
Paddle
5083efc2cf Sketcher: Constraint widget: Add 'Auto constraints' and 'auto remove redundant' to the setting button. 2022-11-24 01:09:38 +01:00
Paddle
0eef8b50b3 Sketcher: Constraint widget: Improve the filter such that the filter state and checkboxe state is cross-cession. Enabling user to 'save' filter state. 2022-11-24 01:09:38 +01:00
Paddle
6f93989777 Sketcher: Constraint widget: - Fix eye button
- move 'Internal alignment' to Geometric.
    - Fix another bug.
2022-11-24 01:09:38 +01:00
Paddle
ae0554cd5e Sketcher: filter list strings are updated at language change. By @0penBrain 2022-11-24 01:09:38 +01:00
Paddle
398deb2f5b SKETCHER: Constraint widget rework (issue 7518)
see https://forum.freecadweb.org/viewtopic.php?f=34&t=71595&start=20
2022-11-24 01:09:38 +01:00
wmayer
840fc70106 Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
berniev
180edfa3cc Mod: Single arg ctors must be explicit 2022-08-24 16:55:20 +02:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
47ac049e14 Mod: use emplace_back 2022-08-05 10:36:16 +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
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
0penBrain
7a16a2fff1 Sketcher: restore constraint filter if Multiple dialog is canceled 2022-04-07 12:30:36 +02: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
wmayer
1cbecdf122 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Abdullah Tahiri
44567167ff Sketcher: Convert PointPos into an enum CLASS 2021-12-11 16:17:21 +01:00
Abdullah Tahiri
182596ba08 Sketcher: GeoId, GeoElementId and GeoUndef refactor
===================================================

This commit is an independent refactor of the identifications used at Sketcher level.

It introduces a new type "GeoElementId" as a combination of GeoId and PointPos.

It moves the Undefined GeoId, previous Constraint::GeoUndef to GeoEnum, together with all
other fixed values of GeoIds.
2021-12-11 16:17:21 +01:00
Abdullah Tahiri
01d37cdaad Sketcher: move GUI common utility functions to a new file Utils.h
=================================================================

Common utility functions used by almost all Command classes were previous in Constraint.h.

Aside from providing a very bad intent, it created unnecessary header dependencies.

This commit separates these common functions into a new header, utils.h, which is then
used in all command classes where it is necessary.
2021-12-07 16:30:55 +01:00
wmayer
a6838cf58f Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
wmayer
799a1c3d56 Sketcher: fix some memory leaks 2021-11-06 17:48:35 +01:00
luz paz
56aeb07202 Sketcher: fix typos in Constraint Widget
- Follow-up to 5b745514e0f

- Sketcher: fix relevant typos

- Re-Add mistakenly deleted files

- fix build
2021-10-23 18:37:33 +02:00