Commit Graph

310 Commits

Author SHA1 Message Date
Kacper Donat
5d43908edc Merge pull request #22916 from kadet1090/all-string-changes
All: Update UI strings for consistency
2025-08-05 01:20:35 +02:00
Max Wilfinger
6692dacc0a Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
B0cho
8b6fc1ec57 CORE: Tree context menu upgraded with 'Std_ToggleSkipRecompute' 2025-07-15 22:12:22 +02:00
Benjamin Nauck
a6485d1ae1 Gui: Use middle elide for text in model tree 2025-06-20 22:37:37 +02:00
tetektoza
4c1e7835bd Core: Add guard in Tree to ensure we don't process items during deletion 2025-06-17 00:15:49 +02:00
tetektoza
9a9242817d Core: Fix crashes during item deletion in specific selection order
This patch fixes crashes that we've noticed during migration from Qt5 to
Qt6 in recent months.

If you select items in a tree in a specific direction or range (all, or
from bottom to top) and delete them, there is a high change user will
experience a crash in `testStatus` function. This problem arises because
we're getting into use-after-free situation.

Looking at the callstack there are a lot of calls to
`itemSelectionChanged` during deletion, which takes over item creation
after deletion in `TreeWidget::_slotDeleteObject`. This in turn causes
`DocumentObjectItem::testStatus` to be called prematurely when we have
dangling pointers in object map still. `itemSelectionChanged` signal is
being transmitted because the selection range is changing as we're
constantly deleting and readding certain items.

Previously there was `blockSelection` call during deletion, but it turns
out the signals can still be emitted even AFTER we delete the item. This
had to somehow change between Qt5 and Qt6. So, to be safe, move the
signal block for selection before the obj deletion loop to be sure we
won't retransmit this signal during an uncertain state.
2025-06-17 00:01:24 +02:00
dzid26
3ebe4b4264 Block preselect on selection 2025-06-05 12:18:41 -05:00
wmayer
5cbeef9b33 Gui: Fix TreeWidget::addDependentToSelection
Avoid stack overflow for cyclic dependencies.

This fixes issue 20859
2025-05-31 19:41:50 +02:00
Ladislav Michl
487542185d Revert "[Gui] Fix "Select dependent objects" with cycles"
This reverts commit 01effaaab0.
2025-05-31 19:39:11 +02:00
Chris Hennes
952485dcbb Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
2b1aec0041 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
df3c324b7d Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
Kacper Donat
ef357aa07a Gui: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
Pieter Hijma
c16935dce4 [Gui] Fix "Select dependent objects" with cycles
Doing "Add dependent objects to selection" in the context menu of an
object that has cyclic dependencies triggered an infinite recursive
loop.  This has been solved by using the function to get an outlist
recursively.
2025-04-22 17:23:38 -03:00
Chris Hennes
e2c2017df5 Merge pull request #20649 from pieterhijma/viewprovider-toggle-visibility
[Core] Allow setting visibility toggling in the ViewProvider
2025-04-14 10:45:14 -05:00
Kacper Donat
77e40b9747 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Kacper Donat
9d97d1c895 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Pieter Hijma
0d5481e448 [Core] Add visibility toggling to ViewProvider
With this extension of the API, view providers can indicate whether
document objects should be able to be toggled for visibility.  There is
both a C++ and Python interface, idiomatic for FreeCAD code.
2025-04-05 15:57:09 +02:00
captain0xff
887cbd0e1a remove some code setting pixel density ratio for pixmaps
update
2025-04-03 19:55:27 +05:30
bofdahof
cb5caf6765 Gui: apply std::ranges 2025-03-16 17:15:14 -05:00
Chris Hennes
1a2070c36f Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Kaung Zin Hein
0b2610f1af Gui: "Open File Location/Reveal in Finder" in Tree view (#19805)
* Add: barebone openFileLocation on linux
* Feat: Add handling for different types of os
* Fix: Use preprocessors
* Fix: directive typo

---------

Signed-off-by: Kaung Zin Hein <83657429+Zen-cronic@users.noreply.github.com>
2025-02-24 10:15:28 -06:00
Kacper Donat
13fbab9e42 Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
2025-02-17 21:10:26 +01:00
Benjamin Bræstrup Sayoc
8d2d0a47f4 Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Benjamin Nauck
6f535f19fb Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
xtemp09
96f7a2804e Fix arrow navigation in TreeWidget
Closes #10488. This commit removes the code fragment that "swallowed"
the key press events.
2025-01-24 06:51:52 -06:00
xtemp09
a07d18ca7f Prevent selection of an item in TreeWidget when user presses an eye icon
Closes #18922
2025-01-19 14:35:32 -05:00
wmayer
98fdb40546 Gui: Fix copying elements in the tree view by holding CTRL key
In older versions it was possible to copy elements with drag and drop by holding the CTRL key. Since v0.20 or v0.21 this wasn't possible any
more so that elements are always moved.

Note: Copying is only allowed for elements that have a parent object.
2024-12-23 12:21:12 -05:00
Syres916
8e4e53dbae [Gui] Tree, set FontSize on start of application 2024-12-13 11:58:24 -05:00
Vincent
9ba6bc30fb Gui: allow LineEdit to grow with text - fixes #17747 (#18099) 2024-12-09 10:38:54 -06:00
wmayer
b46453648b Core: Handle possible nested calls of TreeWidget::onUpdateStatus()
Fixes #17460
2024-10-24 23:11:37 -05:00
Furgo
e9bbc75f60 Properly scale link overlays 2024-10-14 17:50:35 +02:00
Jiří Pinkava
a9d3a8eb6c GUI: Fix tree visibility click when a tree item gets collapsed
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.
2024-09-13 13:24:42 -05:00
MisterMaker
e6863d0d15 Stylesheet fixes part IV - A new hope (to be done for 1.0) (#15586)
* Qcolor dialog fixes

* Fix for white hoover on tabbar

* Changes active color and selected feature color

* update same colors in cfg

* fix for tab pan in material editor

* some fixes

mostly theme accent colors fixes.

* fixed text edit being cut off

https://github.com/FreeCAD/FreeCAD/issues/15603

* extend arrow fix

https://github.com/FreeCAD/FreeCAD/issues/15616

* checkboxes links qpushbuttons etc.

Fixed https://github.com/FreeCAD/FreeCAD/issues/15610#event-13642470770
and hopefully also
https://github.com/FreeCAD/FreeCAD/issues/15136#issuecomment-2254156398

* fixed selection-text color in the preference menu also White is white.

* forgot checkbox spacing for light

* colors update

fix for https://github.com/FreeCAD/FreeCAD/issues/15660#event-13670498420
and
https://github.com/FreeCAD/FreeCAD/issues/15620#issuecomment-2251144435

* Delete CMakeSettings.json

* get out of here

* title a tat higher

* change rubberband from white to blue to make it work with white background.

* setting the colors.

* tree colors
2024-07-29 17:31:17 -05:00
Kacper Donat
4aabd47dcd Gui: Trim tree view column only if one column 2024-07-27 20:29:42 +02:00
PaddleStroke
4769926120 Core: Tree: add canDragFromParents to reduce code duplicity. + Few small fixes 2024-07-15 17:53:02 +02:00
PaddleStroke
e6fb9f0185 Assembly: Use canDragObjectToTarget in viewProviderAssembly 2024-07-15 17:53:02 +02:00
PaddleStroke
e71351cf7d Core: Tree / ViewProvider : Add canDragObjectToTarget 2024-07-15 17:53:02 +02:00
PaddleStroke
febe4dbd8c Core: Tree.cpp: few syntax fixes 2024-07-15 17:53:02 +02:00
Max Wilfinger
8ff5a1f688 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
Roy-043
c596c8e17c Gui: Tree.cpp make some gui texts more consistent
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."
2024-06-24 11:29:05 -05:00
PaddleStroke
d8db937901 Core: Tree: Remove !vp->canDragAndDropObject(obj) that made no sense. And remove the auto switching to 'CopyAction' 2024-06-24 10:42:49 -05:00
Chris Hennes
f11af4f2a5 Gui: Silence unused variable 2024-06-22 08:29:27 +02:00
wmayer
127f935711 Fix several compiler warnings
* -Wmaybe-uninitialized
* -Wunused-parameter
* -Wunused-variable
* -Wnonnull
* -Wstringop-truncation
* -Wstringop-overflow
2024-06-19 21:14:23 -05:00
Chris Hennes
587cd884e8 Merge pull request #14388 from Ondsel-Development/core_rootObjects
Core: Add Gui::Document::getTreeRootObjects() Fixes #14373
2024-06-17 11:04:18 -05:00
Chris Hennes
f82ba8b47e Merge pull request #14393 from NomAnor/visibility-icon
Change visibility icon default to enabled and tweak visuals
2024-06-17 10:36:35 -05:00
PaddleStroke
fb32579498 Core: Add Gui::Document::getTreeRootObjects() 2024-06-12 10:57:24 +02:00
Kuzemko Alexsandr
4d5eb39762 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