From a9f08b0cc6614eb371df793e48a8ef2471b16523 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 28 Jul 2021 12:43:10 +1000 Subject: [PATCH] QList::removeAt crashes in qt6 if index is -1, so use QList::removeAll instead of QList::removeAt( QList::indexOf(... --- src/core/classification/qgsclassificationmethod.cpp | 4 ++-- src/core/qgsrenderchecker.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/classification/qgsclassificationmethod.cpp b/src/core/classification/qgsclassificationmethod.cpp index 70f70799f501..7d9b5726c570 100644 --- a/src/core/classification/qgsclassificationmethod.cpp +++ b/src/core/classification/qgsclassificationmethod.cpp @@ -325,9 +325,9 @@ void QgsClassificationMethod::makeBreaksSymmetric( QList &breaks, double } } // remove symmetry point - if ( astride ) // && breaks.indexOf( symmetryPoint ) != -1) // if symmetryPoint is found + if ( astride ) { - breaks.removeAt( breaks.indexOf( symmetryPoint ) ); + breaks.removeAll( symmetryPoint ); } } diff --git a/src/core/qgsrenderchecker.cpp b/src/core/qgsrenderchecker.cpp index d67b96241f65..3433713102be 100644 --- a/src/core/qgsrenderchecker.cpp +++ b/src/core/qgsrenderchecker.cpp @@ -106,7 +106,7 @@ bool QgsRenderChecker::isKnownAnomaly( const QString &diffImageFile ) QDir::Files | QDir::NoSymLinks ); //remove the control file from the list as the anomalies are //all files except the control file - myList.removeAt( myList.indexOf( QFileInfo( mExpectedImageFile ).fileName() ) ); + myList.removeAll( QFileInfo( mExpectedImageFile ).fileName() ); QString myImageHash = imageToHash( diffImageFile );