From 5e0b7441d2e2f5ad3fd1f512bdac52d187893a3f Mon Sep 17 00:00:00 2001 From: wongk Date: Thu, 3 Nov 2011 13:14:39 -0400 Subject: [PATCH] Allow user to click on arrows on the function hint proposal. Also added the ability to use the mouse wheel to scroll through the overloads. Task-Number: QTCREATORBUG-5540 Change-Id: I8854bdcdf0b1456afdbc7ea2e27cd3ff7b7fcf41 Reviewed-by: Leandro Melo --- .../texteditor/codeassist/functionhintproposalwidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp index 19236306a4c..57cf2b153f5 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp @@ -233,8 +233,15 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e) case QEvent::MouseButtonDblClick: case QEvent::Wheel: { QWidget *widget = qobject_cast(obj); - if (! (widget == this || isAncestorOf(widget))) { + if (!d->m_popupFrame->isAncestorOf(widget)) { abort(); + } else if (e->type() == QEvent::Wheel) { + if (static_cast(e)->delta() > 0) { + previousPage(); + } else { + nextPage(); + } + return true; } } break;