OSDN Git Service

Allow user to click on arrows on the function hint proposal.
authorwongk <kris.p.wong@gmail.com>
Thu, 3 Nov 2011 17:14:39 +0000 (13:14 -0400)
committerLeandro Melo <leandro.melo@nokia.com>
Mon, 7 Nov 2011 12:08:04 +0000 (13:08 +0100)
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 <leandro.melo@nokia.com>
src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp

index 1923630..57cf2b1 100644 (file)
@@ -233,8 +233,15 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e)
     case QEvent::MouseButtonDblClick:
     case QEvent::Wheel: {
             QWidget *widget = qobject_cast<QWidget *>(obj);
-            if (! (widget == this || isAncestorOf(widget))) {
+            if (!d->m_popupFrame->isAncestorOf(widget)) {
                 abort();
+            } else if (e->type() == QEvent::Wheel) {
+                if (static_cast<QWheelEvent*>(e)->delta() > 0) {
+                    previousPage();
+                } else {
+                    nextPage();
+                }
+                return true;
             }
         }
         break;