* Gui: Prepare for clang-format
* [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>
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.
The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).
Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".
The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
Replace the int of the SubType of SelectionChanges with an enum class.
The meaning of it is nowhere documented and some magic numbers like 0,1,2 are used in several places in the code.
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
Adds checkboxes to the document tree which makes it possible to
select multiple document objects on devices without physical keyboard.
These checkboxes are opt-in and can be enabled/disabled from:
Edit -> Preferences -> Display -> Navigation -> Selection
Forum thread for feature the request:
https://forum.freecadweb.org/viewtopic.php?f=34&t=53065
We need to iterate the tree to add/remove the selection boxes when
the enable-setting has been changed.
The size for the first column in the tree is adjusted to fit both
name and optional checkbox.
+ rename method setMatchExact() to setExactMatch()
+ move handling of user-defined parameters to class ExpressionParameter
+ Qt::MatchExactly is not supported by QCompleter, use Qt::MatchStartsWith instead
+ add possibility to change match behaviour via context-menu
Fixes#4428
Filter mode set to Qt::MatchContains for tree view search and link
property editor object search.
Other usage of the completer (e.g. property editor, speadsheet) defaults
to Qt::MatchContains, but can be changed using parameter,
BaseApp/Preferences/Expression/CompleterMatchExact
PropertyLinkItem now support all major types of link property.
PropertyLinkListItem is no longer necessary, but kept for backward
compatible, which is now identical to PropertyLinkItem.
DlgPropertyLink, the link selection dialog, is now made modeless, so
that that user can select geometry sub-element directory from 3D view.
* Display property from linked object, colored green,
* Change DlgPropertyLink to support external linking and sub-object
selection
* Improve large selection performance by using a timer
* Improve TAB key behavior in property editor
* Add context menu to show hidden properties, change property status,
set expression on any and property, and add/remove dynamic properties
* Optimize expression completer model construction, as the original
implementation gets prohibitively slow for moderate number of objects.