Commit Graph
80 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 97ed4a5145 caf: Replace editor attribute classes with attribute map keys 2026-10-17 13:23:22 +02:00
Kristian Bendiksen cf5a0c5227 #10988 Fix QItemSelectionModel warning when exiting application
The tree view in PdmUiTreeSelectionEditor is deleted using deleteLater(),
while the models are children of the editor and are deleted immediately.
Detach the view from the models in the destructor, otherwise pending events
in the view may operate on a selection model whose model has been destroyed.
2026-07-27 09:01:10 +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 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 bd8a5452bc #12454 Do not create option items that are not available in valueOptions
Do not create option items if the list is empty and the field contains a selection. This is different to other editors, but can cause a crash situation.
2025-05-06 13:44:36 +02:00
Magne Sjaastad 533885239d #12075 When activating an item, also select the item 2025-01-19 16:18:45 +01:00
Magne Sjaastad 494175d1e6 Extract creation of QShortenedLabel and add context menu
Create an intermediate class used to create a QShortenedLabel. If field is scriptable, add a context menu to support copy of the Python field name to clipboard.
2024-11-25 09:42:12 +01:00
Magne Sjaastad 2814b92055 Qt6: Adjustments (#11804)
* Qt6: Avoid insertWidget, use addWidget
In Qt6, the insertWidget function checks if the index parameter is valid based on current widgets present in the layout. This is error prone, and use addWidget to avoid manual counting of index.

* Disable use of Qt keyword foreach

* Replace use of QRegExp with QRegularExpression
Replace use of QRegExp with QRegularExpression
Remove dependency on qt5compat module
Simplify an expression based on review

* Remove Qt5 ifdefs

* Guard access out of bounds seen in debug build

* Avoid reuse of string variable

* Disconnect all signals from the QOpenGLContext
The call stack when this assert happens indicates that there are more signals to be disconnected from the object. Crash is fixed by disconnecting all signals.

Assert seen in debug build:

ASSERT failure in caf::Viewer: "Called object is not of the correct type (class destructor may have already run)", file C:\Qt\6.6.3\msvc2019_64\include\QtCore/qobjectdefs_impl.h, line 130

* Fix issue related to delete of a linked view
Guard null pointer use in view linker. Remove complicated cleanup in destructor in Rim3dVew.
2024-10-28 13:09:18 +01:00
Magne Sjaastad d751ce4ce0 Add flag to control display of check boxes 2024-07-05 12:47:54 +02:00
Magne Sjaastad c75ba450ce Tree Selection Editor: If no option items are present, use field value as options 2024-07-05 12:47:54 +02:00
Magne Sjaastad 1d57b9032b Custom vfp plot (#11450)
* AppFwk: When clearing a tree selection, make sure all values are cleared
* Fix deprecated implicit lambda
* Add support for using the closest value in addition to exact match
* Add table data source object and add plot with multiple data sources
Delete the temporary RimVfpDeck class
Add RimVfpTable to represent a table in a data source
Add plot able to show data from multiple tables

* AppFwk: Make it possible to call resolveReferences multiple times
Use case: Vfp tables are stored in files. Multiple tables can be present in one file. Pdm table objects are created after resolve references is done as part of parsing file. When the Pdm object are created, resolveReferences can be called once more.

* Call resolveReferencesRecursively() after RimVfpTable objects are created
2024-05-29 12:55:45 +02:00
Magne Sjaastad bfda6519db Cleanup includes
Use new tools in Visual Studio to help cleaning up includes and remove redundant includes.
2024-03-07 19:45:43 +01:00
Eirik Marthinsen 5cfabbb8b8 Use correct qt version check for SkipEmptyParts
Qt::SkipEmptyParts was introduced in Qt 5.14 and QString::SkipEmptyParts
was deprecated in Qt 5.15. This will avoid warnings when compiling with
Qt 5.15.
2024-02-15 09:48:34 +01:00
Magne Sjaastad d10254933c #11140 Fix filtering based on text in tree selection editor 2024-01-30 14:34:33 +01:00
Magne Sjaastad 2c02d61846 Use QRegularExpression instead of QRegExp 2024-01-07 18:28:36 +01:00
Magne Sjaastad 34d83efaed #10417 Use radiobuttons for single selection in lists 2023-06-26 10:17:47 +02:00
jonjenssen f17c02ce86 Add step support to range text format (#10311)
* Add step support to range text format
* Add step support to integer selection filter
2023-05-26 08:59:13 +02:00
Magne SjaastadandJørgen Herje 40080a99de 9978 Improve UI for long drop-down lists, use tree selection more
* Improve tree selection editor
- always call defineEditorAttributes
- use heightHint in editor attributes 
- use tree selection editor as default editor for std::vector

* Use tree selection editor instead of list selection editor
List selection editor must be used when editing std::vector<cvf::vec3d> and similar. Replace other use of list selection editor with tree selection editor.

* Set checked state based on text string for integer only models
For models with only integer values, use text string to define the items to be selected. The full list will always be visible, and the checked state will be updated when editing the filter text.

Example: "1, 5-7" will set items 1, 5, 6, 7 checked and all other items unchecked

* Minor fixes
- Set placeholder text after content is added (to ensure correct data type)
- Fix check of integers. `canConvert<int>()`returns true for both QString and int. Thus convert to string and then check for int conversion.

* Activate filtering when unchecking all items in list with only integers
- Reactivate filtering when uncheck of all items for a list with only integer values (to keep consistency between filter and list)
- Update function name for clarity

---------

Co-authored-by: Jørgen Herje <jorgen.herje@ceetronsolutions.com>
2023-05-22 15:44:37 +02:00
Jørgen HerjeandMagne Sjaastad 342f191288 Add filtering/exclude of rows in SummaryTable (#10193)
- Add selector for excluding rows in table
- Row selection is based on category, vector, threshold
- Move data containers to utils class
- TreeSelectionEditor: Add context menu to invert selection
- Improved naming of menu items
- Guard plotDefinition before connect signal/slots

---------

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
2023-05-02 11:18:45 +02:00
Magne Sjaastad f0ce04597d Merge pull request #8985 from OPM/8926-remove-useoptionsonly
AppFwk : Remove obsolete useOptionsOnly
2022-05-29 13:01:27 +02:00
Magne Sjaastad 3c07989c51 Janitor : Remove obsolete code related to Qt 4 2021-02-22 13:37:05 +01:00
Magne Sjaastad bdc536dfc4 #6106 Apply clang-format on AppFwk 2020-06-19 08:00:01 +02:00
Magne Sjaastad 001afc33dd AppFwk : Allow text filter in single selection mode 2020-03-30 08:57:59 +02:00
Gaute Lindkvist 03ff43237d Add a view id tag to project tree and tooltip
* Remove it from property editor
2019-11-05 11:09:18 +01:00
Magne Sjaastad daf4132dec #4744 AppFwk : Auto scroll to first checked item 2019-09-20 14:19:26 +02:00
Magne Sjaastad a9080e14c3 #4722 AppFwk: Rename 2019-09-20 09:54:10 +02:00
Magne Sjaastad cba51615d8 #4722 Summary Plot Editor : Update current item in tree view
Make sure the current selected item in the tree view is updated with the value in the underlying field.
2019-09-20 09:44:26 +02:00
Gaute Lindkvist 4e92a7e44a More consistent naming for Qt-derived classes in CAF 2019-04-08 14:24:43 +02:00
Gaute Lindkvist a8e14e9f9a Fix copyright header and namespace for cafShortenedQLabel 2019-04-05 17:31:07 +02:00
Gaute Lindkvist 6a2e81ca4b #4282 Add a new cafShortenedQLabel class that provides a label that shortens itself when space is limited 2019-04-05 13:05:14 +02:00
Gaute Lindkvist 038d7a7676 #4097 Implement stretch factors for editors 2019-04-04 11:19:35 +02:00
Gaute Lindkvist 925747b9d4 Fix warnings about QStyleFrameOptionsV4 2019-03-14 09:50:58 +01:00
Magne Sjaastad b15f58b560 #4083 Summary : Do not change selected summary type when unticking a checkbox 2019-02-17 10:49:47 +01:00
Magne Sjaastad 65ee55c96d #3944 clang-tidy : Apply clang-tidy on caf 2019-01-11 08:14:53 +01:00
Gaute Lindkvist 01e4454d85 Revert "#3751 Fix keyboard selection in Summary Plot Editor"
This reverts commit ab0fa2fb19.

* This change should never have been merged back into the repo.
2018-11-30 09:22:01 +01:00
Gaute Lindkvist 40f466fb0c #3751 Fix keyboard selection by overriding keyPressEvent and emitting clicked() 2018-11-26 08:01:54 +01:00
Gaute Lindkvist ab0fa2fb19 #3751 Fix keyboard selection in Summary Plot Editor 2018-11-23 15:36:33 +01:00
Gaute Lindkvist 2cf5357a47 #3738 Active correct item when clicking in Summary Plot Editor 2018-11-23 15:11:23 +01:00
Magne Sjaastad 764fb65e8e clang-tidy : Remove redundant 'virtual' and add 'override'
clang-tidy : Remove redundant 'virtual' and add 'override'
2018-10-18 16:35:51 +02:00
Gaute Lindkvist fcda0b9755 Remove padding to the left in TreeSelectionEditor if the tree doesn't have grand children. 2018-10-02 08:46:24 +02:00
Gaute Lindkvist 8c5e538f01 Implement a way for editors to fit the label to the field. 2018-09-27 16:07:35 +02:00
Magne Sjaastad 6aa234cc9b AppFwk : Fix several warnings 2018-09-13 09:01:05 +02:00
Gaute Lindkvist d13a52a8b4 #3058 Implement a memory cleanup dialog for GeoMech data. 2018-06-19 12:20:21 +02:00
Magne Sjaastad 17ee25d0b2 AppFwk : Rename to uiField() and setUiField() 2018-06-15 14:22:03 +02:00
Magne Sjaastad 3239c66f54 AppFwk (clang-tidy) : modernize-use-nullptr 2018-02-18 18:05:08 +01:00
Magne Sjaastad 81129302f3 #2266 AppFwk : Add editor attribute setCurrentIndexWhenItemIsChecked
Fix bug when a selection is active
2017-12-14 16:03:14 +01:00
Magne Sjaastad 3dadef4c76 #2197 AppFwk : Add supporft for placeholder text (taken from Qt 4.7)
PlaceholderLineEdit is a temporary class to be removed when Qt is upgraded
2017-12-11 09:12:31 +01:00
Magne Sjaastad 2c4b1e453d #2197 Rollback : placeholderText was introduced in Qt 4.7 2017-12-08 16:52:31 +01:00
Magne Sjaastad f5b5b8ff89 #2197 Summary Plot Editor : Add hint to user when a filter field is empty 2017-12-08 14:39:04 +01:00