diff options
author | Olli Werwolff <qt-info@nokia.com> | 2011-07-07 09:07:19 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@nokia.com> | 2011-07-07 14:20:07 +0200 |
commit | f9f04ea63d2489bd2ecb91c5a6bee4c4a869ac20 (patch) | |
tree | 5914b51c5bbe09f7e191d3a4d6ae52092225697f /src/widgets/kernel/qapplication_qpa.cpp | |
parent | d677aac93443a8e57955e4a0b9f09368090f6848 (diff) |
Use PlatformNativeInterface to obtain handles
Change-Id: I8cdf3d5477e72e89bcde46ccb6670320bf4dd797
Reviewed-on: http://codereview.qt.nokia.com/1270
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/widgets/kernel/qapplication_qpa.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication_qpa.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index dcda20138d..1b37ddf2e0 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -434,6 +434,18 @@ void qt_init(QApplicationPrivate *, int type) #endif } +#ifdef Q_OS_WIN +static HDC displayDC = 0; // display device context + +Q_WIDGETS_EXPORT HDC qt_win_display_dc() // get display DC +{ + Q_ASSERT(qApp && qApp->thread() == QThread::currentThread()); + if (!displayDC) + displayDC = GetDC(0); + return displayDC; +} +#endif + void qt_cleanup() { QPixmapCache::clear(); @@ -442,9 +454,14 @@ void qt_cleanup() QApplicationPrivate::inputContext = 0; QApplicationPrivate::active_window = 0; //### this should not be necessary +#ifdef Q_OS_WIN + if (displayDC) { + ReleaseDC(0, displayDC); + displayDC = 0; + } +#endif } - #ifdef QT3_SUPPORT void QApplication::setMainWidget(QWidget *mainWidget) { |