VirtualBox

Changeset 78003 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 3, 2019 4:03:54 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9072: Handle only events sent to required object and call to base-class afterwards, eventFilter is a virtual function first of all.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/logviewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp

    r76954 r78003  
    572572bool UIVMLogViewerFilterPanel::eventFilter(QObject *pObject, QEvent *pEvent)
    573573{
     574    /* Handle only events sent to viewer(): */
     575    if (pObject != viewer())
     576        return UIVMLogViewerPanel::eventFilter(pObject, pEvent);
     577
    574578    /* Depending on event-type: */
    575579    switch (pEvent->type())
    576580    {
    577581        /* Process key press only: */
    578     case QEvent::KeyPress:
     582        case QEvent::KeyPress:
    579583        {
    580584            /* Cast to corresponding key press event: */
     
    595599            break;
    596600        }
    597     default:
    598         break;
    599     }
     601        default:
     602            break;
     603    }
     604
    600605    /* Call to base-class: */
    601606    return UIVMLogViewerPanel::eventFilter(pObject, pEvent);
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp

    r77087 r78003  
    334334bool UIVMLogViewerSearchPanel::eventFilter(QObject *pObject, QEvent *pEvent)
    335335{
     336    /* Handle only events sent to viewer(): */
     337    if (pObject != viewer())
     338        return UIVMLogViewerPanel::eventFilter(pObject, pEvent);
     339
    336340    /* Depending on event-type: */
    337341    switch (pEvent->type())
     
    387391            break;
    388392        }
    389     default:
    390         break;
    391     }
     393        default:
     394            break;
     395    }
     396
    392397    /* Call to base-class: */
    393398    return UIVMLogViewerPanel::eventFilter(pObject, pEvent);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette