VirtualBox

Changeset 86797 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 3, 2020 1:26:45 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Installing event filter on the content widget

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r86794 r86797  
    3131#endif
    3232#include <QMenu>
     33#include <QMouseEvent>
    3334#include <QScrollBar>
    3435#include <QSpacerItem>
     
    598599
    599600    AssertReturnVoid(m_pContentWidget && m_pIndexWidget && m_pContentModel);
     601    m_pContentWidget->installEventFilter(this);
    600602    m_pSplitter->addWidget(m_pTabWidget);
    601603
     
    769771}
    770772
     773bool UIHelpBrowserWidget::eventFilter(QObject *pWatched, QEvent *pEvent)
     774{
     775    if (pWatched == m_pContentWidget)
     776    {
     777        if (pEvent->type() == QEvent::MouseButtonPress ||
     778            pEvent->type() == QEvent::MouseMove ||
     779            pEvent->type() == QEvent::KeyPress ||
     780            pEvent->type() == QEvent::MouseButtonDblClick)
     781            printf("xxxxxxxxxxx %d\n", pEvent->type());
     782        else
     783            printf("%d\n", pEvent->type());
     784
     785    }
     786    return false;
     787}
     788
    771789void UIHelpBrowserWidget::cleanup()
    772790{
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r86794 r86797  
    107107    void cleanup();
    108108    QUrl findIndexHtml() const;
     109    bool eventFilter(QObject *pWatched, QEvent *pEvent);
     110
    109111    /** @name Event handling stuff.
    110112     * @{ */
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