Commit 1a5ab0fb authored by Jan Paul Batrina's avatar Jan Paul Batrina Committed by Kåre Särs
Browse files

[gdbplugin] Added tooltips to localsview

This is useful especially for long variable name/values
parent 1f368ae9
...@@ -29,7 +29,7 @@ LocalsView::LocalsView(QWidget *parent) ...@@ -29,7 +29,7 @@ LocalsView::LocalsView(QWidget *parent)
headers << i18n("Symbol"); headers << i18n("Symbol");
headers << i18n("Value"); headers << i18n("Value");
setHeaderLabels(headers); setHeaderLabels(headers);
setAutoScroll(false); setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
} }
LocalsView::~LocalsView() LocalsView::~LocalsView()
...@@ -53,6 +53,9 @@ void LocalsView::createWrappedItem(QTreeWidgetItem *parent, const QString &name, ...@@ -53,6 +53,9 @@ void LocalsView::createWrappedItem(QTreeWidgetItem *parent, const QString &name,
label->setWordWrap(true); label->setWordWrap(true);
setItemWidget(item, 1, label); setItemWidget(item, 1, label);
item->setData(1, Qt::UserRole, value); item->setData(1, Qt::UserRole, value);
item->setToolTip(0, QStringLiteral("<qt>%1<qt>").arg(name));
item->setToolTip(1, QStringLiteral("<qt>%1<qt>").arg(value));
parent->setToolTip(0, QStringLiteral("<qt>%1<qt>").arg(parent->text(0)));
} }
void LocalsView::createWrappedItem(QTreeWidget *parent, const QString &name, const QString &value) void LocalsView::createWrappedItem(QTreeWidget *parent, const QString &name, const QString &value)
...@@ -61,6 +64,8 @@ void LocalsView::createWrappedItem(QTreeWidget *parent, const QString &name, con ...@@ -61,6 +64,8 @@ void LocalsView::createWrappedItem(QTreeWidget *parent, const QString &name, con
QLabel *label = new QLabel(value); QLabel *label = new QLabel(value);
label->setWordWrap(true); label->setWordWrap(true);
setItemWidget(item, 1, label); setItemWidget(item, 1, label);
item->setToolTip(0, QStringLiteral("<qt>%1<qt>").arg(name));
item->setToolTip(1, QStringLiteral("<qt>%1<qt>").arg(value));
} }
void LocalsView::addLocal(const QString &vString) void LocalsView::addLocal(const QString &vString)
......
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