From 992ef929dff21e079f7d8a207c07dbfd0c3c8f78 Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Tue, 12 Jul 2011 13:02:54 +0200 Subject: Use PlatformNativeInterface to obtain backingStore's dc Change-Id: I6ec2fc0b8e7696fdfe4468920228df2d21c933fd Reviewed-on: http://codereview.qt.nokia.com/1501 Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qwizard_win.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/widgets/dialogs') diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index ab59e0109a..6c2a67639b 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -232,7 +232,9 @@ void QVistaBackButton::paintEvent(QPaintEvent *) else if (underMouse()) state = WIZ_NAV_BB_HOT; - pDrawThemeBackground(theme, p.paintEngine()->getDC(), WIZ_NAV_BACKBUTTON, state, &clipRect, &clipRect); + QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); + HDC hdc = static_cast(nativeInterface->nativeResourceForBackingStore("getDC", backingStore())); + pDrawThemeBackground(theme, hdc, WIZ_NAV_BACKBUTTON, state, &clipRect, &clipRect); } /****************************************************************************** @@ -318,12 +320,14 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type) void QVistaHelper::drawTitleBar(QPainter *painter) { - HDC hdc = static_cast(painter->paintEngine())->getDC(); + Q_ASSERT(backButton_); + QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); + QBackingStore *backingStore = backButton_->backingStore(); + HDC hdc = static_cast(nativeInterface->nativeResourceForBackingStore("getDC", backingStore)); if (vistaState() == VistaAero) drawBlackRect(QRect(0, 0, wizard->width(), titleBarSize() + topOffset()), hdc); - Q_ASSERT(backButton_); const int btnTop = backButton_->mapToParent(QPoint()).y(); const int btnHeight = backButton_->size().height(); const int verticalCenter = (btnTop + btnHeight / 2) - 1; -- cgit v1.2.3