diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-28 12:36:27 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-28 12:36:27 (GMT) |
commit | 47ae1acdd9b6caaa8626e58fc97888dfdc821fe1 (patch) | |
tree | 609cf36ce14481eee745702f7dbede1cac0cb6b6 /src/gui/kernel/qwidget_mac.mm | |
parent | c9d26aa99c8f2279b54e6bb7ea68f30608e7e02a (diff) | |
download | Qt-47ae1acdd9b6caaa8626e58fc97888dfdc821fe1.zip Qt-47ae1acdd9b6caaa8626e58fc97888dfdc821fe1.tar.gz Qt-47ae1acdd9b6caaa8626e58fc97888dfdc821fe1.tar.bz2 |
Cocoa/Alien: fix qgraphicseffectsource autotest
The test discovered a serious bug where we for alien widgets on mac
returned a zero sized paintdevice. The reason is that we used to
ask the nsview backing the widget for its size, but with alien, there
where no such view. Very strange that this was not seen visually for
any of the many applications tested. This patch does the same
implementation strategy as found in QWidget::metric in qwidget_x11.cpp
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 1a1bb6e..3ba12cd 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4858,16 +4858,19 @@ int QWidget::metric(PaintDeviceMetric m) const case PdmWidthMM: return qRound(metric(PdmWidth) * 25.4 / qreal(metric(PdmDpiX))); case PdmHeight: - case PdmWidth: { + case PdmWidth: #ifndef QT_MAC_USE_COCOA - HIRect rect; + { HIRect rect; HIViewGetFrame(qt_mac_nativeview_for(this), &rect); -#else - NSRect rect = [qt_mac_nativeview_for(this) frame]; -#endif if(m == PdmWidth) return (int)rect.size.width; return (int)rect.size.height; } +#else + if (m == PdmWidth) + return data->crect.width(); + else + return data->crect.height(); +#endif case PdmDepth: return 32; case PdmNumColors: |