Commit Graph

316 Commits

Author SHA1 Message Date
Chris Hennes
75c8749189 GUI: Fix some translatable text (#24289) 2025-09-28 10:47:16 +02:00
Markus Reitböck
6ef07bb358 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
1edacbf508 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
37e8a753b6 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
04e9baf533 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
70f4221993 Fix missed strings for UI consistency
Fix ellipsis rendering
2025-08-08 06:37:59 -05:00
Kacper Donat
b311137b74 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
ecf02b7878 Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
B0cho
62e5d0df23 CORE: Tree context menu upgraded with 'Std_ToggleSkipRecompute' 2025-07-15 22:12:22 +02:00
Benjamin Nauck
f576abd78d Gui: Use middle elide for text in model tree 2025-06-20 22:37:37 +02:00
tetektoza
fdf002df2d Core: Add guard in Tree to ensure we don't process items during deletion 2025-06-17 00:15:49 +02:00
tetektoza
5e91c90bdc 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
4b068f4b81 Block preselect on selection 2025-06-05 12:18:41 -05:00
wmayer
1307a53608 Gui: Fix TreeWidget::addDependentToSelection
Avoid stack overflow for cyclic dependencies.

This fixes issue 20859
2025-05-31 19:41:50 +02:00
Ladislav Michl
9574703b9c Revert "[Gui] Fix "Select dependent objects" with cycles"
This reverts commit 01effaaab0.
2025-05-31 19:39:11 +02:00
Chris Hennes
f5806841b6 Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
492b8312b3 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
c293d74566 Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
a882289995 Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
Kacper Donat
6e2583cdcd Gui: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
Pieter Hijma
01effaaab0 [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
7ac21c5eff 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
b300c80b90 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
35a9673a75 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
381cb92f0a [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
08381b1d18 remove some code setting pixel density ratio for pixmaps
update
2025-04-03 19:55:27 +05:30
bofdahof
e5b06ae736 Gui: apply std::ranges 2025-03-16 17:15:14 -05:00
Chris Hennes
7f1c43a335 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
df2c6637e6 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
a72a63232a 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
f647d4a1eb Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Benjamin Nauck
dd6aa9f3c7 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
c7620fd916 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
37c47ef972 Prevent selection of an item in TreeWidget when user presses an eye icon
Closes #18922
2025-01-19 14:35:32 -05:00
wmayer
9cd919d0b9 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
752b5dcf68 [Gui] Tree, set FontSize on start of application 2024-12-13 11:58:24 -05:00
Vincent
acd2cc9f79 Gui: allow LineEdit to grow with text - fixes #17747 (#18099) 2024-12-09 10:38:54 -06:00
wmayer
499d192393 Core: Handle possible nested calls of TreeWidget::onUpdateStatus()
Fixes #17460
2024-10-24 23:11:37 -05:00
Furgo
06bc18fb0f Properly scale link overlays 2024-10-14 17:50:35 +02:00
Jiří Pinkava
ede67d4b24 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
c4bb689a85 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
5326173c5f Gui: Trim tree view column only if one column 2024-07-27 20:29:42 +02:00
PaddleStroke
47a506f82f Core: Tree: add canDragFromParents to reduce code duplicity. + Few small fixes 2024-07-15 17:53:02 +02:00
PaddleStroke
6088fdaa96 Assembly: Use canDragObjectToTarget in viewProviderAssembly 2024-07-15 17:53:02 +02:00
PaddleStroke
3e2bc7ad3d Core: Tree / ViewProvider : Add canDragObjectToTarget 2024-07-15 17:53:02 +02:00
PaddleStroke
c70654733f Core: Tree.cpp: few syntax fixes 2024-07-15 17:53:02 +02:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
Roy-043
308013fb97 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
4e4201f033 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