summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-21 00:43:19 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-21 00:43:19 (GMT)
commitf6b1582d726f97d8be4b30f0f6da2350220f27c5 (patch)
tree64bcea1b8b3cc8f94073a9e83b36b2b40ad990e8 /src/gui/image/qpixmap.cpp
parent110c58a20f3158143d83ebea4f2ece4f7925f913 (diff)
parent7bd7f5ec6eb520b7d9940a24817b17132d9ed6a2 (diff)
downloadQt-f6b1582d726f97d8be4b30f0f6da2350220f27c5.zip
Qt-f6b1582d726f97d8be4b30f0f6da2350220f27c5.tar.gz
Qt-f6b1582d726f97d8be4b30f0f6da2350220f27c5.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r--src/gui/image/qpixmap.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 558ae54..c03a364 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -361,13 +361,7 @@ QPixmap QPixmap::copy(const QRect &rect) const
const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect;
- QPixmapData *d;
- QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem();
- if (gs)
- d = gs->createPixmapData(data->pixelType());
- else
- d = QGraphicsSystem::createDefaultPixmapData(data->pixelType());
-
+ QPixmapData *d = data->createCompatiblePixmapData();
d->copy(data.data(), r);
return QPixmap(d);
}
@@ -947,6 +941,9 @@ bool QPixmap::doImageIO(QImageWriter *writer, int quality) const
/*!
Fills the pixmap with the given \a color.
+ The effect of this function is undefined when the pixmap is
+ being painted on.
+
\sa {QPixmap#Pixmap Transformations}{Pixmap Transformations}
*/
@@ -955,6 +952,13 @@ void QPixmap::fill(const QColor &color)
if (isNull())
return;
+ // Some people are probably already calling fill while a painter is active, so to not break
+ // their programs, only print a warning and return when the fill operation could cause a crash.
+ if (paintingActive() && (color.alpha() != 255) && !hasAlphaChannel()) {
+ qWarning("QPixmap::fill: Cannot fill while pixmap is being painted on");
+ return;
+ }
+
detach();
data->fill(color);
}
@@ -1663,10 +1667,10 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
identifies the contents of the QPixmap object.
The x11Info() function returns information about the configuration
- of the X display used to display the widget. The
- x11PictureHandle() function returns the X11 Picture handle of the
- pixmap for XRender support. Note that the two latter functions are
- only available on x11.
+ of the X display used by the screen to which the pixmap currently
+ belongs. The x11PictureHandle() function returns the X11 Picture
+ handle of the pixmap for XRender support. Note that the two latter
+ functions are only available on x11.
\endtable
@@ -2084,7 +2088,7 @@ QPixmapData* QPixmap::pixmapData() const
/*! \fn const QX11Info &QPixmap::x11Info() const
\bold{X11 only:} Returns information about the configuration of
- the X display used to display the widget.
+ the X display used by the screen to which the pixmap currently belongs.
\warning This function is only available on X11.