Don't access invalid counter description for EID column in counter view

This commit is contained in:
baldurk
2022-12-21 12:28:02 +00:00
parent 8c6566c6b8
commit a40d61b72f
@@ -182,11 +182,11 @@ public:
if((role == Qt::DisplayRole && col == 0) || role == EIDRole)
return (qulonglong)getData(row, 0).u;
const CounterDescription &desc = m_Descriptions[col - 1];
const CounterDescription &desc = m_Descriptions[qMax(1, col) - 1];
if(role == SortDataRole)
{
if(desc.resultType == CompType::UInt)
if(col == 0 || desc.resultType == CompType::UInt)
return (qulonglong)getData(row, col).u;
else
return getData(row, col).f;
@@ -194,7 +194,7 @@ public:
if(role == Qt::DisplayRole)
{
if(desc.resultType == CompType::UInt)
if(col == 0 || desc.resultType == CompType::UInt)
return (qulonglong)getData(row, col).u;
double val = getData(row, col).f;