summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_win.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-04-07 12:57:24 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-07-02 10:24:54 (GMT)
commitac2818bef95f1347e80be8ce847f2557339b76e0 (patch)
tree29564bc90219b3a55059bc0df9496d9363c665e6 /src/gui/kernel/qwidget_win.cpp
parent15ac2bc856735cdd81dde9f3d3dc2c47177ef814 (diff)
downloadQt-ac2818bef95f1347e80be8ce847f2557339b76e0.zip
Qt-ac2818bef95f1347e80be8ce847f2557339b76e0.tar.gz
Qt-ac2818bef95f1347e80be8ce847f2557339b76e0.tar.bz2
Make it possible to call QWidget::metric() from a different thread.
Under Windows.
Diffstat (limited to 'src/gui/kernel/qwidget_win.cpp')
-rw-r--r--src/gui/kernel/qwidget_win.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 9d96fcb..60ba879 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -1633,8 +1633,6 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
}
}
-extern Q_GUI_EXPORT HDC qt_win_display_dc();
-
int QWidget::metric(PaintDeviceMetric m) const
{
Q_D(const QWidget);
@@ -1644,7 +1642,7 @@ int QWidget::metric(PaintDeviceMetric m) const
} else if (m == PdmHeight) {
val = data->crect.height();
} else {
- HDC gdc = qt_win_display_dc();
+ HDC gdc = GetDC(0);
switch (m) {
case PdmDpiX:
case PdmPhysicalDpiX:
@@ -1695,6 +1693,7 @@ int QWidget::metric(PaintDeviceMetric m) const
val = 0;
qWarning("QWidget::metric: Invalid metric command");
}
+ ReleaseDC(0, gdc);
}
return val;
}