Commit Graph

30 Commits

Author SHA1 Message Date
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
tetektoza
908941f2d1 Core: Add a possibility to extract active object based on extension 2025-06-22 23:48:52 +02:00
Kacper Donat
ef357aa07a Gui: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
tritao
551c2e48fb Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
wmayer
62d504d0a1 Core: Fix crash in ActiveObjectList
Forum: https://forum.freecad.org/viewtopic.php?t=91823
2024-11-28 17:15:39 +01:00
Zheng, Lei
b27625a639 Gui: deduce object path when setting active object 2023-12-17 21:27:25 +08:00
André Caldas
89dbab9b0e 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
Zheng, Lei
b141f8f491 Gui: split out TreeParams into its own source files
Auto generated using TreeParams.py
2022-12-03 17:08:17 -06:00
luz paz
52764d93f5 Gui: fix header uniformity
Make uniform all Gui/ directory headers.
2022-11-28 08:39:38 -06:00
wmayer
0b2c73cf32 Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
1a9493d937 [Gui] ActiveObjectList etc.: remove unused includes 2022-03-03 02:08:19 +01:00
wmayer
503a2ff6cd Gui: [skip ci] improve whitespaces 2021-10-20 22:33:50 +02:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
1b2a7ef6fc PVS: V547 Expression is always true/false 2020-07-18 10:59:27 +02:00
luz.paz
04ba2872f0 src/Gui: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Gui` files
2019-12-25 11:39:17 +01:00
wmayer
f14371bc06 convert enum to enum class to fix -Wgnu-redeclared-enum 2019-11-13 22:39:27 +01:00
Zheng, Lei
959ec5dad3 Gui: remove FC_TREEPARAM, add document for class TreeParams 2019-09-27 15:49:42 +02:00
wmayer
9fa56345cf core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
Zheng, Lei
fdf7adb6e1 Gui: ActiveObjectList API changes
Support sub-object in ActiveObjectList. This means that it can now
distinguish the same object being activated under different parent,
which may be in a different document through external linking.
2019-08-17 15:08:34 +02:00
wmayer
1308a02c83 when restoring object then only expand single items, not its parent items 2019-02-24 00:37:53 +01:00
wmayer
4e3b929fc8 auto-expand/collapse a tree item when activating it 2018-09-10 15:47:48 +02:00
wmayer
6e697ddebf Gui: Better visualization of the Active Object 2018-08-19 18:14:06 +02:00
wmayer
dc74f02fad + improve whitespaces 2016-05-22 18:44:49 +02:00
DeepSOIC
f873a24b84 PartDesign (core): fix inability to deactivate active object
It was impossible to deactivate active object (Part or Body) with:
Gui.ActiveDocument.ActiveView.setActiveObject("pdbody",None)
2016-05-21 01:31:06 +03:00
Mateusz Skowroński
b6bace2cc4 Fix files encoding. Go from ISO8859-1 to UTF-8. 2016-04-15 10:22:08 +02:00
Stefan Tröger
982af48e86 make new document views obey the scene graph children stacking 2016-04-12 18:12:08 +02:00
blobfish
7d4a0c9555 Gui: ActiveObject: remove upon delete
Squashed with:
Gui: MDIView: connection bug.
Gui: MDIView: forgot disconnect.
2016-04-12 18:12:04 +02:00
jriegel
d7c932d714 Changing active object handling in PartDesign 2016-04-12 18:12:03 +02:00
jriegel
8cd51ade8b Active object manager for the Viewer 2016-04-12 18:12:03 +02:00