mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -19,7 +19,9 @@
|
||||
#include "RimPolylinesFromFileAnnotation.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "RigPolyLinesData.h"
|
||||
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationLineAppearance.h"
|
||||
|
||||
@@ -86,10 +88,10 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
|
||||
while ( !stream.atEnd() )
|
||||
{
|
||||
QString line = stream.readLine();
|
||||
QStringList commentLineSegs = line.split( "#", QString::KeepEmptyParts );
|
||||
QStringList commentLineSegs = line.split( "#" );
|
||||
if ( commentLineSegs.empty() ) continue; // Empty line
|
||||
|
||||
QStringList lineSegs = commentLineSegs[0].split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
||||
QStringList lineSegs = RiaTextStringTools::splitSkipEmptyParts( commentLineSegs[0], QRegExp( "\\s+" ) );
|
||||
|
||||
if ( lineSegs.empty() ) continue; // No data
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RimCellFilterIntervalTool.h"
|
||||
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -104,11 +106,11 @@ void RimCellFilterIntervalTool::setInterval( bool enabled, QString intervalText
|
||||
|
||||
if ( !enabled ) return;
|
||||
|
||||
QStringList parts = intervalText.split( ',', QString::SkipEmptyParts );
|
||||
QStringList parts = RiaTextStringTools::splitSkipEmptyParts( intervalText, "," );
|
||||
|
||||
for ( auto& part : parts )
|
||||
{
|
||||
QStringList minmax = part.split( '-', QString::SkipEmptyParts );
|
||||
QStringList minmax = RiaTextStringTools::splitSkipEmptyParts( part, "-" );
|
||||
switch ( minmax.size() )
|
||||
{
|
||||
case 1:
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigWellPath.h"
|
||||
@@ -99,7 +100,7 @@ void RimPerforationInterval::setCustomStartDate( const QDate& date )
|
||||
{
|
||||
if ( date.isValid() )
|
||||
{
|
||||
m_startDate = QDateTime( date );
|
||||
m_startDate = RiaQDateTimeTools::createDateTime( date );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +111,7 @@ void RimPerforationInterval::setCustomEndDate( const QDate& date )
|
||||
{
|
||||
if ( date.isValid() )
|
||||
{
|
||||
m_endDate = QDateTime( date );
|
||||
m_endDate = RiaQDateTimeTools::createDateTime( date );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
// Disable deprecation warning for QProcess::start()
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimProcess, "RimProcess" );
|
||||
|
||||
int RimProcess::m_nextProcessId = 1;
|
||||
|
||||
@@ -29,14 +29,10 @@
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
// #include "RigEclipseMultiPropertyStatCalc.h"
|
||||
// #include "RigEclipseNativeVisibleCellsStatCalc.h"
|
||||
// #include "RigFemNativeVisibleCellsStatCalc.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigFemResultAddress.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
// #include "RigFlowDiagVisibleCellsStatCalc.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
@@ -64,6 +60,8 @@
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "caf.h"
|
||||
|
||||
#include <QLocale>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig" );
|
||||
@@ -289,7 +287,7 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimEclipseView* eclipseView )
|
||||
{
|
||||
QString caseName = eclipseView->eclipseCase()->caseUserDescription();
|
||||
|
||||
QLocale localeWithSpaceAsGroupSeparator( QLocale::Norwegian );
|
||||
QLocale localeWithSpaceAsGroupSeparator( caf::norwegianLocale() );
|
||||
|
||||
RimEclipseContourMapView* contourMap = dynamic_cast<RimEclipseContourMapView*>( eclipseView );
|
||||
if ( contourMap && contourMap->contourMapProjection() )
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaProjectFileVersionTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
@@ -1517,7 +1518,7 @@ public:
|
||||
GlobalPathListMapper( const QString& globalPathListTable )
|
||||
{
|
||||
m_maxUsedIdNumber = 0;
|
||||
QStringList pathPairs = globalPathListTable.split( ";", QString::SkipEmptyParts );
|
||||
QStringList pathPairs = RiaTextStringTools::splitSkipEmptyParts( globalPathListTable, ";" );
|
||||
|
||||
for ( const QString& pathIdPathPair : pathPairs )
|
||||
{
|
||||
|
||||
@@ -125,13 +125,13 @@ QString RimTools::relocateFile( const QString& originalFileName,
|
||||
QFileInfo fileNameFileInfo( QDir::fromNativeSeparators( fileName ) );
|
||||
QString fileNamePath = fileNameFileInfo.path();
|
||||
QString fileNameWithoutPath = fileNameFileInfo.fileName();
|
||||
QStringList fileNamePathElements = fileNamePath.split( "/", QString::KeepEmptyParts );
|
||||
QStringList fileNamePathElements = fileNamePath.split( "/" );
|
||||
|
||||
QString oldProjPath = QDir::fromNativeSeparators( oldProjectPath );
|
||||
QStringList oldProjPathElements = oldProjPath.split( "/", QString::KeepEmptyParts );
|
||||
QStringList oldProjPathElements = oldProjPath.split( "/" );
|
||||
|
||||
QString newProjPath = QDir::fromNativeSeparators( newProjectPath );
|
||||
QStringList newProjPathElements = newProjPath.split( "/", QString::KeepEmptyParts );
|
||||
QStringList newProjPathElements = newProjPath.split( "/" );
|
||||
|
||||
// Find the possible equal start of the old project path, and the referenced file
|
||||
|
||||
|
||||
@@ -739,8 +739,8 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
}
|
||||
else if ( changedField == &m_minDateRange || changedField == &m_maxDateRange )
|
||||
{
|
||||
m_minTimeStep = RiaTimeTTools::fromQDateTime( QDateTime( m_minDateRange() ) );
|
||||
m_maxTimeStep = RiaTimeTTools::fromQDateTime( QDateTime( m_maxDateRange() ) );
|
||||
m_minTimeStep = RiaTimeTTools::fromQDateTime( RiaQDateTimeTools::createDateTime( m_minDateRange() ) );
|
||||
m_maxTimeStep = RiaTimeTTools::fromQDateTime( RiaQDateTimeTools::createDateTime( m_maxDateRange() ) );
|
||||
updateCurveColors();
|
||||
updateTimeAnnotations();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaStringListSerializer.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
@@ -183,7 +184,7 @@ void RimSummaryPlotFilterTextCurveSetEditor::updateTextFilter()
|
||||
// Todo: possibly check grid time history curves also
|
||||
|
||||
QStringList allCurveAddressFilters =
|
||||
curveFilterTextWithoutOutdatedLabel().split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
||||
RiaTextStringTools::splitSkipEmptyParts( curveFilterTextWithoutOutdatedLabel(), QRegExp( "\\s+" ) );
|
||||
|
||||
std::vector<bool> usedFilters;
|
||||
std::set<RifEclipseSummaryAddress> filteredAddressesFromSource;
|
||||
@@ -440,7 +441,7 @@ void RimSummaryPlotFilterTextCurveSetEditor::updateParentPlot()
|
||||
std::set<RiaSummaryCurveDefinition> curveDefinitions;
|
||||
|
||||
QStringList allCurveAddressFilters =
|
||||
curveFilterTextWithoutOutdatedLabel().split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
||||
RiaTextStringTools::splitSkipEmptyParts( curveFilterTextWithoutOutdatedLabel(), QRegExp( "\\s+" ) );
|
||||
std::vector<bool> accumulatedUsedFilters( allCurveAddressFilters.size(), false );
|
||||
|
||||
for ( SummarySource* currSource : selectedSummarySources() )
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RiaStringListSerializer.h"
|
||||
#include "RiaSummaryStringTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
@@ -507,7 +508,7 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotManager::filteredAddresses()
|
||||
|
||||
if ( nativeAddresses.empty() ) return {};
|
||||
|
||||
QStringList allCurveAddressFilters = m_filterText().split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
||||
QStringList allCurveAddressFilters = RiaTextStringTools::splitSkipEmptyParts( m_filterText(), QRegExp( "\\s+" ) );
|
||||
|
||||
return RiaSummaryStringTools::computeFilteredAddresses( allCurveAddressFilters, nativeAddresses, m_includeDiffCurves );
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "caf.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QWheelEvent>
|
||||
@@ -2108,29 +2109,30 @@ RimDepthTrackPlot* RimWellLogTrack::parentWellLogPlot() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::handleWheelEvent( QWheelEvent* event )
|
||||
void RimWellLogTrack::handleWheelEvent( QWheelEvent* wheelEvent )
|
||||
{
|
||||
RimDepthTrackPlot* wellLogPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( wellLogPlot );
|
||||
|
||||
if ( wellLogPlot )
|
||||
{
|
||||
if ( event->modifiers() & Qt::ControlModifier )
|
||||
if ( wheelEvent->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
double zoomCenter = 0.0;
|
||||
auto position = caf::position( wheelEvent );
|
||||
|
||||
if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
||||
{
|
||||
QwtScaleMap scaleMap = m_plotWidget->qwtPlot()->canvasMap( QwtPlot::yLeft );
|
||||
zoomCenter = scaleMap.invTransform( event->pos().y() );
|
||||
zoomCenter = scaleMap.invTransform( position.y() );
|
||||
}
|
||||
else
|
||||
{
|
||||
QwtScaleMap scaleMap = m_plotWidget->qwtPlot()->canvasMap( QwtPlot::xTop );
|
||||
zoomCenter = scaleMap.invTransform( event->pos().x() );
|
||||
zoomCenter = scaleMap.invTransform( position.x() );
|
||||
}
|
||||
|
||||
if ( event->delta() > 0 )
|
||||
if ( wheelEvent->angleDelta().y() > 0 )
|
||||
{
|
||||
wellLogPlot->setDepthAxisRangeByFactorAndCenter( RI_SCROLLWHEEL_ZOOMFACTOR, zoomCenter );
|
||||
}
|
||||
@@ -2141,8 +2143,8 @@ void RimWellLogTrack::handleWheelEvent( QWheelEvent* event )
|
||||
}
|
||||
else
|
||||
{
|
||||
wellLogPlot->setDepthAxisRangeByPanDepth( event->delta() < 0 ? RI_SCROLLWHEEL_PANFACTOR
|
||||
: -RI_SCROLLWHEEL_PANFACTOR );
|
||||
wellLogPlot->setDepthAxisRangeByPanDepth( wheelEvent->angleDelta().y() < 0 ? RI_SCROLLWHEEL_PANFACTOR
|
||||
: -RI_SCROLLWHEEL_PANFACTOR );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user