Commit Graph

1441 Commits

Author SHA1 Message Date
jonjenssen
9ac0d9e6db Work in progress 2024-12-19 14:35:28 +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
jonjenssen
dbea0e2593
OpenGL DPI scaling support (#11883)
Scale opengl width/height based on primary screen DPI scaling.
2024-11-15 12:12:59 +01:00
Magne Sjaastad
275526a64a Remove unused includes
Remove unused includes, mostly AppEnum.h
2024-11-04 09:54:23 +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
b0d967ff40
Preparations for quick access features
* Add tool button editor with callback support
* Guard null pointer usage
* Allow proxy field with no getter
* Remove duplicated code
2024-10-21 14:08:15 +02:00
Magne Sjaastad
ca4a7b9000
Remove obsolete code related to Qt5
* Remove bundling of openssl1.1
* Remove obsolete compile flags
* Remove use of obsolete RimCommandObject
* Use QColor::isValidColorName
QColor::isValidColor is deprecated in Qt 6.6, QColor::isValidColorName was introduced in 6.4

* Make sure debug DLLs are copied when required
* Remove Qt5 from AppFwk
* Remove obsolete copy of Qt  DLLs
2024-10-07 10:16:48 +02:00
Kristian Bendiksen
3797aa8211 Qt6: Fix usage of deprecated QApplication::fontMetrics() 2024-10-04 15:27:43 +02:00
Kristian Bendiksen
bf1c7f4b04 Qt6: Fix deprecated QVariant::type() calls.
Use recommended QMetaData::type().id() instead.
2024-10-04 15:27:43 +02:00
Kristian Bendiksen
58656f900b Qt6: string-related deprecations. 2024-10-04 15:27:43 +02:00
Kristian Bendiksen
835cf4a53c Qt6: Fix QMouseEvent.x() and .y() deprecation. 2024-10-04 15:27:43 +02: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
212f5bf5ae
Add support for Qt6 and disable Qt5
Required changes to use Qt6 and disable support for Qt5. There are still some adjustments related to Qt6 to be done, but these changes are not required to make Qt6 compile on relevant systems.

* Build system changes Qt6
* Override enterEvent
* Update QKeySequence
* QtChart changes
* Use QScreen to instepct dotsPerInch
* Add app->quit()
* Required updates for code related to QString
* Use RiaQDateTimeTools
* Required changes related to regular expressions
* Support compile on Qt  < 6.5
When version < 6.5 is found, qt_generate_deploy_app_script() is disabled. Compilation of ResInsight will work, but the install target will be incomplete.
* Octave: add missing header.
* Qt Advanced Docking: force Qt6 where both Qt5 and Qt6 is available.

---------

Co-authored-by: magnesj <1793152+magnesj@users.noreply.github.com>
Co-authored-by: Kristian Bendiksen <kristian.bendiksen@gmail.com>
2024-09-30 11:21:17 +02:00
Kristian Bendiksen
596ab564c8 Fix "nonnull asserts" warnings on gcc 13.
The C++ standard guarantees that the this pointer is never nullptr
in valid programs.
2024-09-27 14:42:53 +02:00
Magne Sjaastad
9d66e6195e
Release adjustments
* Use appendMenuItems instead of ContextCommandBuilder
* Specify RimEclipseCaseCollection menu features once
* Add function to enable up/down arrows for combo box
* Guard crash when closing project
* Improve UI for grid case ensemble
- Create a view for the first case in the ensemble
- Show case name in view title
- Enable up/down buttons to Eclipse case
* Make sure 3D views in grid ensemble are created on project load
2024-09-16 09:49:22 +02:00
Magne Sjaastad
fcec67e95e Use gray background for read only line edit 2024-09-14 15:08:15 +02:00
Magne Sjaastad
9e41db33f5 Progress: optionally call QApplication::processEvents on progress updates
Add ProgressInfoEventProcessingBlocker

Co-authored-by: Kristian Bendiksen kristian.bendiksen@gmail.com
2024-09-11 12:48:54 +02:00
Magne Sjaastad
cfc97bb615 Revert "Progress: optionally call QApplication::processEvents on progress updates."
This reverts commit eb762fd122.
2024-09-10 08:18:37 +02:00
Kristian Bendiksen
eb762fd122 Progress: optionally call QApplication::processEvents on progress updates.
Fixes the missing updates of UI when running long tasks in main thread.
2024-09-09 14:15:28 +02:00
Kristian Bendiksen
d8eb34c00d Janitor: fix memory leaks. 2024-09-02 13:58:00 +02:00
jonjenssen
0572069511
Support for loading only active cell geometry (#11624)
* Only load active cells for main grid, skip LGRs for now
* Handle wells with inactive cells
* Validate mapaxes transform before using it.
* Add log message
* Additional guarding when trying to find the geometrical location of a simulation cell
* Add extra safeguarding for init/restart file access in opm common. Only support unified restart files.
2024-08-28 18:22:57 +02:00
Kristian Bendiksen
b324fdb26b Close project if cancelling well path loading. 2024-08-16 15:46:22 +02:00
Kristian Bendiksen
9bea739252 Parallelize initial import of OSDU well path. 2024-08-16 15:46:22 +02:00
Kristian Bendiksen
0216d9b57b Remove QApplication::processEvents uses. 2024-08-16 15:46:22 +02:00
Kristian Bendiksen
bf2a852b4d Add cancellation of well path collection loading. 2024-08-16 15:46:22 +02:00
Kristian Bendiksen
6e3e0ad538 Use unique_ptr for data loaders. 2024-08-14 11:32:07 +02:00
Kristian Bendiksen
2651ca91b6 Add well log loaders. 2024-08-14 11:32:07 +02:00
Kristian Bendiksen
694d2eda66 Add background data loader framework and well path loaders. 2024-08-14 11:32:07 +02:00
Magne Sjaastad
33ffa10ec9
Janitor: Remove obsolete deleteChildren
Remove obsolete deleteChildren() in destructors. deleteChildren() is called in the destructor of PdmChildArrayField
2024-07-25 13:58:31 +02:00
Magne Sjaastad
337584025c Add convenience function to set number format to fixed with two decimals 2024-07-24 15:42:25 +02:00
Magne Sjaastad
d751ce4ce0 Add flag to control display of check boxes 2024-07-05 12:47:54 +02:00
Magne Sjaastad
ef8b0836bf Improve handling of read only fields 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
33646b33f5 #11522 Convert to plain text when pasting from clipboard 2024-06-19 07:45:51 +02:00
Magne Sjaastad
a0ebb6e496
Add copyObject to PdmObjectHandle
New syntax to copy an object

    auto curveCopy = curve->copyObject<RimSummaryCurve>();

Previous deprecated syntax

    RimColorLegend* customLegend = dynamic_cast<RimColorLegend*>(
            standardLegend->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
2024-06-14 17:18:28 +02:00
Magne Sjaastad
13532b0fe4 Add partial specialization for float and double
In PdmFieldWriter::writeFieldData, the numeric values are converted to string with a selected precision. isEqual() is used when comparing values for field editors in PdmFieldUiCap<FieldType>::valueOptions()
2024-06-12 09:35:28 +02:00
Magne Sjaastad
41d5e498d7 Simplify PdmDocument class and move fileName to private
Remove resolveReferencesRecursively() and initAfterReadRecursively() from PdmDocument::readFile(). These functions will be called in RiaApplication::loadProject after the file paths modifications are done. This will ensure that file paths can be used in initAfterRead() functions.
2024-06-05 14:35:01 +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
4617bcc673
11402 Save copy of project file to a backup database when saving project file 2024-05-01 09:46:22 +02:00
Kristian Bendiksen
3255b649ca #11072 Refactor: remove homemade atomic counter.
std::atomic was introduced in C++11, and provides same functionality in
platform-independent way.

Fixes #11072.
2024-04-17 15:41:15 +02:00
Magne Sjaastad
c759a11888
Cmake cleanup and selected Qt6 adjustments
- Avoid warning using newer CMake by removing obsolete cmake requirements in sub projects
- Several adjustments preparing for Qt6
2024-04-17 15:06:51 +02:00
Magne Sjaastad
030688cff6
Several adjustments related to Qt6
* Avoid ambiguous definition during unity build on Windows
* Add missing include
* Add Qt6 to expressionparser
* Add Qt6 to nightcharts
* Replace forward define of QStringList with include <QStringList>
* Use toMSecsSinceEpoch
* Use setContentsMargins
2024-04-16 14:22:15 +02:00
Kristian Bendiksen
bce4dcfe54 #11310 Fix assert on single cell model.
Well pipe radius would become HUGE_VAL due to off-by-one error.
The assert could only happen on model with a single cell.

Fixes #11310.
2024-04-05 14:26:57 +02:00
Eirik Marthinsen
29d991159b AppFwk: Move include of windows.h to top of file
The include was located in the middle of a file inside a namespace caf
block and lead to ambiguous symbols when compiling with unity build and
Qt6. It is also considered good practice to have includes at the top.

The pragma warning disable is also removed as the warning seems to be
gone (and none of the other windows.h includes have it).

Closes #11327
2024-04-05 14:20:00 +02:00
Magne Sjaastad
ef637e3053
Move stream operator from AppEnum header
This PR will reduce the compile time of code using AppEnum. 

* AppEnum: Move QTextStream operator to avoid include of QTextStream
* Avoid use of iostream in cafAssert
rator to avoid include of QTextStream

Include file profiling shows that include of QTextStream is a performance issue. Create a non-templated base class for AppEnum. Implement the QTextStream operator for this interface.
2024-03-25 15:14:04 +01:00
Magne Sjaastad
76df7e8631 Remove unused function 2024-03-13 08:51:30 +01: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
ea27e952f5
Prepare building with Qt6
* Fwk: Switch from delta to angleDelta for QWheelEvent
* Fwk: Add option to build more libraries with Qt6
* Fwk: Remove unused includes of QtOpenGL
* Fwk: Don't forward declare QStringList
* Fwk: Store cursor position in QPoint variable
* Fwk: Use QWheelEvent::position in Qt6
2024-03-06 08:32:27 +01:00
Magne Sjaastad
818c5c0f9c
Add polygon file readers and make sure UI items are in sync
* Add polygon reader for POL file format
* Add CSV import
* Add helper function to create tag with color and text
* Show polygon color as tag, allow color edit by clicking on tag
* Support optional header in csv file
* Add Reload on polygon file
* Show warning icon if no polygons
* Improve logging text
* Do not show file polygon in view if no polygons are imported
* Use appendMenuItems
* Set default polygon color to orange
* Enter edit state when creating a new polygon
* Fix missing UI text in menu builder
2024-03-01 14:59:14 +01:00
jonjenssen
86c33c1b46
Fault activation: node adjustments along fault (#11235)
Make sure same thickness vectors and fault lines are used for both parts.
2024-02-27 17:05:48 +01:00