diff options
Diffstat (limited to 'src/gui/image/qbitmap.cpp')
-rw-r--r-- | src/gui/image/qbitmap.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp index de4981f..e239022 100644 --- a/src/gui/image/qbitmap.cpp +++ b/src/gui/image/qbitmap.cpp @@ -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 @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE 0 for black and 1 for white. The QBitmap class provides the transformed() function returning a - transformed copy of the bitmap; use the QMatrix argument to + transformed copy of the bitmap; use the QTransform argument to translate, scale, shear, and rotate the bitmap. In addition, QBitmap provides the static fromData() function which returns a bitmap constructed from the given \c uchar data, and the static @@ -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()); } /*! @@ -318,6 +315,7 @@ QBitmap QBitmap::transformed(const QTransform &matrix) const /*! \overload + \obsolete This convenience function converts the \a matrix to a QTransform and calls the overloaded function. |