Commit Graph
56 Commits
Author SHA1 Message Date
Magne Sjaastad 4d0e377964 #1136: Improve caf editors, label links and nested settings write 2026-10-19 09:40:46 +02:00
Magne Sjaastad 277322cbcb #14884 Reparent hidden field labels when rebuilding form layout
A hidden label is never added to a layout, so it stayed parented to the
group box it was created in. When the field moved directly to another
group, the old group box was deleted together with the label, and the
next update hit a null label in PdmUiCheckBoxEditor.

Add GroupVisibilityByEnum to cafTestApplication to reproduce the crash.
2026-10-09 13:31:39 +02:00
Jørgen Herje 52f9cdf777 Add Polygons data from Cloud (#14811)
Add fetch og polygons from cloud using ri-cloud-api service as submodule

Current version of submodule fetches polygons from Sumo, prodviding polygons with standard results tag.
2026-09-30 18:16:00 +02:00
Magne Sjaastad c8b1ebc266 #14505 caf: Defer group box deletion in PdmUiFormLayoutObjectEditor
The group boxes were destroyed with a raw delete, which destroys the child widgets immediately and defeats the deleteLater() used by PdmUiFieldEditorHandle to keep field editor widgets alive. When the rebuild is triggered from fieldChangedByUi(), Qt is still using those widgets further up the stack, giving a use-after-free.

Hide and detach the group box before scheduling a deferred delete, so it leaves the layout, the visual tree and the focus chain immediately. Detaching first is what plain deleteLater() did not do in issue 9719.
2026-08-11 08:36:37 +02:00
Magne Sjaastad 98ea83146a #14122 Allow tree selection editor to grow only when it is the last row
The tree selection editor can grow to a large height, which is useful when it is the last field editor in the property dialog. When other field editors are located below, the heightHint is now used as the maximum height instead. The form layout tracks whether an editor occupies the bottom-most row of the form and passes this to the editor. In the Analysis Plot, the time step selection is constrained to its height hint because other input fields are located below it.
2026-06-05 16:28:22 +02:00
Magne Sjaastad 06016d18e3 cafPdmUiButton: Add fillWidth property and expose createButton as protected
Add fillWidth() to PdmUiButton to allow buttons to expand horizontally
instead of sizing to content. Make createButton protected so subclasses
can reuse button creation logic.
2026-03-04 09:52:17 +01:00
Magne Sjaastad 526a0f0b43 Replaces direct attribute access with map-based system
Migrates UI editor attribute definitions from direct member access in `defineEditorAttribute` to a map-based system using `setAttribute`.
2026-01-08 21:44:58 +01:00
Magne Sjaastad f230998fff #13256 Framework: Make sure labels and buttons are deleted
Make sure standalone labels and buttons are deleted between multiple calls to defineUiOrdering.
2025-12-01 14:10:34 +01:00
Magne Sjaastad 760137730b #13243 Always recreate non-field labels and buttons 2025-11-28 15:49:31 +01:00
Magne Sjaastad c2c26bc7c0 Add missing clear of label and button cache 2025-10-21 12:26:30 +02:00
Magne Sjaastad 2012c003dc #13044 Add support for labels and push buttons without a Pdm field
Introduces `PdmUiLabel` and `PdmUiButton` classes to enable the addition of labels and buttons directly within the UI configuration, without requiring a bound PDM field.

This enhancement provides greater flexibility in constructing user interfaces and allows direct user interaction via button callbacks.

It also updates the `PdmUiOrdering` to support label and button components, and modifies the `PdmUiFormLayoutObjectEditor` to properly render these new UI elements.
2025-10-20 09:23:06 +02:00
Magne Sjaastad 772f7ac93c Make sure well targets are available as table editor
In 8251562cd9, logging was activated when no field editor could be created. This happens for PdmChildArray fields and PdmChildFields. A early return checking for these types was added, and caused well targets to be hidden from the property editor.
2025-09-13 20:16:42 +02:00
Magne Sjaastad 8251562cd9 Add logging to CAF 2025-09-11 13:42:56 +02:00
Kristian Bendiksen 25dd9db293 Fix critical QWidgetItem memory leak in ensureWidgetContainsEmptyGridLayout
Address sanitizer detected a 1056-byte memory leak in QWidgetItem objects.
This was the actual root cause of the leak reported in the stack trace.

Problem: In ensureWidgetContainsEmptyGridLayout(), when clearing existing
layouts, the code was calling layout->takeAt(0) to remove QLayoutItem
objects but never deleting them. This caused QWidgetItem objects to
accumulate in memory without ever being freed.

The takeAt() method removes items from the layout but does NOT delete them.
The caller is responsible for deleting the returned QLayoutItem objects.

Fix: Added `delete item;` in the cleanup loop to properly free QWidgetItem
objects when clearing layouts before rebuilding the UI.
2025-09-04 09:04:30 +02:00
Kristian Bendiksen a468e030af Fix memory leak in PdmUiFormLayoutObjectEditor detected by address sanitizer
Address sanitizer detected a 32-byte memory leak in QVBoxLayout objects
created by PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInGridLayout().

Root cause: QVBoxLayout objects were being both:
1. Added to parent layouts via addLayout() (proper Qt ownership)
2. Stored in m_layouts member vector (redundant storage)

The redundant storage prevented Qt's automatic cleanup, causing memory leaks.
2025-09-04 09:04:30 +02:00
Magne Sjaastad b7def693be Make sure all editors are hidden before deleting field editors
Hiding an editor triggers field changed, and can cause updates that requires editors to be live. Delete editors in a separate loop after all editors are set hidden.
2025-06-20 14:45:01 +02:00
Magne Sjaastad a5d010fe60 #12599 Call hide on editor to trigger cleanup
Trigger a hide event the editor to allow it to clean up. This is required to persist the changes in the editor when changing to a different dock widget.
2025-06-17 13:13:32 +02:00
Magne Sjaastad d0a9c0a820 #12119 Update the UI layout when expanded state of group is changed 2025-03-07 08:38:03 +01:00
Magne Sjaastad f031a81803 #11731 Detect when a group box have the same name as an existing group box
Detect when a group box have the same name as an existing group box. This is not currently supported, and leads to dangling group boxes in the Property Editor.

Trigger assert and crash when the situation appears.
2024-10-02 15:20:27 +02:00
Magne Sjaastad 678a368361 Refactor LayoutOptions to improve readability
* Make it possible to use designated initializer list
- remove default constructor
- move static member to outer scope

* Add helper function to add field on same row
2023-11-10 14:48:56 +01:00
Kristian Bendiksen 98796b0dd9 #10649 Fwk: Use collection.empty() instead of comparing with size 2023-09-27 10:16:37 +02:00
Magne Sjaastad 76102a8396 Maintenance issues
* Improve toggling of checked state of sub items
Toggling state is only supported for objects in an array. For example, this will ensure that faults are toggled without altering the fault result object.

* Use gray instead of black for icons

* #9719 Use delete instead of deleteLater to avoid visual artifacts
Artifacts are seen in the Property Editor related to obsolete group boxes. This seems to be related to deleteLater().

* Improve text in menu when toggling sub items

* #10011 Make sure all grid cases are visible in RFT data source

* #10354 Show more info when hovering on curves in summary plot

* #10355 Copy model text info in 3D view to clipboard

* Make sure cell filter option is propagated to new field
Make sure the previous value of  m_showFaultsOutsideFilters_obsolete is propagated into m_applyCellFilters

* Fix wrong spelling when using of stylesheet color
2023-06-06 15:45:54 +02:00
Magne Sjaastad f2fa0ad024 9939 Temporary fix for crash situation
Crash is seen on application exit
2023-03-16 14:09:39 +01:00
Magne Sjaastad 1563ae7b58 Merge pull request #8614 from OPM/minor-adjustments 2022-03-04 12:24:15 +01:00
magnesj 62eb603ed2 Fixes by clang-format 2020-12-08 21:45:26 +01:00
Magne Sjaastad bdc536dfc4 #6106 Apply clang-format on AppFwk 2020-06-19 08:00:01 +02:00
Magne Sjaastad d68e764a8f Merge pull request #5122 from OPM/timer-improvements
Timer improvements
2019-12-02 10:22:29 +01:00
Magne Sjaastad a852d1a50e #4388 AppFwk : Rename and rewrite of PdmUiFieldHandle::notifyFieldChanged 2019-05-06 11:58:06 +02:00
Magne Sjaastad 50ee79f6c3 #4388 AppFwk : Always mark field as used when editor is created 2019-05-06 11:58:06 +02:00
Magne Sjaastad 9e7467309d #4388 AppFwk : Set parent editor when field editor is created 2019-05-06 11:58:06 +02:00
Magne Sjaastad 088b5513a7 #4388 AppFwk : Remove problematic setUiField() calls
setUiField() call used to keep track of which fields that is retained when updating an editor. Replace this workflow with a set of the ones that are used, and use this set to clean up unused editors afterwards.
2019-05-06 11:58:06 +02:00
Gaute Lindkvist 72052377dc #4305 Adjust size of layouts and labels if the sizeHint has changed 2019-04-09 13:53:33 +02:00
Gaute Lindkvist 867c541b7b #4282 Improve look of Summary Plot Editor after layout changes
* In particular make the QMinimizePanel title panel fixed in size.
2019-04-05 15:42:20 +02:00
Gaute Lindkvist ffaeccf31c Make sure all groups have a new layout inside as well 2019-04-05 13:52:53 +02:00
Gaute Lindkvist 94a8c35311 #4282 Move new Grid Layout creation inside form layout object editor 2019-04-05 13:28:23 +02:00
Gaute Lindkvist cdc7a12190 #4282 Make minimum size work well for property view 2019-04-05 13:05:48 +02:00
Gaute Lindkvist 038d7a7676 #4097 Implement stretch factors for editors 2019-04-04 11:19:35 +02:00
Gaute Lindkvist 5e517e47dd Labels on top fixes 2019-04-04 08:47:36 +02:00
Gaute Lindkvist 117731a24a #4192 Add swap axis and update property editor 2019-03-12 14:34:22 +01:00
Gaute Lindkvist e00f983360 #4166 Add feature for swapping cross plot axes + tweaks to legend
* Also put x and y property side by side in property editor
2019-03-08 09:59:38 +01:00
Magne Sjaastad 5a45d37ee1 #4116 PdmUiListView: Use timer and singleShot to trigger scroll to selected item 2019-02-22 10:21:25 +01:00
Gaute Lindkvist 1536645e7c #4132 Temporarily fix contour map crash by commenting out processEvents 2019-02-22 09:06:51 +01:00
Magne Sjaastad 735bd5a4b1 Whitespace 2019-02-22 07:55:57 +01:00
Magne Sjaastad 24bda0fda2 #4116 PdmUiListView: Scroll to the first selected item when activated
This solution does not always work, but scrolls to the first selected item in most cases
2019-02-22 07:52:19 +01:00
Gaute Lindkvist 66e57890dc #4106 Stop trying to do recursive setting tab order widget
* The double pointer was handled wrongly and shift-tab order isn't working anyway.
2019-02-20 09:33:05 +01:00
Magne Sjaastad 08c3c4cb0d #4106 Crash on Linux
Temporary workaround to avoid crash
2019-02-19 09:01:51 +01:00
Gaute Lindkvist a6d29c6f96 #4090 Update fix for crash with no label editors 2019-02-15 13:16:51 +01:00
Magne Sjaastad 44334bcdc6 #4090 Property Editor : Fix crash for no label editors 2019-02-14 12:41:56 +01:00
Gaute Lindkvist fac9870c76 Rework caf Layout to work better when number of columns isn't fully specified 2019-02-11 15:48:01 +01:00
Gaute Lindkvist 64c30d00d1 #3994 Fix crash when creating valves and no valve template is present 2019-01-28 15:29:20 +01:00