CppEditor: Jump directly to single virtual function

Assumption: model never has 1 entry for immediate result
(there is always the natural result + "Searching for overrides"

Change-Id: I5de7e7933b1309f995a6111a2ab1c7aed31c086e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2014-02-16 22:05:23 +02:00
committed by Orgad Shaneh
parent 0357531796
commit d087d0b66e
3 changed files with 18 additions and 0 deletions

View File

@@ -88,6 +88,17 @@ protected:
return GenericProposalWidget::eventFilter(o, e);
}
void showProposal(const QString &prefix)
{
IGenericProposalModel *proposalModel = model();
if (proposalModel && proposalModel->size() == 1) {
emit proposalItemActivated(proposalModel->proposalItem(0));
deleteLater();
return;
}
GenericProposalWidget::showProposal(prefix);
}
private:
QKeySequence m_sequence;
};