16 #include <QItemSelectionModel>
31 : QSortFilterProxyModel( parent )
33 , mFilterMode( ShowAll )
34 , mSelectedOnTop( false )
37 setDynamicSortFilter(
true );
49 if ( leftSelected && !rightSelected )
53 else if ( rightSelected && !leftSelected )
63 if ( leftData.isNull() )
66 if ( rightData.isNull() )
69 switch ( leftData.type() )
73 case QVariant::LongLong:
74 case QVariant::ULongLong:
75 return leftData.toLongLong() < rightData.toLongLong();
77 case QVariant::Double:
78 return leftData.toDouble() < rightData.toDouble();
81 return leftData.toDate() < rightData.toDate();
83 case QVariant::DateTime:
84 return leftData.toDateTime() < rightData.toDateTime();
87 return leftData.toString().localeAwareCompare( rightData.toString() ) < 0;
106 if ( sortColumn() == -1 )
159 Q_UNUSED( sourceParent );
183 const QList<QgsFeatureId> addedFeatures = editBuffer->
addedFeatures().keys();
186 return addedFeatures.contains( fid ) || changedFeatures.contains( fid );
215 sort( sortColumn(), sortOrder() );
238 if (
layer()->hasScaleBasedVisibility() &&
273 if ( t.elapsed() > 5000 )
276 emit progress( i, cancel );
305 QModelIndexList indexes;
306 foreach ( QModelIndex idx,
masterModel()->idToIndexList( fid ) )
317 return mapToSource( proxyIndex );
323 return mapFromSource( sourceIndex );