summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qbitmap.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-08-19 11:57:27 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-08-19 11:57:27 (GMT)
commitd9e03376f9f82e5664dfd2446ff4c05e35ffb535 (patch)
tree711f77f7d307c05a3ae310b1fd59bbce74bd8eab /src/gui/image/qbitmap.cpp
parent98d4c657803d5f1956560bd9b62e73f15c05e8fd (diff)
parentca0b5b503e8865c0eedeea86aa132291281fc49f (diff)
downloadQt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.zip
Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.tar.gz
Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.tar.bz2
Merged in DummyPlayer changes
Diffstat (limited to 'src/gui/image/qbitmap.cpp')
-rw-r--r--src/gui/image/qbitmap.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index 78c3396..e239022 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\class QBitmap
\brief The QBitmap class provides monochrome (1-bit depth) pixmaps.
- \ingroup multimedia
+ \ingroup painting
\ingroup shared
The QBitmap class is a monochrome off-screen paint device used
@@ -265,15 +265,12 @@ QBitmap QBitmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
img.setColor(1, c0);
}
- QPixmapData *d;
QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem();
- if (gs)
- d = gs->createPixmapData(QPixmapData::BitmapType);
- else
- d = QGraphicsSystem::createDefaultPixmapData(QPixmapData::BitmapType);
+ QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::BitmapType)
+ : QGraphicsSystem::createDefaultPixmapData(QPixmapData::BitmapType));
- d->fromImage(img, flags | Qt::MonoOnly);
- return QPixmap(d);
+ data->fromImage(img, flags | Qt::MonoOnly);
+ return QPixmap(data.take());
}
/*!