"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
+ Use Qt's translation of the Save and Close buttons
+ Use QShortcut instead of eventFilter() because the latter is
too aggressive eating all Enter and ESC events
This fixes the remaining issues as mentioned at the PR 17109
Made several fixes to TaskMeasure:
* Move to correct namespace
* Handle possible exception in update() method
* Add null pointer checks for buttonBox
* Cannot use 'Measure::MeasurePython' as template argument in addObject<>
because the macro PROPERTY_HEADER_WITH_OVERRIDE determines the invalid
string 'App::FeaturePythonT<FeatureT>' so that an exception is raised
Note: The changes might fix issue 20304
* [Measure] Revert one specific piece of code from PR19142
* Measure: Add comment for workaround
---------
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
* 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>
* 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>
* Initial commit to apply delta also for interactive measurement
* Not required special logic to check if possible, it can be easily checked if the property exists
* remember setting so it is not required to turn it always on
* MeasureGui: Store measure type in TaskMeasure
* MeasureGui: Avoid adding measurement to document during command interaction
* [Gui] Add check for document in VPDocumentObject::getActiveView
* MeasureGui: Track the document when adding objects
* MeasureGui: Cleanup python measurement creation
* [Gui] Add isAnnotationViewProvider method
* [Gui] Check if viewprovider is added as an annotation in getActiveView
* [Gui] Add takeAnnotationViewprovider method to Gui::Document
* [Gui] Make addViewProvider public
* [MeasureGui] Add existing view provider to document when storing measurement
* [MeasureGui] Fix invocation of initial label placement
* [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>