summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-10-30 12:42:27 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-30 12:42:27 (GMT)
commitdc1b1b37e1ebe055d3bd46bc43e0c3b9612560bc (patch)
tree05f9f9bc92322c9b42257c00ae2df14700fdd35f /src/gui/kernel/qwidget.cpp
parent79a7c969983eafeef67cce28724c3981cf3af1ea (diff)
parente95e69f7d1209cceacdef0f26416b93c1d83e8e0 (diff)
downloadQt-dc1b1b37e1ebe055d3bd46bc43e0c3b9612560bc.zip
Qt-dc1b1b37e1ebe055d3bd46bc43e0c3b9612560bc.tar.gz
Qt-dc1b1b37e1ebe055d3bd46bc43e0c3b9612560bc.tar.bz2
Merge commit 'origin/4.6' into 4.6
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 1951ab2..75bdd73 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5433,7 +5433,8 @@ void QWidgetEffectSourcePrivate::draw(QPainter *painter)
context->sharedPainter, context->backingStore);
}
-QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset) const
+QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset,
+ QGraphicsEffectSource::PixmapPadMode mode) const
{
const bool deviceCoordinates = (system == Qt::DeviceCoordinates);
if (!context && deviceCoordinates) {
@@ -5451,7 +5452,20 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
pixmapOffset = painterTransform.map(pixmapOffset);
}
- QRect effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect();
+
+ QRect effectRect;
+
+ if (mode == QGraphicsEffectSource::ExpandToEffectRectPadMode) {
+ effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect();
+
+ } else if (mode == QGraphicsEffectSource::ExpandToTransparentBorderPadMode) {
+ effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect();
+
+ } else {
+ effectRect = sourceRect.toAlignedRect();
+
+ }
+
if (offset)
*offset = effectRect.topLeft();