Commit Graph

41 Commits

Author SHA1 Message Date
Syres916
6eecd08f7c [Gui] C++ preparation for deprecation of QCheckBox…
…stateChanged -> checkStateChanged
2025-06-13 10:40:48 +02:00
Chris Hennes
dce5d9ce82 Gui: Remove default init of shared_ptr
`std::shared_ptr` default-initializes to `nullptr`, so there is no need
to do it manually, and in the current code the initialization is in the
wrong order (so generates a compiler warning).
2025-05-12 18:16:32 +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
Chris Hennes
9b1467cef3 Merge pull request #20540 from 3x380V/cleanup-schemas-management
Simplify UnitsSchemas management
2025-05-05 10:43:27 -05:00
Benjamin Nauck
a882289995 Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
Andrea
042f96ccbc Removed unused function
Removed unused function
2025-04-29 22:52:04 -05:00
mosfet80
9b9f8d1800 clean SoFCSelection.cpp
removed unused code
2025-04-29 22:49:40 -05:00
bofdahof
1155f0d752 Base: simplify UnitsSchemas management
Fixes: Maintaining schemas is difficult and error-prone

- Facilitate easy schemas add, remove, change, etc.
- Remove 14 files containing approx 2,190 lines of if/else code and data
- Place data in one file (UnitsSchemasData.h) using a normalized structure (including special functions)
- Isolate and simplify data operations (code)
- Remove schemas enum to keep data independent of code
- Separate responsibilities: Specifications, data, schemas, schema
- Add schema data 'isDefault'
- Add schema data name
- Prefer algorithms to raw loops
- Add schemas unit tests
- Tweak quantity unit tests
2025-04-27 00:45:54 +02:00
Kacper Donat
6e2583cdcd Gui: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
tritao
7d233dc95c Gui: Rename generated lexer files to match core naming pattern.
So as title says, this renames generated lexerfiles from
`SelectionFilter.l` to use the suffix .lex, instead of the
`lex.SelectionFilter.c`.
2025-04-07 22:42:07 +02:00
PaddleStroke
5639728e8a PartDesign: Fix use of App::Planes to create sketches (#20453) 2025-04-07 17:34:13 +02:00
Benjamin Nauck
17dc7fce06 Gui: Add #include <limits> where used 2025-03-31 23:50:37 +02:00
Benjamin Nauck
34bc1d45ea Gui: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
Joao Matos
74493358da Gui: Remove XML binding files. 2025-03-24 22:47:33 +01:00
tritao
7cbbe403cc Gui: Convert XML bindings to Python API bindings model.
This converts the existing XML binding files to the new Python bindings
generator model.
2025-03-24 11:56:53 -05:00
Chris Hennes
4fcdac28fb Merge pull request #19583 from hyarion/refactor/base-type
Refactor Base::Type
2025-03-17 00:03:22 -05:00
Luz Paz
17102251e5 Fix various typos 2025-03-14 12:37:12 -04: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
Joao Matos
3b05b61de2 Gui: Remove QtOpenGL.h. 2025-02-25 23:03:51 +00:00
Joao Matos
91e94ba1dd Gui: Cleanup Qt OpenGL usings in QtOpenGL.h.
Previously the code defined compatiblity usings in `QtOpenGL.h` header,
which I think was added for backwards compatiblity with previous Qt
OpenGL widgets.

As far as I can tell, this is not necessary anymore, and can be cleaned
up.
2025-02-25 23:03:51 +00:00
tritao
742627868e Gui: Fix regression in SelectionObserverPython::removeObserver. 2025-02-25 14:21:48 +00:00
Chris Hennes
c3381617f2 Merge pull request #19084 from tritao/gui-selection-viewproviderfeaturepy
Gui: Provide `ViewProviderFeaturePython` selection callbacks
2025-02-24 16:46:36 +00:00
tritao
b1a24deac6 Gui: Provide ViewProviderFeaturePython selection callbacks
Adds support for Python-based selection callbacks to
`ViewProviderFeaturePython` objects.

It follows the same conventions as `SelectionObserverPython`, follows an
example:

```python
    def setPreselection(self, document, object, element):
        print("setPreselection: %s.%s.%s"%(document, object, element))

    def removePreselection(self, document, object, element):
print("removePreselection: %s.%s.%s"%(document, object,
element))

    def addSelection(self, document, object, element, position):
print("addSelection: %s.%s.%s at %s"%(document, object, element,
str(position)))

    def removeSelection(self,document, object, element):
        print("removeSelection: %s.%s.%s"%(document, object, element))

    def setSelection(self,doc):
        sel = FreeCADGui.Selection.getSelection(doc)
        print("setSelection: %s"%sel)

    def clearSelection(self,doc):
        print("clearSelection\n")
```
2025-02-24 15:02:38 +00:00
Benjamin Nauck
8af7f1b043 Gui: Use isBad() instead of comparing types with == 2025-02-24 08:30:18 +01:00
tritao
9c0b95b569 Gui: Split SelectionObserverPython call logic into separate handler class. 2025-02-23 00:05:23 +00:00
Kacper Donat
12a69fe296 Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
2025-02-21 15:04:43 +01: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
Chris Hennes
aa76a63abf Merge pull request #19420 from tritao/gui-selection-refactor
Gui: Selection code cleanups
2025-02-10 10:56:23 -06:00
tritao
3b47599e43 Gui: Minor cleanups. 2025-02-05 22:13:07 +00:00
tritao
9e6c6682d8 Gui: Cleanup legacy code. 2025-02-05 19:19:40 +00:00
tritao
8d6775e837 Gui: Rename SoFCHighlightAction to preselect terminology. 2025-02-05 13:14:00 +00:00
tritao
0f675bb635 Gui: Rename SoFCEnableHighlightAction to preselection terminology. 2025-02-05 13:14:00 +00:00
tritao
18299a6d83 Gui: Change SoFCSelection from highlight to preselection terminology. 2025-02-05 13:14:00 +00:00
tritao
4ace865b91 Gui: Some SoFCUnifiedSelection code readability improvements. 2025-02-05 13:13:59 +00:00
tritao
b4e5614bff Gui: Change SoFCUnifiedSelection from highlight to preselection terminology. 2025-02-05 13:13:59 +00:00
tritao
ee078645d7 Gui: Document ResolveMode directly. 2025-02-05 13:13:58 +00:00
tritao
20276324c0 Gui: Cleanup SoFCUnifiedSelection::handleEvent. 2025-02-05 00:25:56 +00:00
tritao
763fc0159b Gui: Rename SoFCUnifiedSelection::selectionRole for clarity. 2025-02-05 00:25:56 +00:00
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00