Commit 2cb3fe14 authored by Eike Ziller's avatar Eike Ziller

TreeModel: API for setting header tool tips

Change-Id: Ieea98d244d689778db868604d981badcd166a7b5
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent aad536cd
......@@ -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);
......
......@@ -257,6 +257,7 @@ public:
~TreeModel();
void setHeader(const QStringList &displays);
void setHeaderToolTip(const QStringList &tips);
void clear();
TreeItem *rootItem() const;
......@@ -301,6 +302,7 @@ private:
TreeItem *m_root; // Owned.
QStringList m_header;
QStringList m_headerToolTip;
int m_columnCount;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment