Commit Graph

61 Commits

Author SHA1 Message Date
bofdahof
34881bc82e Sketcher: apply std::ranges 2025-03-16 17:18:12 -05:00
Ian Hunter
67f8852697 Fix bug preventing filtering named constraints (#19339)
* Fix bug preventing filtering named constraints

There was a bug (see issue #11843) that displayed a filter for Named
constraints in the Sketcher Workbench whose toggling did not affect the
UI in any way. This enables this feature by checking if a given
constraint has a custom name or not and then appropriately toggling its
visibility.

* Use `std::string::empty()` per reviewer suggestion

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-02-11 11:03:04 -06:00
Benjamin Bræstrup Sayoc
c0c6df10ec Sketcher: Use QStringLiteral 2025-02-10 18:32:45 +01:00
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Beep6581
a1f5d36584 Auto scroll to constraint on click (#18859)
* Auto scroll to constraint on click

When clicking on a contrasint in Sketcher, that constraint is now
automatically scrolled to in the Constraints listview. If selecting
multiple constraints, the last one is scrolled to.
Closes #17361

* Check model() for nullptr

* scrollTo only on select, not de-select #18859
2025-01-21 11:33:51 -06:00
Ladislav Michl
2ea8a633ac Base: Quantity: return std::string 2024-12-23 17:48:42 +01:00
Ladislav Michl
0ee3c9f8e6 Base: Drop QString-std::string conversion functions from Tools
Convenience helpers function Tools::toStdString and Tools::fromStdString
were implemented for Qt4 or older to perform utf8 aware conversion as
QString::toStdString/QString::fromStdString were using toAscii/fromAscii
internally (see https://dreamswork.github.io/qt4/classQString.html).

Since Qt5 QString uses toUtf8/fromUTf8, which makes the helper functions
obsolete (see https://doc.qt.io/qt-5/qstring.html#fromStdString).
2024-12-02 23:30:53 -05:00
wmayer
ee1af2748a Coverity scan: Uninitialized scalar variable
* CID 350633
* CID 512344
* CID 514343
2024-11-13 18:58:16 -05:00
Chris Hennes
4eb57fb50d Sketcher: Resolve unsafe combination of bool and int in | 2024-07-08 11:02:49 -05:00
marcuspollio
0526257be5 Merge remote-tracking branch 'upstream/main' into UI-TaskPanels-cleanup-1 2024-05-15 13:45:43 +12:00
Johannes Wüller
0e24e121eb Fix backwards-compatible Qt6 warnings 2024-05-13 11:39:24 -05:00
marcuspollio
23537d97d7 Sketcher UI: Update Task panels icons 2024-05-12 15:57:26 +12:00
Chris Hennes
d9fc266772 Sketcher: Remove trailing spaces from translations 2024-03-12 22:42:19 -05:00
Kacper Donat
ecd591450c Sketcher: Make Constraints UI style aware
This adds reference to the actual widget to the painting of Constraints
List control of Sketcher. Thanks to this this list can now be styled
using standard mechanisms of Qt framework like QSS.
2024-01-20 21:59:01 +01:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
wmayer
5621a0089f Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
2023-08-04 21:23:14 -06:00
Abdullah Tahiri
d7aa7bcb85 Sketcher: unused variable fixes 2023-06-11 20:32:39 +02:00
Abdullah Tahiri
ec899d75c6 SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
60d99ca570 Sketcher: Obey non-intrusive preferences for modal pop-ups
==========================================================

This commit turns the remaining blocking pop-ups in which the user can only click "ok"
into non-intrusive notifications, depending on the user preferences in settings.
2023-05-24 18:35:41 +02:00
Chris Hennes
f90aed491e Sketcher: Translate context menu 2 2023-05-17 14:43:57 +02:00
wmayer
1fc3f52e73 Sketcher: fix -Wclazy-connect-by-name 2023-04-05 00:44:13 +02:00
wmayer
7f8b136dae Sketcher: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
Ajinkya Dahale
e47147ea37 [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
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
Uwe
0533550f95 remove some unnecessary Boolean checks
- checks for true/false and nullptr
2022-12-12 21:17:49 -06:00
0penBrain
5337812e23 Sketcher: TaskSketcherConstraints: defensive support of nested signal blocking 2022-12-01 16:21:50 +01:00
0penBrain
317eee4eb2 Sketcher: correctly restore constraints display according filters 2022-12-01 16:21:50 +01:00
0penBrain
875385ee9d Sketcher: cleanup TaskSketcherConstraints 2022-12-01 16:21:50 +01:00
0penBrain
087ff75340 Sketcher: also save advanced filters + minor fix 2022-12-01 16:21:50 +01:00
0penBrain
f1f9dcfc05 Sketcher: constraint settings are kept in sync with user parameters 2022-12-01 16:21:50 +01:00
0penBrain
7088930dba Sketcher: 'HideInternalAlignment' also has effect when constraint filter is disabled 2022-12-01 16:21:50 +01:00
0penBrain
293edba342 Sketcher: settings in Task Constraint are translatable 2022-12-01 16:21:50 +01:00
0penBrain
17144272c7 Sketcher: fix basic issues in Task Constraint 2022-12-01 16:21:50 +01:00
wmayer
ad1cccdd27 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
10895e18ff Sketcher: [skip ci] fix compiler warning 2022-11-24 10:55:24 +01:00
Paddle
142f6d8843 Sketcher: Constraint widget: Add 'Auto constraints' and 'auto remove redundant' to the setting button. 2022-11-24 01:09:38 +01:00
Paddle
13e71c0533 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
22271deb2d Sketcher: Constraint widget: - Fix eye button
- move 'Internal alignment' to Geometric.
    - Fix another bug.
2022-11-24 01:09:38 +01:00
Paddle
7788ef185b Sketcher: filter list strings are updated at language change. By @0penBrain 2022-11-24 01:09:38 +01:00
Paddle
378463de03 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
82866db0ca Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
berniev
6953310116 Mod: Single arg ctors must be explicit 2022-08-24 16:55:20 +02:00
berniev
ddafb98813 Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
2d4c5a4cfb Mod: use emplace_back 2022-08-05 10:36:16 +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
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