From ba82f9a518db9790be8e918069421de211f66186 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 16 Jun 2015 10:45:17 +0300 Subject: VariableChooser: Update variable description on keyboard navigation Change-Id: I716e4bd6325f0d00b1fa73ea4a76f185660c89a0 Reviewed-by: hjk --- src/plugins/coreplugin/variablechooser.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp index c7337de83f..4b71bde5ad 100644 --- a/src/plugins/coreplugin/variablechooser.cpp +++ b/src/plugins/coreplugin/variablechooser.cpp @@ -77,6 +77,8 @@ public: void contextMenuEvent(QContextMenuEvent *ev); + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); + private: VariableChooserPrivate *m_target; }; @@ -225,6 +227,12 @@ void VariableTreeView::contextMenuEvent(QContextMenuEvent *ev) m_target->insertText(expandedText); } +void VariableTreeView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) +{ + Q_UNUSED(previous); + m_target->updateDescription(current); +} + VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent) : q(parent), m_lineEdit(0), @@ -248,8 +256,6 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent) verticalLayout->addWidget(m_variableTree); verticalLayout->addWidget(m_variableDescription); - connect(m_variableTree, &QTreeView::clicked, - this, &VariableChooserPrivate::updateDescription); connect(m_variableTree, &QTreeView::activated, this, &VariableChooserPrivate::handleItemActivated); connect(qobject_cast(qApp), &QApplication::focusChanged, -- cgit v1.2.1