VirtualBox

Ignore:
Timestamp:
Mar 9, 2010 10:06:02 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58617
Message:

FE/Qt4: New running VM core: some code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r27227 r27235  
    239239bool UIMachineViewFullscreen::eventFilter(QObject *pWatched, QEvent *pEvent)
    240240{
     241    /* Who are we watching? */
    241242    QIMainDialog *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    242         qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     243                                qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     244
    243245    if (pWatched != 0 && pWatched == pMainDialog)
    244246    {
     
    263265        }
    264266    }
    265 #ifdef Q_WS_MAC // TODO: Is it really needed?
    266     QMenuBar *pMenuBar = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    267                          qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar() : 0;
    268     if (pWatched != 0 && pWatched == pMenuBar)
    269     {
    270         /* Sometimes when we press ESC in the menu it brings the focus away (Qt bug?)
    271          * causing no widget to have a focus, or holds the focus itself, instead of
    272          * returning the focus to the console window. Here we fix this: */
    273         switch (pEvent->type())
    274         {
    275             case QEvent::FocusOut:
    276             {
    277                 if (qApp->focusWidget() == 0)
    278                     setFocus();
    279                 break;
    280             }
    281             case QEvent::KeyPress:
    282             {
    283                 QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
    284                 if (pKeyEvent->key() == Qt::Key_Escape && (pKeyEvent->modifiers() == Qt::NoModifier))
    285                     if (pMenuBar->hasFocus())
    286                         setFocus();
    287                 break;
    288             }
    289             default:
    290                 break;
    291         }
    292     }
    293 #endif /* Q_WS_MAC */
     267
    294268    return UIMachineView::eventFilter(pWatched, pEvent);
    295269}
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