Commit Graph

325 Commits

Author SHA1 Message Date
tritao
40a9f46d71 Base: Remove Boost-based signals and switch to FastSignals. 2026-01-07 21:16:16 +00:00
Yash Suthar
df93d3b61d UI: Fix select all instances of an object in the tree
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
2025-12-22 15:01:24 +01:00
Chris Hennes
02faa54b94 Revert "GUI: fix "select all instances" (#25503)"
This reverts commit 6b60867368.
2025-12-01 18:24:25 +01:00
Chris
e26ffd782a GUI: fix "select all instances" (#25503) 2025-11-26 14:20:23 -06:00
pre-commit-ci[bot]
799d7bada8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-20 16:31:00 +00:00
Syres916
b7fb8ed4bf [Gui] Fix string encoding document name and object name 2025-11-20 16:28:04 +00:00
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
PaddleStroke
e5a143b553 Update Tree.cpp 2025-10-27 12:16:50 -05:00
tetektoza
e74cd082ca Gui: Restore focus to tree upon deletion and move selection to next obj (#24679) 2025-10-16 13:13:08 -05:00
Chris Hennes
43fd9e2b55 GUI: Fix some translatable text (#24289) 2025-09-28 10:47:16 +02:00
Markus Reitböck
a72a0d6405 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
Pieter Hijma
e806903198 Gui: Small refactor of Tree.cpp selecting docs
Based on review comment, a small refactoring of code that was duplicated
when adding functionality to select documents.  The duplication has been
removed in this commit.
2025-09-12 10:59:17 +02:00
Pieter Hijma
ab28433b96 Gui: Disallow adding props to multiple objects
This commit is in preparation for switching the old Add Property dialog
to the Add Property VarSet dialog.  For now, this dialog does not handle
adding properties for multiple objects.
2025-09-03 10:24:54 +02:00
Max Wilfinger
3129bc9a1e Fix UI strings reported on Crowdin (#23297)
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-08-25 06:10:53 +00:00
Max Wilfinger
1850c5dc0f Fix missed strings for UI consistency
Fix ellipsis rendering
2025-08-08 06:37:59 -05:00
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