CppEditor: "Follow Symbol Under Cursor" for virtual functions

F2 on a virtual function call presents a list of overrides in derived
classes. The function declaration of the static type is shown
immediately at the top.

Task-number: QTCREATORBUG-9611

Change-Id: I80ce906fa06272dc9fbd1662cd17500b8c77067f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-07-04 20:11:10 +02:00
parent 3a64f8a344
commit 11aeaea86f
23 changed files with 1130 additions and 352 deletions

View File

@@ -547,9 +547,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
if (fe->reason() == Qt::OtherFocusReason) {
// Qt/carbon workaround
// focus out is received before the key press event.
if (d->m_completionListView->currentIndex().isValid())
emit proposalItemActivated(d->m_model->proposalItem(
d->m_completionListView->currentIndex().row()));
activateCurrentProposalItem();
}
}
if (d->m_infoFrame)
@@ -593,9 +591,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Return:
if (!useCarbonWorkaround()) {
abort();
if (d->m_completionListView->currentIndex().isValid())
emit proposalItemActivated(d->m_model->proposalItem(
d->m_completionListView->currentIndex().row()));
activateCurrentProposalItem();
}
return true;
@@ -658,6 +654,16 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
return false;
}
bool GenericProposalWidget::activateCurrentProposalItem()
{
if (d->m_completionListView->currentIndex().isValid()) {
const int currentRow = d->m_completionListView->currentIndex().row();
emit proposalItemActivated(d->m_model->proposalItem(currentRow));
return true;
}
return false;
}
#include "genericproposalwidget.moc"
} // TextEditor