aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/treemodel.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-06-11 15:40:30 +0200
committerEike Ziller <eike.ziller@theqtcompany.com>2015-06-11 15:54:08 +0000
commit2cb3fe1429f9f1e77c414a1d0c0417b3013a49b4 (patch)
tree06ebb01b4f79b583e8a5be9dc2f49cf2109a6ad5 /src/libs/utils/treemodel.cpp
parentaad536cdaf5ca33e2552a36849b1ae64c0cbe118 (diff)
TreeModel: API for setting header tool tips
Change-Id: Ieea98d244d689778db868604d981badcd166a7b5 Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/libs/utils/treemodel.cpp')
-rw-r--r--src/libs/utils/treemodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp
index 54b2be99894..6159fcfd4e4 100644
--- a/src/libs/utils/treemodel.cpp
+++ b/src/libs/utils/treemodel.cpp
@@ -917,6 +917,8 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation,
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole && section < m_header.size())
return m_header.at(section);
+ if (role == Qt::ToolTipRole && section < m_headerToolTip.size())
+ return m_headerToolTip.at(section);
return QVariant();
}
@@ -976,6 +978,11 @@ void TreeModel::setHeader(const QStringList &displays)
m_columnCount = displays.size();
}
+void TreeModel::setHeaderToolTip(const QStringList &tips)
+{
+ m_headerToolTip = tips;
+}
+
QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) const
{
CHECK_INDEX(parent);