Commit Graph

259 Commits

Author SHA1 Message Date
PaddleStroke
974f57cf94 Core: Add Gui::Document::getTreeRootObjects() 2024-06-12 10:57:24 +02:00
Kuzemko Alexsandr
aca353d7c5 Displaying internal names in the tree view (#14237)
* Displaying internal names in the tree view

* Change "Hide extra column" to "Hide Description"

---------

Co-authored-by: Kuzma30 <kuzemkoa@gmail.com>
2024-06-10 11:31:04 -05:00
wmayer
d12632f2ca Fix compiler warnings 2024-06-04 17:36:10 +02:00
Kacper Donat
b840e1c992 Gui: Fix document tree background rendering with overlay (Qt6)
This aims to fix rendering of tree view items in Qt6. While I don't
belive that this is a good way to fix this, I am worried that it is the
only way to do ir.

BC BREAK: This change introduces artificial QTreeView widget that can be
targeted using QSS and can be used in the delegate for painting background of
items. `QTreeView::item` would now be used to render background for the
whole row, while each cell can be targeted using `#DocumentTreeItems`
selector.

More details on implementation:
https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604

Fixes: #13760
2024-06-03 11:28:02 -05:00
André Althaus
3d217feaa8 Fix visibility icon for link elements
The visibility of link elements must be set with setElementVisible.
This will first try to use that API otherwise it falls back to setting
the Visibility property.
2024-06-03 11:12:57 -05:00
mos
d12635246f [gui] code clean
.
2024-05-23 11:34:15 +02:00
André Althaus
a09dcd917a Gray out all columns in the tree if an item is invisible 2024-05-20 11:04:45 -05:00
PaddleStroke
344b125a07 Core: Add getRootObjectsIgnoreLinks and fix bugs in tree.cpp and AssemblyObject.cpp, CommandInsertLink.py, UtilsAssembly.py 2024-05-13 17:58:34 +02:00
Florian Foinant-Willig
219a2e0104 Fix #13107 (#13682)
Introduce a signal slot for tree item highlight change.
2024-05-13 10:42:57 -05:00
wmayer
d89bece39a Gui: Replace TreeRank property with a simple int
This fixes that copied & pasted objects are not added at the end of the tree view.
See https://forum.freecad.org/viewtopic.php?p=755532#p755532
2024-05-06 18:24:20 +02:00
wmayer
638cbd02ae Gui: Do not reset placement when reordering top-level objects
This fixes #13690: Reordering top level objects destroys the Placement
2024-05-06 18:24:20 +02:00
wmayer
8a1c3ead0f Gui: fix some linter warnings 2024-05-06 18:24:20 +02:00
farley
56b938e1de Update Tree.cpp
- Disable document activation when right-clicking
2024-05-06 17:57:15 +02:00
wmayer
4ea1ad58c8 PD: Fix crash when adding sketch to loft via tree view
The underlying problem is the method DocumentItem::updateItemSelection() where
the selection is altered. This may cause the destruction and recreation of the
DocumentObjectItems so that the passed pointer can become dangling.

The issue is fixed in two steps:
1. Add the method 'DocumentObjectItem *findItem(App::DocumentObject* obj, const std::string& subname) const'
   to safely re-access the item.
2. Add a boolean flag 'dirtyFlag' and the methods insertItem() and removeItem() to DocumentObjectData.
   This is needed to check when the iterator over the container becomes invalid.
2024-05-06 17:38:59 +02:00
wmayer
7cbb28ca53 Gui: fix computing status value and use enum to avoid magic numbers 2024-03-31 10:59:00 +02:00
ppphp
da7ee06d67 fix: c++20 deprecate [=] 2024-03-31 10:47:32 +02:00
Max Wilfinger
6ca8b2daae update hardcoded XPMs to .svg files. Updated .svg icons for clarity. 2024-03-30 11:25:13 +01:00
luzpaz
5839134e95 Fix various typos throughout the codebase (#13029)
* Fix various typos throughout the codebase

* [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-03-18 16:54:30 -05:00
André Althaus
2224d87e6e Fix #12780: An additional visibility icon is shown for features in groups
The icons in the testStatus() function are taken by reference and modified
inside. This seems to be used for caching when the same item occurs
multiple times in the tree. This can be the case for groups.

The visibility icon was added without taking the cached icon into
consideration and so it was added a second time.
The code is now moved into the if statement checking for this case.
2024-03-11 12:23:04 -05:00
Florian Foinant-Willig
f633fa476a Introduce object freeze (#12580)
* Introduce object freeze

* do nothing at property change
2024-03-04 17:54:25 +01:00
PaddleStroke
d74eb1439a Remove warning in Tree.cpp from 12293 2024-02-27 10:22:30 +01:00
Chris Hennes
d144e85a34 Merge pull request #12412 from FlachyJoe/suppressibleExt
Core: Create a SuppressibleExtension to provide the Suppressed property to all the WBs
2024-02-26 10:53:46 -06:00
Chris Hennes
717525c5be Merge pull request #12298 from NomAnor/visibility-icon
Add an icon to toggle the visibility of items in the tree view
2024-02-26 10:45:07 -06:00
PaddleStroke
ee0c55703f Core: Tree: Allow reordering in root and groups allowing it (parts, groups 2024-02-26 10:42:21 -06:00
André Althaus
5aacd52ed8 Add a new preference for the visibility icons
Add a preference to Display->UI that allows the user to choose if
the visibility icons are shown in the tree view.
2024-02-21 19:28:28 +01:00
André Althaus
15944bb079 Add a function to recalculate the icons for use when the visibility icon preference changes 2024-02-21 19:25:13 +01:00
André Althaus
47bbc1f6af Toggle visibility when clicking the visibility icon
If the visibility icon is enabled a mouse press on that part of the icon
toggles the visibility of the tree item.
2024-02-21 19:25:13 +01:00
André Althaus
e7665f523f Add visibility icon
Prepends the visibility icon to the normal icon if enabled and uses
the result as the new icon.
2024-02-21 19:25:12 +01:00
Florian Foinant-Willig
5a22009217 Add SuppressibleExtension 2024-02-21 16:19:32 +01:00
Paddle
cce2c24262 Core: tree: prevent object replacement when dragging 2024-01-22 10:53:47 -06:00
Paddle
2bf3639fb5 Core: PropertyEditor : save properly the size of the first column. 2024-01-19 10:49:33 +01:00
Paddle
3136bd6fcc Core: add property command, that shows property view. 2024-01-19 10:26:00 +01:00
Paddle
10de5a19d0 Core : Tree: Add 'Properties' action in contextual menu. Opens a property dialog. 2024-01-17 17:00:55 +01:00
André Caldas
560898907b 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
552b1f48b1 Gui: fix some important linting warnings:
* cppcoreguidelines-explicit-virtual-functions
* google-explicit-constructor
2023-10-12 11:48:16 +02:00
wmayer
e37e924b85 Gui: port new code to Qt6 2023-10-12 11:48:16 +02:00
Zheng, Lei
bf9584a90b Gui: add support for transparent overlay docking widget 2023-10-11 09:58:53 +02:00
Zheng, Lei
9287f94974 Gui: fix selection of nested object in App::Part 2023-10-10 14:28:26 +02:00
wmayer
56820718c5 Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
AgCaliva
39dcb1da7b Merge Master 2023-08-30 16:24:16 -03:00
wmayer
5a153e50ff Gui: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
c016f1c1fb Gui: modernize C++: use equals default 2023-08-20 18:12:43 +02:00
AgCaliva
0c4ef0e106 merge master 2023-08-08 23:29:40 -03: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
0af4990817 modernize C++: make unique 2023-08-07 19:51:30 -06:00
wmayer
2a88c7c7df modernize C++: use bool literals 2023-08-06 01:35:39 +02:00
AgCaliva
ceb4a28991 Merge branch 'master' into User/Document/Feature_level_units_selection_#7746 2023-07-02 17:45:05 -03:00
AgCaliva
816d4077df Implemented DocumentReader for GuiDocument.xml reading. Final 2023-06-30 20:50:36 -03:00
AgCaliva
0751770bc6 Revert "DocumentReader implemented for GuiDocument.xml reading."
This reverts commit 5f101af3e9.
2023-06-30 20:27:12 -03:00