Changeset 51510 in vbox for trunk/src/VBox
- Timestamp:
- Jun 3, 2014 12:21:11 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94126
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r51497 r51510 86 86 # include <Carbon/Carbon.h> 87 87 #endif /* Q_WS_MAC */ 88 89 class UIViewport: public QWidget90 {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() const102 {103 if (testAttribute(Qt::WA_PaintOnScreen))104 return NULL;105 else106 return QWidget::paintEngine();107 }108 };109 88 110 89 UIMachineView* UIMachineView::create( UIMachineWindow *pMachineWindow … … 386 365 { 387 366 /* 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 } 389 374 } 390 375 … … 982 967 /* We have a snapshot for the paused state: */ 983 968 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);987 969 QPainter painter(viewport()); 988 970 painter.drawPixmap(rect, m_pauseShot, QRect(rect.x() + contentsX(), rect.y() + contentsY(), 989 971 rect.width(), rect.height())); 990 /* Restore the attribute to it's previous state: */991 viewport()->setAttribute(Qt::WA_PaintOnScreen, fPaintOnScreen);992 972 #ifdef Q_WS_MAC 993 973 /* Update the dock icon: */
Note:
See TracChangeset
for help on using the changeset viewer.