[fix #19870] correctly convert index to style category

the shift is already done in the list, so no need to hack
This commit is contained in:
Denis Rouzaud 2018-09-17 10:02:15 -04:00
parent d11a13eae3
commit 3e8e6ba9cd

View File

@ -47,7 +47,7 @@ void QgsMapLayerStyleCategoriesModel::setShowAllCategories( bool showAll )
QgsMapLayer::StyleCategory QgsMapLayerStyleCategoriesModel::index2category( const QModelIndex &index ) const
{
return mCategoryList.at( index.row() - ( mShowAllCategories ? 1 : 0 ) );
return mCategoryList.at( index.row() );
}
int QgsMapLayerStyleCategoriesModel::rowCount( const QModelIndex & ) const