28 : QSortFilterProxyModel( parent )
32 setSourceModel( mModel );
33 setDynamicSortFilter(
true );
34 setSortLocaleAware(
true );
35 setFilterCaseSensitivity( Qt::CaseInsensitive );
67 if (
const QgsVectorLayer *vl = qobject_cast<const QgsVectorLayer *>( layer ) )
92 if ( mLayerAllowlist == layers )
95 mLayerAllowlist = layers;
101 if ( mExceptList == exceptList )
104 mExceptList = exceptList;
112 const auto constIds = ids;
113 for (
const QString &
id : constIds )
126 const auto constMExceptList = mExceptList;
135 mExcludedProviders = providers;
144 if ( !mLayerAllowlist.isEmpty() && !mLayerAllowlist.contains( layer ) )
147 if ( mExceptList.contains( layer ) )
156 if ( !layer->
name().contains( mFilterString, Qt::CaseInsensitive ) )
164 mFilterString = filter;
170 if ( mFilters.testFlag(
All ) && mExceptList.isEmpty() && mLayerAllowlist.isEmpty() && mExcludedProviders.isEmpty() && mFilterString.isEmpty() )
173 QModelIndex index = sourceModel()->index( source_row, 0, source_parent );
194 if ( leftAdditional && !rightAdditional )
196 else if ( rightAdditional && !leftAdditional )
200 QString leftStr = sourceModel()->data( left ).toString();
201 QString rightStr = sourceModel()->data( right ).toString();
202 return QString::localeAwareCompare( leftStr, rightStr ) < 0;