summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qbitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image/qbitmap.cpp')
-rw-r--r--src/gui/image/qbitmap.cpp105
1 files changed, 8 insertions, 97 deletions
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index c0cab83926..f32c517f17 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -40,12 +40,12 @@
****************************************************************************/
#include "qbitmap.h"
-#include "qpixmapdata_p.h"
+#include "qplatformpixmap_qpa.h"
#include "qimage.h"
+#include "qscreen.h"
#include "qvariant.h"
#include <qpainter.h>
-#include <private/qgraphicssystem_p.h>
-#include <private/qapplication_p.h>
+#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
@@ -102,7 +102,7 @@ QT_BEGIN_NAMESPACE
\sa QPixmap::isNull()
*/
QBitmap::QBitmap()
- : QPixmap(QSize(0, 0), QPixmapData::BitmapType)
+ : QPixmap(QSize(0, 0), QPlatformPixmap::BitmapType)
{
}
@@ -116,7 +116,7 @@ QBitmap::QBitmap()
*/
QBitmap::QBitmap(int w, int h)
- : QPixmap(QSize(w, h), QPixmapData::BitmapType)
+ : QPixmap(QSize(w, h), QPlatformPixmap::BitmapType)
{
}
@@ -128,7 +128,7 @@ QBitmap::QBitmap(int w, int h)
*/
QBitmap::QBitmap(const QSize &size)
- : QPixmap(size, QPixmapData::BitmapType)
+ : QPixmap(size, QPlatformPixmap::BitmapType)
{
}
@@ -173,7 +173,7 @@ QBitmap::QBitmap(const QPixmap &pixmap)
*/
QBitmap::QBitmap(const QString& fileName, const char *format)
- : QPixmap(QSize(0, 0), QPixmapData::BitmapType)
+ : QPixmap(QSize(0, 0), QPlatformPixmap::BitmapType)
{
load(fileName, format, Qt::MonoOnly);
}
@@ -205,20 +205,6 @@ QBitmap &QBitmap::operator=(const QPixmap &pixmap)
return *this;
}
-
-#ifdef QT3_SUPPORT
-QBitmap::QBitmap(int w, int h, const uchar *bits, bool isXbitmap)
-{
- *this = fromData(QSize(w, h), bits, isXbitmap ? QImage::Format_MonoLSB : QImage::Format_Mono);
-}
-
-
-QBitmap::QBitmap(const QSize &size, const uchar *bits, bool isXbitmap)
-{
- *this = fromData(size, bits, isXbitmap ? QImage::Format_MonoLSB : QImage::Format_Mono);
-}
-#endif
-
/*!
Destroys the bitmap.
*/
@@ -275,9 +261,7 @@ QBitmap QBitmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
img.setColor(1, c0);
}
- QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem();
- QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::BitmapType)
- : QGraphicsSystem::createDefaultPixmapData(QPixmapData::BitmapType));
+ QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::BitmapType));
data->fromImage(img, flags | Qt::MonoOnly);
return QPixmap(data.take());
@@ -335,77 +319,4 @@ QBitmap QBitmap::transformed(const QMatrix &matrix) const
return transformed(QTransform(matrix));
}
-#ifdef QT3_SUPPORT
-/*!
- \fn QBitmap QBitmap::xForm(const QMatrix &matrix) const
-
- Returns a copy of this bitmap, transformed according to the given
- \a matrix.
-
- Use transformed() instead.
-*/
-
-/*!
- \fn QBitmap::QBitmap(const QSize &size, bool clear)
-
- Constructs a bitmap with the given \a size. If \a clear is true,
- the bits are initialized to Qt::color0.
-
- Use the corresponding QBitmap() constructor instead, and then call
- the clear() function if the \a clear parameter is true.
-*/
-
-/*!
- \fn QBitmap::QBitmap(int width, int height, bool clear)
-
- Constructs a bitmap with the given \a width and \a height. If \a
- clear is true, the bits are initialized to Qt::color0.
-
- Use the corresponding QBitmap() constructor instead, and then call
- the clear() function if the \a clear parameter is true.
-*/
-
-/*!
- \fn QBitmap::QBitmap(int width, int height, const uchar *bits, bool isXbitmap)
-
- Constructs a bitmap with the given \a width and \a height, and
- sets the contents to the \a bits supplied. The \a isXbitmap flag
- should be true if \a bits was generated by the X11 bitmap
- program.
-
- Use the static fromData() function instead. If \a isXbitmap is
- true, use the default bit order(QImage_FormatMonoLSB) otherwise
- use QImage::Format_Mono.
-
- \omit
- The X bitmap bit order is little endian. The QImage
- documentation discusses bit order of monochrome images. Opposed to
- QImage, the data has to be byte aligned.
-
- Example (creates an arrow bitmap):
- \snippet doc/src/snippets/code/src_gui_image_qbitmap.cpp 0
- \endomit
-*/
-
-
-/*!
- \fn QBitmap::QBitmap(const QSize &size, const uchar *bits, bool isXbitmap)
-
- \overload
-
- Constructs a bitmap with the given \a size, and sets the contents
- to the \a bits supplied. The \a isXbitmap flag should be true if
- \a bits was generated by the X11 bitmap program.
-
- \omit
- The X bitmap bit order is little endian. The QImage documentation
- discusses bit order of monochrome images.
- \endomit
-
- Use the static fromData() function instead. If \a isXbitmap is
- true, use the default bit order(QImage_FormatMonoLSB) otherwise
- use QImage::Format_Mono.
-*/
-#endif
-
QT_END_NAMESPACE