Commit Graph

51 Commits

Author SHA1 Message Date
wwmayer
7b0a23337c Gui: Prepare for clang-format (#16051)
* 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>
2024-09-02 17:48:55 +02:00
bgbsww
19e450a667 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
Florian Foinant-Willig
f0437b28ce Fix SubElements selection for PropertyLinkSubList 2024-06-10 11:20:37 -05:00
Johannes Wüller
33e91421b5 Fix backwards-compatible Qt6 warnings 2024-05-13 11:39:24 -05:00
pavltom
08e18158ba Switch to correct page when changing Link property target - add comments 2024-03-04 18:00:41 +01:00
pavltom
d1ce609676 Switch to correct page when changing Link property target 2024-03-04 15:39:48 +01:00
André Caldas
89dbab9b0e Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
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.
2023-12-11 17:37:58 +01:00
wmayer
fa8978ce99 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
9b944f4f20 Gui: fix -Wclazy-connect-by-name 2023-04-05 16:23:15 +02:00
wmayer
3354fa033b Gui: move to new style connect() 2023-01-12 17:40:20 +01:00
Zheng, Lei
b141f8f491 Gui: split out TreeParams into its own source files
Auto generated using TreeParams.py
2022-12-03 17:08:17 -06:00
berniev
3877fc62c3 Gui: Single arg ctors must be explicit (PR #7369) 2022-08-24 15:06:03 +02:00
berniev
75fa455c5d Gui: Use override etc 2 2022-08-09 12:43:23 +02:00
berniev
2db561561e Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
5782a9429a Fix several clazy issues:
* Returning data of temporary QByteArray [-Wclazy-returning-data-from-temporary]
2022-07-25 00:19:41 +02:00
wmayer
85bd6b5c6b Fix several clazy issues:
* C++11 range-loop might detach Qt container [-Wclazy-range-loop-detach]
2022-07-24 23:48:37 +02:00
wmayer
25483b78be Fix several clazy issue:
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
2022-07-24 22:29:06 +02:00
Zheng, Lei
f0e46ff71c App/Gui: Fix auto checking 'Sync sub object' if property link editor
Related FreeCAD/FreeCAD#6672 case C
2022-04-10 14:31:25 +02:00
wmayer
c84c2fb6eb Gui: clean-up Selection API
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.
2022-04-09 23:07:02 +02:00
wmayer
0b2c73cf32 Gui: clean-up Selection API
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
2022-04-09 17:03:43 +02:00
Chris Hennes
5df3dbae6f Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
e28f2a0c47 Qt: remove some more leftovers of Qt4 2022-03-19 23:27:28 +01:00
Uwe
70decbebf5 [Gui] DlgMacro etc.: remove unused includes 2022-03-16 23:41:14 +01:00
wmayer
b78dc894e1 Core: Fix several coverity issues:
* CID 350582: Big parameter passed by value
* CID 350639: Big parameter passed by value
* CID 305234: Uncaught exception
* CID 316529: Uncaught exception
* CID 350597: Uncaught exception
* CID 350623: Uncaught exception
* CID 332690: Uncaught exception
* CID 332700: Unchecked return value
* CID 350576: Uninitialized scalar field
* CID 350587: Uninitialized scalar variable
* CID 192606: Uninitialized scalar field
* CID 332699: Uninitialized pointer field
* CID 350561: Dereference null return value
* CID 350610: Dereference null return value
* CID 350567: Dereference after null check
2022-03-13 13:53:32 +01:00
wmayer
1cbecdf122 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Uwe
a8c912d6f8 [App] Expression and Extension: remove unused includes 2022-02-25 18:06:57 +01:00
wmayer
a6838cf58f Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
Benjamin Nauck
67f21d663d Gui: Add support for selecting multiple objects without keyboard
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.
2021-02-03 21:51:56 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
a7f894d2e8 Gui: several fixes for expression search box:
+ 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
2020-09-13 18:35:46 +02:00
Zheng, Lei
49150836bd Gui: allow change ExpressionCompleter filter mode
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
2020-09-13 18:35:02 +02:00
Zheng, Lei
3961f2d96d Gui: fix property link editor for PropertyLinkSubList 2020-06-03 14:34:20 +02:00
donovaly
ec05b7a135 DlgPropertyLink.cpp: fix compilation
see https://forum.freecadweb.org/viewtopic.php?f=10&t=43298
2020-02-12 09:46:47 +01:00
Zheng, Lei
747c6bcd07 Gui: add more options to DlgPropertyLink
Support user editable sub-element column.
(Dis)allow sync sub-object 3D view selection.
2020-02-11 15:40:27 -05:00
Zheng, Lei
12690fb566 Gui: refactor link property editor
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.
2020-02-11 15:40:27 -05:00
Zheng, Lei
ac6e94d1c8 Gui: fix crash on editing PropertyLinkList 2019-08-17 15:32:50 +02:00
Zheng, Lei
8b3ef8faf5 Gui: property view related changes
* 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.
2019-08-17 15:08:33 +02:00
wmayer
31963f16c1 Fix scan coverity issues:
CID 184294: Uncaught exception
CID 183597: Unchecked return value
CID 175809: Dereference before null check
CID 175810: Logically dead code
CID 133000: Uninitialized scalar variable
CID 133001: Uninitialized scalar variable
CID 183591: Explicit null dereferenced
2018-11-13 16:47:58 +01:00
Yorik van Havre
8ea89a40e0 Select items already present in PropertyLinkList edit dialog 2018-05-16 14:58:33 -03:00
wmayer
396b1b8346 use object's inlist to filter selection in property link dialog to avoid dependency loops 2018-02-07 23:31:14 +01:00
wmayer
f9b04b1551 #3325: DlgPropertyLink as editor of Tip property 2018-01-28 22:37:03 +01:00
Yorik van Havre
9d574eb4c3 Added 'Remove link' option to PropertyLinkList dialog too 2018-01-12 13:27:34 -02:00
wmayer
4f0f3e667a improve property link dialog for multi-selection 2017-09-23 18:37:52 +02:00
wmayer
6a063778c1 property editor for PropertyLinkList 2017-09-23 18:03:03 +02:00
Yorik van Havre
7e487f0fee Small improvements to the PropertyLink editor
* The "Edit" link is now a button, same as the Placement editor
* Added a "None" entry on top of the Link dialog
2017-04-17 23:00:14 -03:00
wmayer
c10f6fdd07 fix a couple of compiler warnings 2017-01-20 22:54:10 +01:00
Yorik van Havre
c592243c78 Added a search box to the PropertyLink dialog 2017-01-20 00:03:42 -02:00
Mateusz Skowroński
f48f0f69be Qt::WFlags is obsolete in Qt5. Replace it with Qt::WindowFlags.
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:58 +01:00
Johannes Reinhardt
f722cc7bf4 fixed a few small typos 2014-05-12 14:32:27 +02:00