Skip to content

Commit

Permalink
QList::removeAt crashes in qt6 if index is -1, so use QList::removeAl…
Browse files Browse the repository at this point in the history
…l instead of QList::removeAt( QList::indexOf(...
  • Loading branch information
nyalldawson committed Jul 28, 2021
1 parent 5b4d6c3 commit a9f08b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/classification/qgsclassificationmethod.cpp
Expand Up @@ -325,9 +325,9 @@ void QgsClassificationMethod::makeBreaksSymmetric( QList<double> &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 );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrenderchecker.cpp
Expand Up @@ -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 );

Expand Down

0 comments on commit a9f08b0

Please sign in to comment.