The tree can change shape during handling the mousePressEvent() event,
because some part of the tree can be (un)folded. This might lead to
shift of the three (up or down). The position of items in tree change
relatively to the position of mouse (which stays in place).
If the visibility click is handled after mousePressEvent, the shift in
position can lead to cursor beeing over visibility icon and the click
is handled like if the visibility icon vas clicked, which is unexpected.
Handling the visibility click first fixes this. The setAccepted(true),
was removed, it is left to the subroutine to set it.
The gui texts for "Show description" and "Show internal name" were inconsistent.
"Show description column" -> "Show description"
"Show an extra tree view column for item description. -> "Show a description column for items."
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#78421604Fixes: #13760
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.
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.
* 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>
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.