# HG changeset patch # User František Kučera # Date 1539119400 -7200 # Node ID 75f8fd148f065418ed07b3d8881981161e1b4c70 # Parent ff4a1c07a4815f12479756acece6de5e5b005ce5 table header tooltip: data type name diff -r ff4a1c07a481 -r 75f8fd148f06 src/RelpipeTableModel.h --- 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 {