--- a/src/RelpipeTableModel.h Tue Oct 09 23:02:11 2018 +0200
+++ b/src/RelpipeTableModel.h Tue Oct 09 23:10:00 2018 +0200
@@ -39,9 +39,10 @@
}
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::ItemDataRole::DisplayRole) const {
- if (role != Qt::ItemDataRole::DisplayRole) return QVariant();
- else if (orientation == Qt::Orientation::Horizontal) return QString::fromStdWString(attributes[section].getAttributeName().c_str());
- else if (orientation == Qt::Orientation::Vertical) return QString("%1").arg(section + 1);
+ if (orientation == Qt::Orientation::Horizontal && role == Qt::ItemDataRole::DisplayRole) return QString::fromStdWString(attributes[section].getAttributeName().c_str());
+ if (orientation == Qt::Orientation::Horizontal && role == Qt::ItemDataRole::ToolTipRole) return QString::fromStdWString(attributes[section].getTypeName().c_str());
+ if (orientation == Qt::Orientation::Vertical && role == Qt::ItemDataRole::DisplayRole) return QString("%1").arg(section + 1);
+ return QVariant();
}
QVariant data(const QModelIndex &index, int role = Qt::ItemDataRole::DisplayRole) const {