aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-07-16 13:30:08 +0200
committerMichael Mann <mmann78@netscape.net>2017-07-16 12:40:20 +0000
commitbdff83463186e28466f6ffb16a09583c1469a8e8 (patch)
treed3df0e00d97d3bc296618577aae7e138c697d2d2 /ui/qt
parent659d07f1e661519fe9c0cb26307ec69a4aa48d44 (diff)
Qt: show UAT description for header items
Be sure to display the extended description for UAT fields in the tooltip for the column header like GTK+ did. Change-Id: I294d2d3fb7f6d55df239129bea5d780b15deacc6 Reviewed-on: https://code.wireshark.org/review/22641 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/uat_model.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/ui/qt/uat_model.cpp b/ui/qt/uat_model.cpp
index fe56a18441..5b0813f0a6 100644
--- a/ui/qt/uat_model.cpp
+++ b/ui/qt/uat_model.cpp
@@ -155,10 +155,19 @@ QModelIndex UatModel::findRowForColumnContent(QVariant columnContent, int column
QVariant UatModel::headerData(int section, Qt::Orientation orientation, int role) const
{
- if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
+ if (orientation != Qt::Horizontal) {
return QVariant();
+ }
+
+ if (role == Qt::ToolTipRole && uat_->fields[section].desc) {
+ return uat_->fields[section].desc;
+ }
- return uat_->fields[section].title;
+ if (role == Qt::DisplayRole) {
+ return uat_->fields[section].title;
+ }
+
+ return QVariant();
}
int UatModel::rowCount(const QModelIndex &parent) const