16 #include <QItemSelectionModel>
31 : QSortFilterProxyModel( parent )
33 , mFilterMode( ShowAll )
34 , mSelectedOnTop( false )
38 setDynamicSortFilter(
true );
50 if ( leftSelected && !rightSelected )
54 else if ( rightSelected && !leftSelected )
64 if ( leftData.isNull() )
67 if ( rightData.isNull() )
70 switch ( leftData.type() )
74 case QVariant::LongLong:
75 case QVariant::ULongLong:
76 return leftData.toLongLong() < rightData.toLongLong();
78 case QVariant::Double:
79 return leftData.toDouble() < rightData.toDouble();
82 return leftData.toDate() < rightData.toDate();
84 case QVariant::DateTime:
85 return leftData.toDateTime() < rightData.toDateTime();
88 return leftData.toString().localeAwareCompare( rightData.toString() ) < 0;
107 if ( sortColumn() == -1 )
162 Q_UNUSED( sourceParent );
186 const QList<QgsFeatureId> addedFeatures = editBuffer->
addedFeatures().keys();
189 return addedFeatures.contains( fid ) || changedFeatures.contains( fid );
218 sort( sortColumn(), sortOrder() );
241 if (
layer()->hasScaleBasedVisibility() &&
276 if ( t.elapsed() > 5000 )
279 emit progress( i, cancel );
308 QModelIndexList indexes;
309 foreach ( QModelIndex idx,
masterModel()->idToIndexList( fid ) )
320 return mapToSource( proxyIndex );
326 return mapFromSource( sourceIndex );