before including the library, it is uselessly checked if the variable __QtAll__ and __InventorAll__ have been defined. The same check is performed again once the library is included
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
* Measurement: save 'Show Delta' state between commands #19204
When users set Show Delta option to off in the Measure tool, the setting
was not being preserved when the tool was invoked again. This was due to
using an uninitialized value as the default when loading the preference.
Changes staged in: FreeCAD\src\Mod\Measure\Gui\TaskMeasure.cpp
Fixed by:
- Using explicit 'true' as default value when loading Show Delta
preference
- Maintains existing save functionality
- Ensures consistent behavior on first use
Fixes#19204
* Changed few things to ensure the delta state is saved #19204
added changes:-
1. settings.endGroup()
When we call beginGroup(), it creates a prefix for all subsequent settings operations, All settings will be stored under the "TaskMeasure" group.
endGroup() is needed to close this grouping scope
Without it, subsequent settings operations would still use the "TaskMeasure" prefix
2. settings.sync()
By default, QSettings caches changes in memory and writes them to disk later
sync() makes an immediate write to the settings file
This ensures the setting is saved right away rather than waiting for Qt to decide when to save.
Makes the setting change immediately available for future commands.
-Fixes Measurement: save 'Show Delta' state between commands #19204
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added proposed changes to autoSaveChanged() and newMeasurementBehaviourChanged() functions #19204#19430
Added settings.endGroup() to the following functions:-
1.autoSaveChanged()
2.newMeasurementBehaviourChanged()
Each beginGroup() should be followed by endGroup().
No need for explicitily calling sync() as it is called automatically from QSettings's destructor and by the event loop at regular intervals.(Refer documentation for more info)
-Fixes Measurement: save 'Show Delta' state between commands #19204#19430
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* [Meas]Changes for TD dimension refs for links
* [TD]App changes for dim refs to links
* [TD]Gui changes for dim refs to links
* [TD]fix 2 lint messages
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* initial commit to implement more interactive measurement functionality
Files: TaskMeasure.cpp and TaskMeasure.h
* Enable artifacts for easy download
Files: sub_buildWindows.yml
* clearSelection before setting new selection
Files: TaskMeasure.cpp
* No need for mSkipSelectionChange
Reason/Description: Because the next onSelectionChanged will be triggered asynchronly
Files: TaskMeasure.cpp and TaskMeasure.h
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* block selection
* Block selection must be done on the taskMeasure, because it is the signal observer
* Set autosave to false by default
Reason/Description: Because the measurement tool is intended to be a temporary tool
Files: TaskMeasure.cpp and TaskMeasure.h
* Add tooltip
Files: TaskMeasure.cpp
* No need to set the selection style
Reason: Because it was changed to normal, so no need to re set it
Files: TaskMeasure.cpp
* No need to clear and reset the selection
Reason/Description: Because it will be done directly in the application. It was required with greedy selection, but now it is anymore required
Files: TaskMeasure.cpp
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert "Enable artifacts for easy download"
This reverts commit 8118323ab4104ada1fb89eebbe72965c5f2f2b67.
* Move autosave and selection mode into a group box and add a possibility to hide those options
Files: TaskMeasure.cpp and TaskMeasure.h
* Use toolbutton with a normal menu instead of a normal QPushButton
Reason/Description: Because it integrates much better
Files: TaskMeasure.cpp and TaskMeasure.h
* QAction uses a bool for the checkstate
Files: TaskMeasure.cpp and TaskMeasure.h
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix compile warnings
Reason/Description: cleanup and fix warnings
Files: TaskMeasure.cpp and TaskMeasure.h
* Add better tool tip
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix typo
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* MeasureGui: Revert temporary measure object creation
Reverts the temporary creation of measurement objects that was added in #15122
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* MeasureGui: Adress review comments
- Remove _mDocument and _mGuiDocument
- Replace c-style casts with dynamic_cast
- Add file guard
- Remove leftover canAnnotate method
* MeasureGui: Fix crash when selecting elements from different documents
* MeasureGui: Add additional type check in ensureGroup
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Changed QuickMeasurement to be conservative
QuickMeasurement should not measure while tool dialogs are open
this includes but is not limited to editing sketches
also changed several other sanity checks to be opt-in vs opt-out, as discussed.
* move the test if it is safe to measure to when the measurement actually happens - avoids any potential race conditions
Returning a null shape would have triggered an exception in the bottom branch but not in the top one - which later leads to a segfault - solution - raise an exception. OOC doesn't like null shapes.
The measurement code did not handle mixed selections of known and unknown types correctly. Although a unknown selected object would leave the type at Invalid, selecting both known and unknown objects would have the type determined by the known object type and treat the unknown as the same. This causes exceptions and - worst case a segmentation fault.
This fix introduces a new category "other" which - if present in a selection always forces type to Invalid. This should be forward compatible in case new types are introduced in the future.