diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-06-30 21:47:14 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-07-14 13:46:03 +0000 |
commit | 64507c7165e42c2a5029353d8f97a0d841fa6b01 (patch) | |
tree | 12842e3bdda199bb6ee3cb9f29b443fe4618d1e6 /src/widgets | |
parent | 994d04883cf278e0258ed66de75c8c8b0bfb9339 (diff) | |
download | qtbase-64507c7165e42c2a5029353d8f97a0d841fa6b01.tar.gz |
Clean up qwindowdefs_win.h
The file lives in Qt Gui, but declares a few methods from
Qt Core and Widgets. All of those methods are actually mostly
unused, not documented and pretty trivial.
This patch removes the last few places the methods got used and
removes the declarations. The implementations should get removed
in a future release.
Change-Id: I2b609c29f403d2ed4824ff4346008be08b3fd067
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle.cpp | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index b87dc17778..df467505d9 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -868,6 +868,7 @@ QApplication::~QApplication() #endif } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // #fixme: Remove. static HDC displayDC = 0; // display device context @@ -880,6 +881,7 @@ Q_WIDGETS_EXPORT HDC qt_win_display_dc() // get display D return displayDC; } #endif +#endif void qt_cleanup() { @@ -887,12 +889,14 @@ void qt_cleanup() QColormap::cleanup(); QApplicationPrivate::active_window = 0; //### this should not be necessary +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) if (displayDC) { ReleaseDC(0, displayDC); displayDC = 0; } #endif +#endif } /*! diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 2fbc40dc11..c0ea725b7b 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -451,8 +451,11 @@ HBITMAP QWindowsXPStylePrivate::buffer(int w, int h) w = qMax(bufferW, w); h = qMax(bufferH, h); - if (!bufferDC) - bufferDC = CreateCompatibleDC(qt_win_display_dc()); + if (!bufferDC) { + HDC displayDC = GetDC(0); + bufferDC = CreateCompatibleDC(displayDC); + ReleaseDC(0, displayDC); + } // Define the header BITMAPINFO bmi; |