Fix several deprecation warnings (#8657)

* Use constructor instead of nullptr for WindowFlags
* Use constructor instead of nullptr for Alignment
* Disable deprecation warning for QProcess
* Add string split method to RaTextStringTools
* Add caf.cpp used to manage Qt function deprecations
* Use position()
This commit is contained in:
Magne Sjaastad
2022-03-11 13:24:01 +01:00
committed by GitHub
parent 72fc47e003
commit 806a149809
75 changed files with 472 additions and 206 deletions

View File

@@ -24,6 +24,8 @@
#include "RimWellIAModelData.h"
#include "RimWellIASettings.h"
#include "caf.h"
#include <QFile>
#include <QTextStream>
@@ -41,11 +43,11 @@ bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString&
{
QTextStream stream( &file );
stream << "{" << endl;
stream << "{" << caf::endl;
stream << "\"comments\": \"All units are SI unless mentioned otherwise; temperature is in Celcius; use forward "
"slash (/) in 'directory' definition\","
<< endl;
stream << "\"directory\": \"" + settings.outputBaseDirectory() + "\"," << endl;
<< caf::endl;
stream << "\"directory\": \"" + settings.outputBaseDirectory() + "\"," << caf::endl;
stream << "\"output_name\": \"" + settings.name() + "\"";
RimParameterGroups mergedGroups;
@@ -63,9 +65,9 @@ bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString&
for ( auto& group : mergedGroups.groups() )
{
stream << "," << endl;
stream << "," << caf::endl;
stream << "\"" + group->name() + "\": {" << endl;
stream << "\"" + group->name() + "\": {" << caf::endl;
const auto& parameters = group->parameters();
@@ -78,13 +80,13 @@ bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString&
{
stream << ",";
}
stream << endl;
stream << caf::endl;
}
stream << " }";
}
stream << endl << "}" << endl;
stream << caf::endl << "}" << caf::endl;
file.close();
}
else
@@ -114,7 +116,7 @@ bool RifWellIAFileWriter::writeToCSVFile( RimWellIASettings& settings, QString&
stream << "Time_days, Pcasing_Pa, P_form_Pa, Temp_C,"
"U1-1,U2,U3,U1-2,U2,U3,U1-3,U2,U3,U1-4,U2,U3,U1-5,U2,U3,U1-6,U2,U3,U1-7,U2,U3,U1-8,U2,U3,"
"X,Y,Z,X2,Y,Z,X3,Y,Z,X4,Y,Z,X5,Y,Z,X6,Y,Z,X7,Y,Z,X8,Y,Z";
stream << endl;
stream << caf::endl;
for ( auto& modeldata : settings.modelData() )
{
@@ -145,7 +147,7 @@ bool RifWellIAFileWriter::writeToCSVFile( RimWellIASettings& settings, QString&
stream << ",";
stream << pos.z();
}
stream << endl;
stream << caf::endl;
}
}
else