summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-10-01 14:43:14 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-10-01 14:43:14 (GMT)
commit284c786c04f62a04992e9f62d71c261894856599 (patch)
treec90f46848333c65fea62a2dc3eb1420116433063 /src/gui/kernel/qapplication_s60.cpp
parentf00aeb98d457b16ac90e98f3dd18bf4f53fefeb3 (diff)
downloadQt-284c786c04f62a04992e9f62d71c261894856599.zip
Qt-284c786c04f62a04992e9f62d71c261894856599.tar.gz
Qt-284c786c04f62a04992e9f62d71c261894856599.tar.bz2
Map redraw rectangle into co-ordinate system of backing store, for native child widgets
The implementation of QSymbianControl::Draw previously assumed that the co-ordinate system of the control always matched that of the backing store - in other words, that the only widget for which a QSymbianControl was created would be the top-level widget. Now that create_sys has been modified to create a native window (and therefore a QSymbianControl) for child widgets on which winId() is called, this assumption is no longer valid. This function has therefore been modified to map the redraw rectangle into the coordinate system of the backing store.
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 71d0cd1..d8a4c19 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -777,7 +777,7 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const
}
#endif
-void QSymbianControl::Draw(const TRect& r) const
+void QSymbianControl::Draw(const TRect& controlRect) const
{
QWindowSurface *surface = qwidget->windowSurface();
QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL;
@@ -785,6 +785,11 @@ void QSymbianControl::Draw(const TRect& r) const
if (!engine)
return;
+ // Map source rectangle into coordinates of the backing store.
+ const QPoint controlBase(controlRect.iTl.iX, controlRect.iTl.iY);
+ const QPoint backingStoreBase = qwidget->mapTo(qwidget->window(), controlBase);
+ const TRect backingStoreRect(TPoint(backingStoreBase.x(), backingStoreBase.y()), controlRect.Size());
+
if (engine->type() == QPaintEngine::Raster) {
QS60WindowSurface *s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface());
CFbsBitmap *bitmap = s60Surface->symbianBitmap();
@@ -793,10 +798,10 @@ void QSymbianControl::Draw(const TRect& r) const
if(!qwidget->d_func()->extraData()->disableBlit) {
if (qwidget->d_func()->isOpaque)
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
- gc.BitBlt(r.iTl, bitmap, r);
- }
+ gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect);
+ }
} else {
- surface->flush(qwidget, QRegion(qt_TRect2QRect(r)), QPoint());
+ surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());
}
}