diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-07-04 09:07:20 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-07-04 07:17:46 +0000 |
commit | 962ea7072e3bd27f28102f2367288046f9c3994d (patch) | |
tree | f2b90f2383d5da31d0872dacbae155b6c9590ce4 | |
parent | c18e9edf4cb97ab23d3975dfa03c524fbe619250 (diff) |
QAxHostWidget: Remove dependency on qt_win_display_dc()
qt_win_display_dc() is a simple wrapper around GetDC(0) which is only
used here for redirected painting (grabbing) of a QAxHostWidget.
As the export might be changed/removed, expand the code.
Change-Id: Id00546282d37ae00baa36fdd22164e412d7e57f9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r-- | src/activeqt/container/qaxwidget.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index bdc6e1d..8c74159 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1798,7 +1798,8 @@ void QAxHostWidget::paintEvent(QPaintEvent*) pm.fill(); HBITMAP hBmp = qt_pixmapToWinHBITMAP(pm); - HDC hBmp_hdc = CreateCompatibleDC(qt_win_display_dc()); + const HDC displayDc = GetDC(0); + HDC hBmp_hdc = CreateCompatibleDC(displayDc); HGDIOBJ old_hBmp = SelectObject(hBmp_hdc, hBmp); RECTL bounds; @@ -1818,6 +1819,7 @@ void QAxHostWidget::paintEvent(QPaintEvent*) SelectObject(hBmp_hdc, old_hBmp); DeleteObject(hBmp); DeleteDC(hBmp_hdc); + ReleaseDC(0, displayDc); } /*! |