Commit Graph

5273 Commits

Author SHA1 Message Date
Florian Foinant-Willig
54fdeb4ba9 Core: Fix unselectable area in SoDatumLabel 2024-03-11 12:24:00 -05:00
André Althaus
570c2b121f Fix #12780: An additional visibility icon is shown for features in groups
The icons in the testStatus() function are taken by reference and modified
inside. This seems to be used for caching when the same item occurs
multiple times in the tree. This can be the case for groups.

The visibility icon was added without taking the cached icon into
consideration and so it was added a second time.
The code is now moved into the if statement checking for this case.
2024-03-11 12:23:04 -05:00
wmayer
aa58cef2f9 Gui: Fix using context-menu of ExpressionLineEdit
If for the DlgExpressionInput the user config parameter 'NoSystemBsckground' is set to True it's not used as a normal dialog but as a pop-up window.
In this mode the context-menu of the ExpressionLineEdit isn't working. A previous commit (2f4cec5e8a5d) fixed a crash but not this issue.

For Qt4 DlgExpressionInput has overridden the eventFilter() to handle using the context-menu but this is not working any more for Qt5 or Qt6.
Luckily, it has appeared that with Qt5 and Qt6 it works out-of-the box now and the event filter is not needed any more.
2024-03-11 16:04:00 +01:00
xtemp09
4d0c607c07 Fix the crash described in #12785
Closes #12785. The cause of the segmentation fault is access to the
already deleted _QMenu_. Simple setting attribute `Qt::WA_DeleteOnClose`
and removal of `delete menu` prevented it. To reproduce the crash, one
needs to mess up the `user.cfg` file in the way described in the issue.

Here is the fragment from the issue to mess up the `user.cfg` file:

```xml
<FCParamGroup Name="Expression">
<FCText Name="EditorTrigger">=</FCText>
<FCBool Name="AntoHideEditorIcon" Value="1"/>
<FCBool Name="NoSystemBackground" Value="1"/>
<FCInt Name="EditDialogBGAlpha" Value="1"/>
<FCInt Name="EditDialogWidth" Value="300"/>
<FCInt Name="EditDialogHeight" Value="214"/>
<FCInt Name="EditDialogTextHeight" Value="35"/>
</FCParamGroup>
```

---

This commit changes also unconnected things:

- usage of `QObject::connect` instead of if statements
- relocation of a separator and an action inside the if statement (I saw
no reason to have a separator and an action for _ExpressionCompleter_ if
there is no expression completer)
- usage of asynchronous `QMenu::popup()` instead of synchronous
`QMenu::exec()`. This way is used within [the source code of Qt]
(https://github.com/qt/qtbase/blob/5.15/src/widgets/widgets/
qlineedit.cpp#L2191-L2197).
2024-03-09 16:12:47 +01:00
Chris Hennes
441d674545 Merge pull request #12066 from 3x380V/time_cleanup
Base: Use std::chrono for time manipulation
2024-03-05 15:47:33 -06:00
WandererFan
3048bd1f09 Merge pull request #12749 from pavltom/techdraw_leaderline_linking
[TechDraw] Reimplement Leader Line parent linking
2024-03-05 12:50:09 -05:00
Yorik van Havre
262a858be5 Translations (#12748)
* Updated ts files

* Merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-05 08:54:36 -06:00
wmayer
5f0ccced5b Gui: fix -Wlogical-op-parentheses 2024-03-05 08:34:19 -06:00
Ladislav Michl
57ffa2427e Base: Remove StopWatch
StopWatch is now used on single place only, remove it in favour of TimeElapsed
2024-03-05 12:30:56 +01:00
Ladislav Michl
d95b56137b Base: Implement TimeElapsed
Some instances of TimeInfo serve the sole purpose of measuring time
duration. Using system time is unfortunate as it returns wall clock,
which is not guaranteed to be monotonic. Replace such a usage with
the new TimeElapsed class based on steady clock.
2024-03-05 12:29:24 +01:00
Chris Hennes
796240392a Gui: Fix translation strings for Part, Group, and Link
Extra HTML tags were added outside the translation NOOP. They were unnecessary, and broke translation.
2024-03-05 10:38:51 +01:00
WandererFan
68f4a9624c Merge branch 'main' into techdraw_leaderline_linking 2024-03-04 15:34:48 -05:00
wmayer
26ba1c3f9b Gui: fix -Wlogical-op-parentheses 2024-03-04 11:23:09 -06:00
Bas Ruigrok
b99cd239aa Gui: Set rotation center when entering dragging in TinkerCAD style 2024-03-04 11:09:04 -06:00
pavltom
08e18158ba Switch to correct page when changing Link property target - add comments 2024-03-04 18:00:41 +01:00
Florian Foinant-Willig
c53d5fbf9d Introduce object freeze (#12580)
* Introduce object freeze

* do nothing at property change
2024-03-04 17:54:25 +01:00
LemonBoy
e43f1fb00c GUI: Follow the widget indications when docking them (#12530)
* GUI: Follow the widget indications when docking them

The overlay manager handles the creation and drawing of the title bars
for the docked widgets. When adding a QDockWidget the manager ignored
the set of features (closable, movable, floatable) provided by the
widget and always showed all the actions.

Amend the code to take into account the features specified by the
widget.

Closes #11944
2024-03-04 10:41:55 -06:00
Chris Hennes
d61597cb2d Merge pull request #12205 from Rexbas/animation-easing
Gui: Add easing to navigation animations
2024-03-04 10:37:06 -06:00
pavltom
d1ce609676 Switch to correct page when changing Link property target 2024-03-04 15:39:48 +01:00
wmayer
c1552fb590 Gui: Enable SoModelMatrixElement
The element type SoModelMatrixElement must be enabled for the node types SoHighlightElementAction and SoSelectionElementAction.
Otherwise an assert() will fail and causes a crash in debug mode.
2024-03-04 11:24:39 +01:00
Ladislav Michl
15094fadef Gui: PythonWrapper: Consolidate typeName handling
Use typeName consistently for both PySide and Python interface
code paths.
2024-03-03 15:20:48 +01:00
wmayer
d4c564efe9 Gui: PythonWrapper: Make qt_getCppType more robust
Handle gracefully possible shiboken's Python API changes.
2024-03-03 15:20:48 +01:00
wmayer
3d2c365093 Gui: PythonWrapper: Fix possible crash in qt_wrapInstance 2024-03-03 15:20:48 +01:00
Ladislav Michl
cbff393dc1 Gui: PythonWrapper: Use getPyTypeObjectForTypeName consistently 2024-03-03 15:20:48 +01:00
Ladislav Michl
92e047d886 Gui: PythonWrapper: Raise exception on qt_wrapInstance failure
When qt_wrapInstance fails it returns Py::Object with internal
pointer set to null. Make PythonWrapper::from* methods raise
exception when this happens to be consistent with PySide code path.
2024-03-03 15:20:48 +01:00
Ladislav Michl
61bca92941 Gui: Implement PythonWrapper::fromQAction
Wrapping QAction through QObject does not work as QAction class
is a part of QtGui not QtCore, so Py::Object with internal
pointer being null is returned causing a crash later.
Therefore implement fromQAction conversion method.
2024-03-03 15:20:48 +01:00
Max Wilfinger
fe70801fc2 remove code block quotes from about info 2024-03-03 12:08:12 +01:00
Chris Hennes
c4b54a94a2 Update translations 2024-02-29 17:25:46 -06:00
Rexbas
7cfb4b10e5 Gui: Add easing to navigation animations 2024-02-29 13:29:37 -06:00
Rexbas
d512d68ec4 Gui: Set default navigation animation duration to 500 ms 2024-02-29 13:29:37 -06:00
PaddleStroke
4565f052c7 Fix ViewProviderSuppressibleExtension 2024-02-27 15:05:50 +01:00
PaddleStroke
4d35f0b2a2 Remove warning in Tree.cpp from 12293 2024-02-27 10:22:30 +01:00
wmayer
f085a602bd Gui: refactor Application::runApplication 2024-02-26 11:21:38 -06:00
Bas Ruigrok
477702dfa8 Gui: Fix selection in Blender, CAD and Revit style 2024-02-26 11:21:07 -06:00
Chris Hennes
afff892b14 Merge pull request #12412 from FlachyJoe/suppressibleExt
Core: Create a SuppressibleExtension to provide the Suppressed property to all the WBs
2024-02-26 10:53:46 -06:00
Chris Hennes
c566498d8f Merge pull request #12298 from NomAnor/visibility-icon
Add an icon to toggle the visibility of items in the tree view
2024-02-26 10:45:07 -06:00
PaddleStroke
fec1a86e30 Core: Tree: Allow reordering in root and groups allowing it (parts, groups 2024-02-26 10:42:21 -06:00
mos
037fbbc5c5 removed deprecaded functions
.

.
2024-02-26 17:38:01 +01:00
Chris Hennes
641e3dbbb4 Update translations (#12557)
* Update translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-24 21:38:37 -06:00
wmayer
8d8d47df70 Gui: improve PropertyMaterialListItem 2024-02-24 23:59:58 +01:00
wmayer
190c3bf17a Gui: improve PropertyMaterialItem 2024-02-24 23:59:58 +01:00
wmayer
906e163e12 Gui: allow to set ranges for property item editors when used as sub-items 2024-02-24 23:59:58 +01:00
Ladislav Michl
282c44ead1 Gui: PythonWrapper: Do not steal reference
Foreign Python objects needs to be passed as Py::Object().
Py::asObject() is stealing reference and object might be garbage
collected even before dereferenced. Problem didn't show in the
original code because methods Py::asObject() was used in were
never called.

Fixes: 26babf4d3674 (Gui: Consolidate Python -> Qt class conversion)
2024-02-24 01:18:30 +01:00
wmayer
572a2f4243 Gui: fix linter warnings 2024-02-22 11:47:48 +01:00
wmayer
f22bfcef9b Gui: fixes #12540: ‘ModuleShiboken’ was not declared in this scope 2024-02-22 11:47:48 +01:00
André Althaus
6dda38074a Unrelated changes from automatic code generation
These are mostly comment changes.
2024-02-21 19:28:33 +01:00
André Althaus
8ed244df3f Add a new preference for the visibility icons
Add a preference to Display->UI that allows the user to choose if
the visibility icons are shown in the tree view.
2024-02-21 19:28:28 +01:00
André Althaus
65cb454559 Add a function to recalculate the icons for use when the visibility icon preference changes 2024-02-21 19:25:13 +01:00
André Althaus
d0c3b0d01a Toggle visibility when clicking the visibility icon
If the visibility icon is enabled a mouse press on that part of the icon
toggles the visibility of the tree item.
2024-02-21 19:25:13 +01:00
André Althaus
00ed73b909 Add visibility icon
Prepends the visibility icon to the normal icon if enabled and uses
the result as the new icon.
2024-02-21 19:25:12 +01:00