give ungrouped instances a group header

Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
Tayou 2023-06-28 18:50:44 +02:00
parent 66461ac500
commit 6b3b119db0
No known key found for this signature in database
GPG Key ID: 02CA43C1CB6E9887

View File

@ -189,6 +189,7 @@ void VisualGroup::drawHeader(QPainter *painter, const QStyleOptionViewItem &opti
polygon << QPoint(arrowOffsetLeft - arrowSize, centerHeight - arrowSize/2) << QPoint(arrowOffsetLeft, centerHeight + arrowSize/2) << QPoint(arrowOffsetLeft + arrowSize, centerHeight - arrowSize/2);
painter->drawPolyline(polygon);
}
painter->restore();
}
//END: arrow
@ -203,7 +204,8 @@ void VisualGroup::drawHeader(QPainter *painter, const QStyleOptionViewItem &opti
painter->save();
painter->setFont(font);
painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text);
painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text != "" ? text : QObject::tr("Ungrouped"));
painter->restore();
}
//END: text
}