summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-04-25 09:06:28 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-04-25 09:06:28 (GMT)
commit9c160157d9617866ae792480a46877dcd82b9e91 (patch)
tree0f4610709807ad87536ebb19ba6df23c6eed43b9 /src/gui
parentdae9a234412d09c1af67a34262637bdc6e8c0845 (diff)
parent8b5a400581b9c037d12a9f49e075b187edcb0b00 (diff)
downloadQt-9c160157d9617866ae792480a46877dcd82b9e91.zip
Qt-9c160157d9617866ae792480a46877dcd82b9e91.tar.gz
Qt-9c160157d9617866ae792480a46877dcd82b9e91.tar.bz2
Merge branch '4.5' of git@scm.dev.troll.no:qt/qt
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget.cpp11
-rw-r--r--src/gui/painting/qpaintengine.cpp4
-rw-r--r--src/gui/painting/qpaintengine_p.h12
3 files changed, 16 insertions, 11 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index b38c4bd..1635912 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -4714,10 +4714,13 @@ void QWidget::render(QPaintDevice *target, const QPoint &targetOffset,
if (redirected) {
target = redirected;
offset -= redirectionOffset;
- if (!inRenderWithPainter) { // Clip handled by shared painter (in qpainter.cpp).
- const QRegion redirectedSystemClip = redirected->paintEngine()->systemClip();
- if (!redirectedSystemClip.isEmpty())
- paintRegion &= redirectedSystemClip.translated(-offset);
+ }
+
+ if (!inRenderWithPainter) { // Clip handled by shared painter (in qpainter.cpp).
+ if (QPaintEngine *targetEngine = target->paintEngine()) {
+ const QRegion targetSystemClip = targetEngine->systemClip();
+ if (!targetSystemClip.isEmpty())
+ paintRegion &= targetSystemClip.translated(-offset);
}
}
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index ad09060..7de1ec4 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -949,8 +949,8 @@ void QPaintEngine::setSystemClip(const QRegion &region)
Q_D(QPaintEngine);
d->systemClip = region;
// Be backward compatible and only call d->systemStateChanged()
- // if we currently have a system transform set.
- if (d->hasSystemTransform) {
+ // if we currently have a system transform/viewport set.
+ if (d->hasSystemTransform || d->hasSystemViewport) {
d->transformSystemClip();
d->systemStateChanged();
}
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index eeba7ec..0b5e175 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -83,10 +83,12 @@ public:
if (systemClip.isEmpty())
return;
- if (systemTransform.type() <= QTransform::TxTranslate)
- systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
- else
- systemClip = systemTransform.map(systemClip);
+ if (hasSystemTransform) {
+ if (systemTransform.type() <= QTransform::TxTranslate)
+ systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
+ else
+ systemClip = systemTransform.map(systemClip);
+ }
// Make sure we're inside the viewport.
if (hasSystemViewport) {
@@ -101,7 +103,7 @@ public:
inline void setSystemTransform(const QTransform &xform)
{
systemTransform = xform;
- if ((hasSystemTransform = !xform.isIdentity()))
+ if ((hasSystemTransform = !xform.isIdentity()) || hasSystemViewport)
transformSystemClip();
systemStateChanged();
}