VirtualBox

Changeset 51510 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 3, 2014 12:21:11 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94126
Message:

FE/Qt: Runtime UI: Some cleanup for machine-view: Removing old legacy from SDL frame-buffer.

File:
1 edited

Legend:

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

    r51497 r51510  
    8686# include <Carbon/Carbon.h>
    8787#endif /* Q_WS_MAC */
    88 
    89 class UIViewport: public QWidget
    90 {
    91 public:
    92 
    93     UIViewport(QWidget *pParent = 0) : QWidget(pParent)
    94     {
    95         /* No need for background drawing: */
    96         setAttribute(Qt::WA_OpaquePaintEvent);
    97         /* Enable multi-touch support: */
    98         setAttribute(Qt::WA_AcceptTouchEvents);
    99     }
    100 
    101     QPaintEngine *paintEngine() const
    102     {
    103         if (testAttribute(Qt::WA_PaintOnScreen))
    104             return NULL;
    105         else
    106             return QWidget::paintEngine();
    107     }
    108 };
    10988
    11089UIMachineView* UIMachineView::create(  UIMachineWindow *pMachineWindow
     
    386365{
    387366    /* Prepare viewport: */
    388     setViewport(new UIViewport);
     367    AssertPtrReturnVoid(viewport());
     368    {
     369        /* Enable manual painting: */
     370        viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
     371        /* Enable multi-touch support: */
     372        viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
     373    }
    389374}
    390375
     
    982967        /* We have a snapshot for the paused state: */
    983968        QRect rect = pPaintEvent->rect().intersect(viewport()->rect());
    984         /* We have to disable paint on screen if we are using the regular painter: */
    985         bool fPaintOnScreen = viewport()->testAttribute(Qt::WA_PaintOnScreen);
    986         viewport()->setAttribute(Qt::WA_PaintOnScreen, false);
    987969        QPainter painter(viewport());
    988970        painter.drawPixmap(rect, m_pauseShot, QRect(rect.x() + contentsX(), rect.y() + contentsY(),
    989971                                                    rect.width(), rect.height()));
    990         /* Restore the attribute to it's previous state: */
    991         viewport()->setAttribute(Qt::WA_PaintOnScreen, fPaintOnScreen);
    992972#ifdef Q_WS_MAC
    993973        /* Update the dock icon: */
Note: See TracChangeset for help on using the changeset viewer.

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