Check for existing labels in baritemmodelhandler

Also add setting column and row labels in tst_qmltheme.

Fixes: QTBUG-130722
Pick-to: 6.8
Change-Id: I09cc382957cb3d9ccca0b72ae3723978157726ac
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io>
This commit is contained in:
Sakaria Pouke 2024-11-06 12:17:54 +02:00
parent a56b3ca05c
commit 3199d40a3d
2 changed files with 26 additions and 2 deletions

View File

@ -270,8 +270,15 @@ void BarItemModelHandler::resolveModel()
}
}
rowLabels = rowList;
columnLabels = columnList;
if (!m_proxy->series()->rowLabels().isEmpty())
rowLabels = m_proxy->series()->rowLabels();
else
rowLabels = rowList;
if (!m_proxy->series()->columnLabels().isEmpty())
columnLabels = m_proxy->series()->columnLabels();
else
columnLabels = columnList;
m_columnCount = columnList.size();
delete matchCountMap;

View File

@ -124,6 +124,23 @@ Item {
// If you want to check with series colors, uncomment these
// baseGradient: customGradient
// baseColor: barColor.color
columnLabels: [
"col 1",
"col 2",
"col 3",
"col 4",
"col 5",
"col 6",
]
rowLabels: [
"row 1",
"row 2",
"row 3",
"row 4",
"row 5",
"row 6",
]
ItemModelBarDataProxy {
id: barProxy
itemModel: ListModel {