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
This commit is contained in:
Magne Sjaastad
2024-10-07 10:16:48 +02:00
committed by GitHub
parent c75990551a
commit ca4a7b9000
40 changed files with 198 additions and 1194 deletions

View File

@@ -30,7 +30,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.h
${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.h
${CMAKE_CURRENT_LIST_DIR}/RimMimeData.h
${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.h
${CMAKE_CURRENT_LIST_DIR}/RimTools.h
${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.h
${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.h
@@ -168,7 +167,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMimeData.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.cpp
${CMAKE_CURRENT_LIST_DIR}/RimTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.cpp

View File

@@ -1,318 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimCommandObject.h"
#include "RiaApplication.h"
#include "RimCalcScript.h"
#include "RimEclipseStatisticsCase.h"
#include "RimProject.h"
#include "cafPdmObjectGroup.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTextEditor.h"
#include "cafPdmValueField.h"
#include <QFile>
CAF_PDM_SOURCE_INIT( RimCommandObject, "RimCommandObject" );
CAF_PDM_SOURCE_INIT( RimCommandExecuteScript, "RimCommandExecuteScript" );
CAF_PDM_SOURCE_INIT( RimCommandIssueFieldChanged, "RimCommandIssueFieldChanged" );
//------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCommandObject::RimCommandObject()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCommandObject::~RimCommandObject()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCommandExecuteScript::RimCommandExecuteScript()
{
CAF_PDM_InitFieldNoDefault( &name, "Name", "Name" );
CAF_PDM_InitField( &scriptText, "ScriptText", QString(), "Script Text" );
scriptText.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
CAF_PDM_InitField( &isEnabled, "IsEnabled", true, "Enabled " );
CAF_PDM_InitField( &execute, "Execute", true, "Execute" );
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &execute );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCommandExecuteScript::~RimCommandExecuteScript()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandExecuteScript::redo()
{
if ( !isEnabled ) return;
RiaApplication* app = RiaApplication::instance();
QString octavePath = app->octavePath();
if ( !octavePath.isEmpty() )
{
QStringList arguments = app->octaveArguments();
arguments.append( "--eval" );
arguments << scriptText();
RiaApplication::instance()->launchProcess( octavePath, arguments, app->octaveProcessEnvironment() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandExecuteScript::undo()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandExecuteScript::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
caf::PdmUiTextEditorAttribute* myAttr = dynamic_cast<caf::PdmUiTextEditorAttribute*>( attribute );
if ( myAttr )
{
myAttr->showSaveButton = true;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimCommandExecuteScript::userDescriptionField()
{
return &name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandExecuteScript::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( &execute == changedField )
{
RiaApplication* app = RiaApplication::instance();
app->addCommandObject( this );
app->executeCommandObjects();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimCommandExecuteScript::isAsyncronous()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandFactory::createCommandObjects( const caf::PdmObjectGroup& selectedObjects, std::vector<RimCommandObject*>* commandObjects )
{
for ( size_t i = 0; i < selectedObjects.objects.size(); i++ )
{
caf::PdmObjectHandle* pdmObject = selectedObjects.objects[i];
if ( dynamic_cast<RimCalcScript*>( pdmObject ) )
{
RimCalcScript* calcScript = dynamic_cast<RimCalcScript*>( pdmObject );
QFile file( calcScript->absoluteFileName );
if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
QTextStream in( &file );
QByteArray byteArray = file.readAll();
QString scriptText( byteArray );
RimCommandExecuteScript* command = new RimCommandExecuteScript;
command->scriptText = scriptText;
commandObjects->push_back( command );
}
}
else if ( dynamic_cast<RimEclipseStatisticsCase*>( pdmObject ) )
{
RimEclipseStatisticsCase* statisticsCase = dynamic_cast<RimEclipseStatisticsCase*>( pdmObject );
RimCommandIssueFieldChanged* command = new RimCommandIssueFieldChanged;
command->objectName = statisticsCase->uiName();
command->fieldName = statisticsCase->m_calculateEditCommand.keyword();
command->fieldValueToApply = "true";
commandObjects->push_back( command );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCommandIssueFieldChanged::RimCommandIssueFieldChanged()
{
CAF_PDM_InitFieldNoDefault( &commandName, "CommandName", "CommandName" );
CAF_PDM_InitField( &objectName, "ObjectName", QString(), "ObjectName" );
CAF_PDM_InitField( &fieldName, "FieldName", QString(), "FieldName" );
CAF_PDM_InitField( &fieldValueToApply, "FieldValueToApply", QString(), "FieldValueToApply" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCommandIssueFieldChanged::~RimCommandIssueFieldChanged()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandIssueFieldChanged::redo()
{
RiaApplication* app = RiaApplication::instance();
PdmObject* project = app->project();
caf::PdmObjectHandle* pdmObject = findObjectByName( project, objectName );
if ( pdmObject )
{
caf::PdmFieldHandle* fieldHandle = findFieldByKeyword( pdmObject, fieldName );
if ( fieldHandle && fieldHandle->uiCapability() )
{
caf::PdmValueField* valueField = dynamic_cast<caf::PdmValueField*>( fieldHandle );
CVF_ASSERT( valueField );
QVariant oldValue = valueField->toQVariant();
QVariant newValue( fieldValueToApply );
valueField->setFromQVariant( newValue );
caf::PdmUiFieldHandle* uiFieldHandle = fieldHandle->uiCapability();
uiFieldHandle->notifyFieldChanged( oldValue, newValue );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandIssueFieldChanged::undo()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimCommandIssueFieldChanged::userDescriptionField()
{
return &commandName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCommandIssueFieldChanged::childObjects( caf::PdmObject* pdmObject, std::vector<caf::PdmObjectHandle*>& children )
{
if ( !pdmObject ) return;
std::vector<caf::PdmFieldHandle*> fields = pdmObject->fields();
size_t fIdx;
for ( fIdx = 0; fIdx < fields.size(); ++fIdx )
{
if ( fields[fIdx] )
{
auto other = fields[fIdx]->children();
children.insert( children.end(), other.begin(), other.end() );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimCommandIssueFieldChanged::findObjectByName( caf::PdmObjectHandle* pdmObject, const QString& name )
{
std::vector<caf::PdmFieldHandle*> fields = pdmObject->fields();
caf::PdmUiObjectHandle* uiObjectHandle = uiObj( pdmObject );
if ( uiObjectHandle && uiObjectHandle->uiName() == name )
{
return pdmObject;
}
for ( size_t fIdx = 0; fIdx < fields.size(); fIdx++ )
{
if ( fields[fIdx] )
{
std::vector<caf::PdmObjectHandle*> children = fields[fIdx]->children();
for ( size_t cIdx = 0; cIdx < children.size(); cIdx++ )
{
PdmObjectHandle* candidateObj = findObjectByName( children[cIdx], name );
if ( candidateObj )
{
return candidateObj;
}
}
}
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimCommandIssueFieldChanged::findFieldByKeyword( caf::PdmObjectHandle* pdmObject, const QString& keywordName )
{
std::vector<caf::PdmFieldHandle*> fields = pdmObject->fields();
for ( size_t fIdx = 0; fIdx < fields.size(); fIdx++ )
{
if ( fields[fIdx] && fields[fIdx]->keyword() == keywordName )
{
return fields[fIdx];
}
}
return nullptr;
}

View File

@@ -1,108 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmObjectGroup.h"
#include "cvfObject.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RimCommandObject : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimCommandObject();
~RimCommandObject() override;
virtual bool isAsyncronous() { return false; };
virtual void redo(){};
virtual void undo(){};
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RimCommandExecuteScript : public RimCommandObject
{
CAF_PDM_HEADER_INIT;
public:
RimCommandExecuteScript();
~RimCommandExecuteScript() override;
caf::PdmField<QString> name;
caf::PdmField<bool> isEnabled;
caf::PdmField<bool> execute;
caf::PdmField<QString> scriptText;
void redo() override;
void undo() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
caf::PdmFieldHandle* userDescriptionField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
bool isAsyncronous() override;
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RimCommandIssueFieldChanged : public RimCommandObject
{
CAF_PDM_HEADER_INIT;
public:
RimCommandIssueFieldChanged();
~RimCommandIssueFieldChanged() override;
caf::PdmField<QString> commandName;
caf::PdmField<QString> objectName;
caf::PdmField<QString> fieldName;
caf::PdmField<QString> fieldValueToApply;
void redo() override;
void undo() override;
caf::PdmFieldHandle* userDescriptionField() override;
private:
void childObjects( caf::PdmObject* pdmObject, std::vector<caf::PdmObjectHandle*>& children );
caf::PdmObjectHandle* findObjectByName( caf::PdmObjectHandle* root, const QString& name );
caf::PdmFieldHandle* findFieldByKeyword( caf::PdmObjectHandle* pdmObject, const QString& fieldName );
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RimCommandFactory
{
public:
static void createCommandObjects( const caf::PdmObjectGroup& selectedObjects, std::vector<RimCommandObject*>* commandObjects );
};

View File

@@ -45,7 +45,6 @@
#include "RimCase.h"
#include "RimCaseCollection.h"
#include "RimColorLegendCollection.h"
#include "RimCommandObject.h"
#include "RimCompletionTemplateCollection.h"
#include "RimContextCommandBuilder.h"
#include "RimCorrelationPlotCollection.h"
@@ -172,8 +171,6 @@ RimProject::RimProject()
CAF_PDM_InitFieldNoDefault( &gridCalculationCollection, "GridCalculationCollection", "Grid Calculation Collection" );
gridCalculationCollection = new RimGridCalculationCollection;
CAF_PDM_InitFieldNoDefault( &commandObjects, "CommandObjects", "Command Objects" );
CAF_PDM_InitFieldNoDefault( &multiSnapshotDefinitions, "MultiSnapshotDefinitions", "Multi Snapshot Definitions" );
CAF_PDM_InitFieldNoDefault( &mainWindowTreeViewStates, "TreeViewStates", "" );
@@ -267,8 +264,6 @@ void RimProject::close()
casesObsolete.deleteChildren();
caseGroupsObsolete.deleteChildren();
commandObjects.deleteChildren();
multiSnapshotDefinitions.deleteChildren();
m_dialogData->clearProjectSpecificData();

View File

@@ -43,8 +43,6 @@ class RimPolylinesAnnotation;
class RimSummaryCalculationCollection;
class RimSummaryCalculation;
class RimCase;
class RimCommandObject;
class RimCommandObject;
class RimDialogData;
class RimEclipseCase;
class RimGeoMechCase;
@@ -101,7 +99,6 @@ public:
caf::PdmChildField<RimViewLinkerCollection*> viewLinkerCollection;
caf::PdmChildField<RimSummaryCalculationCollection*> calculationCollection;
caf::PdmChildField<RimGridCalculationCollection*> gridCalculationCollection;
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
RimMainPlotCollection* mainPlotCollection() const;