Skip to content

Commit 3ed6f5b

Browse files
committed
Replace deprecated qSort/qStableSort/qGreater/qLess with std:: algs
1 parent 8408777 commit 3ed6f5b

File tree

56 files changed

+99
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+99
-99
lines changed

src/analysis/network/qgsvectorlayerdirector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const
233233

234234
QgsPointCompare pointCompare( builder->topologyTolerance() );
235235

236-
qSort( points.begin(), points.end(), pointCompare );
236+
std::sort( points.begin(), points.end(), pointCompare );
237237
QVector< QgsPoint >::iterator tmp = std::unique( points.begin(), points.end() );
238238
points.resize( tmp - points.begin() );
239239

@@ -243,7 +243,7 @@ void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const
243243
for ( i = 0; i < snappedPoints.size() ; ++i )
244244
snappedPoints[ i ] = *( my_binary_search( points.begin(), points.end(), snappedPoints[ i ], pointCompare ) );
245245

246-
qSort( pointLengthMap.begin(), pointLengthMap.end(), TiePointInfoCompare );
246+
std::sort( pointLengthMap.begin(), pointLengthMap.end(), TiePointInfoCompare );
247247

248248
{
249249
// fill attribute list 'la'
@@ -264,7 +264,7 @@ void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const
264264
tmpAttr.push_back( *it2 );
265265
}
266266
}
267-
qSort( tmpAttr.begin(), tmpAttr.end() );
267+
std::sort( tmpAttr.begin(), tmpAttr.end() );
268268

269269
int lastAttrId = -1;
270270
for ( it2 = tmpAttr.begin(); it2 != tmpAttr.end(); ++it2 )

src/analysis/vector/qgszonalstatistics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
277277
changeAttributeMap.insert( meanIndex, QVariant( mean ) );
278278
if ( mStatistics & QgsZonalStatistics::Median )
279279
{
280-
qSort( featureStats.values.begin(), featureStats.values.end() );
280+
std::sort( featureStats.values.begin(), featureStats.values.end() );
281281
int size = featureStats.values.count();
282282
bool even = ( size % 2 ) < 1;
283283
double medianValue;
@@ -311,7 +311,7 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
311311
if ( mStatistics & QgsZonalStatistics::Minority || mStatistics & QgsZonalStatistics::Majority )
312312
{
313313
QList<int> vals = featureStats.valueCount.values();
314-
qSort( vals.begin(), vals.end() );
314+
std::sort( vals.begin(), vals.end() );
315315
if ( mStatistics & QgsZonalStatistics::Minority )
316316
{
317317
float minorityKey = featureStats.valueCount.key( vals.first() );

src/app/composer/qgscomposer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,7 @@ void QgsComposer::populatePrintComposersMenu()
39843984
if ( acts.size() > 1 )
39853985
{
39863986
// sort actions in case main app's aboutToShow slot has not yet
3987-
qSort( acts.begin(), acts.end(), cmpByText_ );
3987+
std::sort( acts.begin(), acts.end(), cmpByText_ );
39883988
}
39893989
mPrintComposersMenu->addActions( acts );
39903990
}

src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ void QgsComposerLegendWidget::on_mRemoveToolButton_clicked()
726726
Q_FOREACH ( QgsLayerTreeLayer* nodeLayer, nodesWithRemoval.keys() )
727727
{
728728
QList<int> toDelete = nodesWithRemoval[nodeLayer];
729-
qSort( toDelete.begin(), toDelete.end(), qGreater<int>() );
729+
std::sort( toDelete.begin(), toDelete.end(), std::greater<int>() );
730730
QList<int> order = QgsMapLayerLegendUtils::legendNodeOrder( nodeLayer );
731731

732732
Q_FOREACH ( int i, toDelete )

src/app/qgisapp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ void QgisApp::readSettings()
15531553
{
15541554
projectKeys.append( key.toInt() );
15551555
}
1556-
qSort( projectKeys );
1556+
std::sort( projectKeys.begin(), projectKeys.end() );
15571557

15581558
Q_FOREACH ( int key, projectKeys )
15591559
{
@@ -2108,7 +2108,7 @@ void QgisApp::createToolBars()
21082108
}
21092109

21102110
// sort actions in toolbar menu
2111-
qSort( toolbarMenuActions.begin(), toolbarMenuActions.end(), cmpByText_ );
2111+
std::sort( toolbarMenuActions.begin(), toolbarMenuActions.end(), cmpByText_ );
21122112

21132113
mToolbarMenu->addActions( toolbarMenuActions );
21142114

@@ -6930,7 +6930,7 @@ void QgisApp::on_mPrintComposersMenu_aboutToShow()
69306930
if ( acts.size() > 1 )
69316931
{
69326932
// sort actions by text
6933-
qSort( acts.begin(), acts.end(), cmpByText_ );
6933+
std::sort( acts.begin(), acts.end(), cmpByText_ );
69346934
}
69356935
mPrintComposersMenu->addActions( acts );
69366936
}
@@ -12040,7 +12040,7 @@ QMenu* QgisApp::createPopupMenu()
1204012040
}
1204112041
}
1204212042

12043-
qSort( panels.begin(), panels.end(), cmpByText_ );
12043+
std::sort( panels.begin(), panels.end(), cmpByText_ );
1204412044
QWidgetAction* panelstitle = new QWidgetAction( menu );
1204512045
QLabel* plabel = new QLabel( QStringLiteral( "<b>%1</b>" ).arg( tr( "Panels" ) ) );
1204612046
plabel->setMargin( 3 );
@@ -12058,7 +12058,7 @@ QMenu* QgisApp::createPopupMenu()
1205812058
tlabel->setAlignment( Qt::AlignHCenter );
1205912059
toolbarstitle->setDefaultWidget( tlabel );
1206012060
menu->addAction( toolbarstitle );
12061-
qSort( toolbars.begin(), toolbars.end(), cmpByText_ );
12061+
std::sort( toolbars.begin(), toolbars.end(), cmpByText_ );
1206212062
Q_FOREACH ( QAction* a, toolbars )
1206312063
{
1206412064
menu->addAction( a );

src/app/qgsattributeactiondialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void QgsAttributeActionDialog::insertRow( int row, const QgsAction& action )
134134
item = new QTableWidgetItem();
135135
item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
136136
QStringList actionScopes = action.actionScopes().toList();
137-
qSort( actionScopes );
137+
std::sort( actionScopes.begin(), actionScopes.end() );
138138
item->setText( actionScopes.join( QStringLiteral( ", " ) ) );
139139
item->setData( Qt::UserRole, QVariant::fromValue<QSet<QString>>( action.actionScopes() ) );
140140
mAttributeActionTable->setItem( row, ActionScopes, item );
@@ -338,7 +338,7 @@ void QgsAttributeActionDialog::itemDoubleClicked( QTableWidgetItem* item )
338338

339339
QTableWidgetItem* item = mAttributeActionTable->item( row, ActionScopes );
340340
QStringList actionScopes = actionProperties.actionScopes().toList();
341-
qSort( actionScopes );
341+
std::sort( actionScopes.begin(), actionScopes.end() );
342342
item->setText( actionScopes.join( QStringLiteral( ", " ) ) );
343343
item->setData( Qt::UserRole, QVariant::fromValue<QSet<QString>>( actionProperties.actionScopes() ) );
344344

src/app/qgsbrowserdockwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ void QgsBrowserDockWidget::addSelectedLayers()
551551

552552
// get a sorted list of selected indexes
553553
QModelIndexList list = mBrowserView->selectionModel()->selectedIndexes();
554-
qSort( list );
554+
std::sort( list.begin(), list.end() );
555555

556556
// If any of the layer items are QGIS we just open and exit the loop
557557
Q_FOREACH ( const QModelIndex& index, list )

src/core/composer/qgsatlascomposition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ int QgsAtlasComposition::updateFeatures()
202202
if ( !mFeatureKeys.isEmpty() )
203203
{
204204
FieldSorter sorter( mFeatureKeys, mSortAscending );
205-
qSort( mFeatureIds.begin(), mFeatureIds.end(), sorter );
205+
std::sort( mFeatureIds.begin(), mFeatureIds.end(), sorter );
206206
}
207207

208208
emit numberFeaturesChanged( mFeatureIds.size() );
@@ -750,7 +750,7 @@ void QgsAtlasComposition::setPredefinedScales( const QVector<qreal>& scales )
750750
{
751751
mPredefinedScales = scales;
752752
// make sure the list is sorted
753-
qSort( mPredefinedScales.begin(), mPredefinedScales.end() );
753+
std::sort( mPredefinedScales.begin(), mPredefinedScales.end() );
754754
}
755755

756756
QgsGeometry QgsAtlasComposition::currentGeometry( const QgsCoordinateReferenceSystem& crs ) const

src/core/composer/qgscomposerattributetablemodelv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ bool QgsComposerAttributeTableColumnModelV2::moveColumnInSortRank( QgsComposerTa
406406
sortedColumns.append( currentColumn );
407407
}
408408
}
409-
qStableSort( sortedColumns.begin(), sortedColumns.end(), columnsBySortRank );
409+
std::stable_sort( sortedColumns.begin(), sortedColumns.end(), columnsBySortRank );
410410
int columnPos = sortedColumns.indexOf( column );
411411

412412
if (( columnPos == 0 && direction == ShiftUp )

src/core/composer/qgscomposerattributetablev2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ bool QgsComposerAttributeTableV2::getTableContents( QgsComposerTableContents &co
526526
{
527527
c.setSortColumn( sortColumns.at( i ).first );
528528
c.setAscending( sortColumns.at( i ).second );
529-
qStableSort( contents.begin(), contents.end(), c );
529+
std::stable_sort( contents.begin(), contents.end(), c );
530530
}
531531

532532
recalculateTableSize();
@@ -608,7 +608,7 @@ QList<QPair<int, bool> > QgsComposerAttributeTableV2::sortAttributes() const
608608
}
609609

610610
//sort columns by rank
611-
qSort( sortedColumns.begin(), sortedColumns.end(), columnsBySortRank );
611+
std::sort( sortedColumns.begin(), sortedColumns.end(), columnsBySortRank );
612612

613613
//generate list of column index, bool for sort direction (to match 2.0 api)
614614
QList<QPair<int, bool> > attributesBySortRank;

src/core/composer/qgscomposerhtml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ double QgsComposerHtml::findNearbyPageBreak( double yPos )
405405
}
406406

407407
//sort candidate rows by number of changes ascending, row number descending
408-
qSort( candidates.begin(), candidates.end(), candidateSort );
408+
std::sort( candidates.begin(), candidates.end(), candidateSort );
409409
//first candidate is now the largest row with smallest number of changes
410410

411411
//ok, now take the mid point of the best candidate position

src/core/composer/qgscomposermapgrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ QgsComposerMapGrid::BorderSide QgsComposerMapGrid::borderForLineCoord( QPointF p
19741974
distanceToSide << qMakePair( p.y(), QgsComposerMapGrid::Top );
19751975
distanceToSide << qMakePair( mComposerMap->rect().height() - p.y(), QgsComposerMapGrid::Bottom );
19761976

1977-
qSort( distanceToSide.begin(), distanceToSide.end(), sortByDistance );
1977+
std::sort( distanceToSide.begin(), distanceToSide.end(), sortByDistance );
19781978
return distanceToSide.at( 0 ).second;
19791979
}
19801980

src/core/composer/qgscomposermodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ bool QgsComposerModel::dropMimeData( const QMimeData *data,
351351
//move dropped items
352352

353353
//first sort them by z-order
354-
qSort( droppedItems.begin(), droppedItems.end(), zOrderDescending );
354+
std::sort( droppedItems.begin(), droppedItems.end(), zOrderDescending );
355355

356356
//calculate position in z order list to drop items at
357357
int destPos = 0;

src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ QgsValueRelationFieldFormatter::ValueRelationCache QgsValueRelationFieldFormatte
137137

138138
if ( config.value( "OrderByValue" ).toBool() )
139139
{
140-
qSort( cache.begin(), cache.end(), orderByValueLessThan );
140+
std::sort( cache.begin(), cache.end(), orderByValueLessThan );
141141
}
142142
else
143143
{
144-
qSort( cache.begin(), cache.end(), orderByKeyLessThan );
144+
std::sort( cache.begin(), cache.end(), orderByKeyLessThan );
145145
}
146146

147147
return cache;

src/core/layertree/qgslayertreemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ QMimeData* QgsLayerTreeModel::mimeData( const QModelIndexList& indexes ) const
10051005
{
10061006
// Sort the indexes. Depending on how the user selected the items, the indexes may be unsorted.
10071007
QModelIndexList sortedIndexes = indexes;
1008-
qSort( sortedIndexes.begin(), sortedIndexes.end(), qLess<QModelIndex>() );
1008+
std::sort( sortedIndexes.begin(), sortedIndexes.end(), std::less<QModelIndex>() );
10091009

10101010
QList<QgsLayerTreeNode*> nodesFinal = indexes2nodes( sortedIndexes, true );
10111011

src/core/pal/costcalculator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void CostCalculator::setPolygonCandidatesCost( int nblp, QList< LabelPosition* >
109109
{
110110
toSort << lPos.at( i );
111111
}
112-
qSort( toSort.begin(), toSort.end(), candidateSortShrink );
112+
std::sort( toSort.begin(), toSort.end(), candidateSortShrink );
113113
for ( int i = 0; i < nblp; ++i )
114114
{
115115
lPos[i] = toSort.at( i );
@@ -181,7 +181,7 @@ int CostCalculator::finalizeCandidatesCosts( Feats* feat, int max_p, RTree <Feat
181181
max_p = feat->lPos.count();
182182
//
183183
// sort candidates list, best label to worst
184-
qSort( feat->lPos.begin(), feat->lPos.end(), candidateSortGrow );
184+
std::sort( feat->lPos.begin(), feat->lPos.end(), candidateSortGrow );
185185

186186
// try to exclude all conflitual labels (good ones have cost < 1 by pruning)
187187
double discrim = 0.0;

src/core/pal/feature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ int FeaturePart::createCandidates( QList< LabelPosition*>& lPos,
16011601
}
16021602
}
16031603

1604-
qSort( lPos.begin(), lPos.end(), CostCalculator::candidateSortGrow );
1604+
std::sort( lPos.begin(), lPos.end(), CostCalculator::candidateSortGrow );
16051605
return lPos.count();
16061606
}
16071607

src/core/pal/problem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,7 @@ QList<LabelPosition*> * Problem::getSolution( bool returnInactive )
22772277
// if features collide, order by size, so smaller ones appear on top
22782278
if ( returnInactive )
22792279
{
2280-
qSort( solList->begin(), solList->end(), compareLabelArea );
2280+
std::sort( solList->begin(), solList->end(), compareLabelArea );
22812281
}
22822282

22832283
return solList;

src/core/qgsbrowsermodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void QgsBrowserModel::addRootItems()
153153
QList<QgsDataItem *> providerGroup = providerMap.values( key );
154154
if ( providerGroup.size() > 1 )
155155
{
156-
qSort( providerGroup.begin(), providerGroup.end(), cmpByDataItemName_ );
156+
std::sort( providerGroup.begin(), providerGroup.end(), cmpByDataItemName_ );
157157
}
158158

159159
Q_FOREACH ( QgsDataItem * ditem, providerGroup )

src/core/qgscolorramp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ void QgsGradientColorRamp::setStops( const QgsGradientStopsList &stops )
273273
mStops = stops;
274274

275275
//sort stops by offset
276-
qSort( mStops.begin(), mStops.end(), stopLessThan );
276+
std::sort( mStops.begin(), mStops.end(), stopLessThan );
277277
}
278278

279279
void QgsGradientColorRamp::addStopsToGradient( QGradient* gradient, double alpha )

src/core/qgsexpressioncontext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ QStringList QgsExpressionContextScope::filteredVariableNames() const
166166
filtered << variable;
167167
}
168168
QgsExpressionContextVariableCompare cmp( *this );
169-
qSort( filtered.begin(), filtered.end(), cmp );
169+
std::sort( filtered.begin(), filtered.end(), cmp );
170170

171171
return filtered;
172172
}

src/core/qgsfeatureiterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void QgsAbstractFeatureIterator::setupOrderBy( const QList<QgsFeatureRequest::Or
165165
mCachedFeatures.append( indexedFeature );
166166
}
167167

168-
qSort( mCachedFeatures.begin(), mCachedFeatures.end(), QgsExpressionSorter( preparedOrderBys ) );
168+
std::sort( mCachedFeatures.begin(), mCachedFeatures.end(), QgsExpressionSorter( preparedOrderBys ) );
169169

170170
mFeatureIterator = mCachedFeatures.constBegin();
171171
mUseCachedFeatures = true;

src/core/qgshistogram.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ QgsHistogram::QgsHistogram()
3131

3232
void QgsHistogram::prepareValues()
3333
{
34-
qSort( mValues.begin(), mValues.end() );
34+
std::sort( mValues.begin(), mValues.end() );
3535

3636
QgsStatisticalSummary s;
3737
s.setStatistics( QgsStatisticalSummary::Max | QgsStatisticalSummary::Min | QgsStatisticalSummary::InterQuartileRange );

src/core/qgslabelingengine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ void QgsLabelingEngine::run( QgsRenderContext& context )
327327
painter->setRenderHint( QPainter::Antialiasing );
328328

329329
// sort labels
330-
qSort( labels->begin(), labels->end(), QgsLabelSorter( mMapSettings ) );
330+
std::sort( labels->begin(), labels->end(), QgsLabelSorter( mMapSettings ) );
331331

332332
// draw the labels
333333
QList<pal::LabelPosition*>::iterator it = labels->begin();

src/core/qgsmaprendererjob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ void QgsMapRendererJob::logRenderingTime( const LayerRenderJobs& jobs )
383383
elapsed.insert( job.renderingTime, job.layer ? job.layer->id() : QString() );
384384

385385
QList<int> tt( elapsed.uniqueKeys() );
386-
qSort( tt.begin(), tt.end(), qGreater<int>() );
386+
std::sort( tt.begin(), tt.end(), std::greater<int>() );
387387
Q_FOREACH ( int t, tt )
388388
{
389389
QgsMessageLog::logMessage( tr( "%1 ms: %2" ).arg( t ).arg( QStringList( elapsed.values( t ) ).join( QStringLiteral( ", " ) ) ), tr( "Rendering" ) );

src/core/qgsstatisticalsummary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void QgsStatisticalSummary::finalize()
135135
|| mStatistics & QgsStatisticalSummary::ThirdQuartile
136136
|| mStatistics & QgsStatisticalSummary::InterQuartileRange )
137137
{
138-
qSort( mValues.begin(), mValues.end() );
138+
std::sort( mValues.begin(), mValues.end() );
139139
bool even = ( mCount % 2 ) < 1;
140140
if ( even )
141141
{
@@ -212,7 +212,7 @@ void QgsStatisticalSummary::finalize()
212212
if ( mStatistics & QgsStatisticalSummary::Minority || mStatistics & QgsStatisticalSummary::Majority )
213213
{
214214
QList<int> valueCounts = mValueCount.values();
215-
qSort( valueCounts.begin(), valueCounts.end() );
215+
std::sort( valueCounts.begin(), valueCounts.end() );
216216
if ( mStatistics & QgsStatisticalSummary::Minority )
217217
{
218218
mMinority = mValueCount.key( valueCounts.first() );

src/core/qgsvectordataprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ QStringList QgsVectorDataProvider::availableEncodings()
670670
}
671671

672672
// Do case-insensitive sorting of encodings
673-
qSort( sEncodings.begin(), sEncodings.end(), _compareEncodings );
673+
std::sort( sEncodings.begin(), sEncodings.end(), _compareEncodings );
674674

675675
return sEncodings;
676676
}

src/core/qgsvectorlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ bool QgsVectorLayer::deleteAttributes( QList<int> attrs )
23272327
// Remove multiple occurrences of same attribute
23282328
attrs = attrs.toSet().toList();
23292329

2330-
qSort( attrs.begin(), attrs.end(), qGreater<int>() );
2330+
std::sort( attrs.begin(), attrs.end(), std::greater<int>() );
23312331

23322332
Q_FOREACH ( int attr, attrs )
23332333
{

src/core/qgsvectorlayereditbuffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ void QgsVectorLayerEditBuffer::handleAttributeAdded( int index )
678678
// go through renamed attributes and adapt
679679
QList< int > sortedRenamedIndices = mRenamedAttributes.keys();
680680
//sort keys
681-
qSort( sortedRenamedIndices.begin(), sortedRenamedIndices.end(), qGreater< int >() );
681+
std::sort( sortedRenamedIndices.begin(), sortedRenamedIndices.end(), std::greater< int >() );
682682
Q_FOREACH ( int renameIndex, sortedRenamedIndices )
683683
{
684684
if ( renameIndex >= index )
@@ -717,7 +717,7 @@ void QgsVectorLayerEditBuffer::handleAttributeDeleted( int index )
717717
// go through rename attributes and adapt
718718
QList< int > sortedRenamedIndices = mRenamedAttributes.keys();
719719
//sort keys
720-
qSort( sortedRenamedIndices.begin(), sortedRenamedIndices.end() );
720+
std::sort( sortedRenamedIndices.begin(), sortedRenamedIndices.end() );
721721
int last = -1;
722722
mRenamedAttributes.remove( index );
723723
Q_FOREACH ( int renameIndex, sortedRenamedIndices )

src/core/qgsvectorlayerundocommand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void QgsVectorLayerUndoCommandDeleteAttribute::redo()
417417
if ( mProviderField )
418418
{
419419
mBuffer->mDeletedAttributeIds.append( mOriginIndex );
420-
qSort( mBuffer->mDeletedAttributeIds ); // keep it sorted
420+
std::sort( mBuffer->mDeletedAttributeIds.begin(), mBuffer->mDeletedAttributeIds.end() ); // keep it sorted
421421
}
422422
else
423423
{

0 commit comments

Comments
 (0)