summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintdevice.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-15 06:26:19 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-15 06:49:48 (GMT)
commit8b568a5afd24ecb343b7508bf6b27b27af59b226 (patch)
treee792a660a9dac1c514ef31b29080e84907671871 /src/gui/painting/qpaintdevice.cpp
parent1f73b205ec57be6327f62ef39099358425a7f0a8 (diff)
downloadQt-8b568a5afd24ecb343b7508bf6b27b27af59b226.zip
Qt-8b568a5afd24ecb343b7508bf6b27b27af59b226.tar.gz
Qt-8b568a5afd24ecb343b7508bf6b27b27af59b226.tar.bz2
qt_paint_device_metric() for fetching metrics
Custom window surfaces, graphics systems, and Qt/Embedded screen drivers often need to access QPaintDevice::metric(), but it is protected. Hence the growing number of friends in QWidget and QImage. The qt_paint_device_metric() function provides a more future-proof approach that doesn't require lots of friends. Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/painting/qpaintdevice.cpp')
-rw-r--r--src/gui/painting/qpaintdevice.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index 95c0b44..6114938 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -65,4 +65,9 @@ int QPaintDevice::metric(PaintDeviceMetric) const
return 0;
}
+Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric)
+{
+ return device->metric(metric);
+}
+
QT_END_NAMESPACE