Axivion: Left-align the header columns

Change-Id: Ie1384cf10bc30e12cac3c8b1d120edb030738a22
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Christian Stenger
2024-03-13 14:49:54 +01:00
parent 988832ae76
commit 4a17bbbfd1

View File

@@ -87,8 +87,13 @@ bool DynamicListModel::setData(const QModelIndex &index, const QVariant &value,
QVariant DynamicListModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole && section < m_header.size())
if (orientation == Qt::Vertical || section < 0 || section >= m_header.size())
return {};
if (role == Qt::DisplayRole)
return m_header.at(section);
if (role == Qt::TextAlignmentRole)
return int(Qt::AlignLeft | Qt::AlignVCenter);
return {};
}