From 3e8e6ba9cd152ff50bdb277d1690bf053eb945ba Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Mon, 17 Sep 2018 10:02:15 -0400 Subject: [PATCH] [fix #19870] correctly convert index to style category the shift is already done in the list, so no need to hack --- src/app/qgsmaplayerstylecategoriesmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/qgsmaplayerstylecategoriesmodel.cpp b/src/app/qgsmaplayerstylecategoriesmodel.cpp index 8904dd80c07..131876a01a6 100644 --- a/src/app/qgsmaplayerstylecategoriesmodel.cpp +++ b/src/app/qgsmaplayerstylecategoriesmodel.cpp @@ -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