diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-20 19:51:31 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-20 19:51:31 (GMT) |
commit | 1af6fc12def29e3f44dd7fcf5635c688902f29c8 (patch) | |
tree | 3731b65cb36ade6172ed47d27b47b4d358adc2a9 /src | |
parent | 0f42290719ebe6d930ba28fdf256e64d9c97be37 (diff) | |
download | Qt-1af6fc12def29e3f44dd7fcf5635c688902f29c8.zip Qt-1af6fc12def29e3f44dd7fcf5635c688902f29c8.tar.gz Qt-1af6fc12def29e3f44dd7fcf5635c688902f29c8.tar.bz2 |
Fix qpixmap*.cpp after latest QExplicitlySharedDataPointer changes.
static_cast'ing this pointer type is not possible. You must call data()
or constData() to get the actual pointer to cast.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 12 | ||||
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 16 | ||||
-rw-r--r-- | src/gui/image/qpixmap_win.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmap_x11.cpp | 6 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 7328853..00e78ad 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -643,13 +643,13 @@ void QPixmap::resize_helper(const QSize &s) QPixmap pm(QSize(w, h), data->type); bool uninit = false; #if defined(Q_WS_X11) - QX11PixmapData *x11Data = data->classId() == QPixmapData::X11Class ? static_cast<QX11PixmapData*>(data) : 0; + QX11PixmapData *x11Data = data->classId() == QPixmapData::X11Class ? static_cast<QX11PixmapData*>(data.data()) : 0; if (x11Data) { pm.x11SetScreen(x11Data->xinfo.screen()); uninit = x11Data->flags & QX11PixmapData::Uninitialized; } #elif defined(Q_WS_MAC) - QMacPixmapData *macData = data->classId() == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(data) : 0; + QMacPixmapData *macData = data->classId() == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(data.data()) : 0; if (macData) uninit = macData->uninit; #endif @@ -663,7 +663,7 @@ void QPixmap::resize_helper(const QSize &s) #if defined(Q_WS_X11) if (x11Data && x11Data->x11_mask) { - QX11PixmapData *pmData = static_cast<QX11PixmapData*>(pm.data); + QX11PixmapData *pmData = static_cast<QX11PixmapData*>(pm.data.data()); pmData->x11_mask = (Qt::HANDLE)XCreatePixmap(X11->display, RootWindow(x11Data->xinfo.display(), x11Data->xinfo.screen()), @@ -1158,7 +1158,7 @@ Qt::HANDLE QPixmap::handle() const { #if defined(Q_WS_X11) if (data->classId() == QPixmapData::X11Class) - return static_cast<QX11PixmapData*>(data)->handle(); + return static_cast<const QX11PixmapData*>(data.constData())->handle(); #endif return 0; } @@ -1917,7 +1917,7 @@ void QPixmap::detach() QImagePixmapCleanupHooks::executePixmapHooks(this); #if defined(Q_WS_MAC) - QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(data) : 0; + QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(data.data()) : 0; if (macData) { if (macData->cg_mask) { CGImageRelease(macData->cg_mask); @@ -1933,7 +1933,7 @@ void QPixmap::detach() #if defined(Q_WS_X11) if (data->classId() == QPixmapData::X11Class) { - QX11PixmapData *d = static_cast<QX11PixmapData*>(data); + QX11PixmapData *d = static_cast<QX11PixmapData*>(data.data()); d->flags &= ~QX11PixmapData::Uninitialized; // reset the cache data diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 5959da1..d1ec3d8 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -73,12 +73,12 @@ static int qt_pixmap_serial = 0; Q_GUI_EXPORT quint32 *qt_mac_pixmap_get_base(const QPixmap *pix) { - return static_cast<QMacPixmapData*>(pix->data)->pixels; + return static_cast<QMacPixmapData*>(pix->data.data())->pixels; } Q_GUI_EXPORT int qt_mac_pixmap_get_bytes_per_line(const QPixmap *pix) { - return static_cast<QMacPixmapData*>(pix->data)->bytesPerRow; + return static_cast<QMacPixmapData*>(pix->data.data())->bytesPerRow; } void qt_mac_cgimage_data_free(void *info, const void *memoryToFree, size_t) @@ -421,7 +421,7 @@ QPixmap QMacPixmapData::alphaChannel() const void QMacPixmapData::setAlphaChannel(const QPixmap &alpha) { has_mask = true; - QMacPixmapData *alphaData = static_cast<QMacPixmapData*>(alpha.data); + QMacPixmapData *alphaData = static_cast<QMacPixmapData*>(alpha.data.data()); macSetAlphaChannel(alphaData, false); } @@ -449,7 +449,7 @@ void QMacPixmapData::setMask(const QBitmap &mask) has_alpha = false; has_mask = true; - QMacPixmapData *maskData = static_cast<QMacPixmapData*>(mask.data); + QMacPixmapData *maskData = static_cast<QMacPixmapData*>(mask.data.data()); macSetAlphaChannel(maskData, true); } @@ -961,14 +961,14 @@ Qt::HANDLE QPixmap::macQDAlphaHandle() const Qt::HANDLE QPixmap::macCGHandle() const { if (data->classId() == QPixmapData::MacClass) { - QMacPixmapData *d = static_cast<QMacPixmapData *>(data); + QMacPixmapData *d = static_cast<QMacPixmapData *>(data.data()); if (!d->cg_data) d->macCreateCGImageRef(); CGImageRef ret = d->cg_data; CGImageRetain(ret); return ret; } else if (data->classId() == QPixmapData::RasterClass) { - return qt_mac_image_to_cgimage(static_cast<QRasterPixmapData *>(data)->image); + return qt_mac_image_to_cgimage(static_cast<QRasterPixmapData *>(data.data())->image); } return 0; } @@ -980,7 +980,7 @@ bool QMacPixmapData::hasAlphaChannel() const CGImageRef qt_mac_create_imagemask(const QPixmap &pixmap, const QRectF &sr) { - QMacPixmapData *px = static_cast<QMacPixmapData*>(pixmap.data); + QMacPixmapData *px = static_cast<QMacPixmapData*>(pixmap.data.data()); if (px->cg_mask) { if (px->cg_mask_rect == sr) { CGImageRetain(px->cg_mask); //reference for the caller @@ -1106,7 +1106,7 @@ void QMacPixmapData::copy(const QPixmapData *data, const QRect &rect) return; } - const QMacPixmapData *macData = static_cast<const QMacPixmapData*>(data); + const QMacPixmapData *macData = static_cast<const QMacPixmapData*>(data.constData()); resize(rect.width(), rect.height()); diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index b0f17ba..f12088d 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -123,7 +123,7 @@ HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const { HBITMAP bitmap = 0; if (data->classId() == QPixmapData::RasterClass) { - QRasterPixmapData* d = static_cast<QRasterPixmapData*>(data); + QRasterPixmapData* d = static_cast<QRasterPixmapData*>(data.data()); int w = d->image.width(); int h = d->image.height(); diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 047bd33..888fc42 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1875,7 +1875,7 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform, return bm; } else { // color pixmap QPixmap pm; - QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(pm.data); + QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(pm.data.data()); x11Data->flags &= ~QX11PixmapData::Uninitialized; x11Data->xinfo = xinfo; x11Data->d = d; @@ -1940,7 +1940,7 @@ void QPixmap::x11SetScreen(int screen) if (screen < 0) screen = QX11Info::appScreen(); - QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(data); + QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(data.data()); if (screen == x11Data->xinfo.screen()) return; // nothing to do @@ -2037,7 +2037,7 @@ bool QX11PixmapData::hasAlphaChannel() const const QX11Info &QPixmap::x11Info() const { if (data->classId() == QPixmapData::X11Class) - return static_cast<QX11PixmapData*>(data)->xinfo; + return static_cast<QX11PixmapData*>(data.data())->xinfo; else { static QX11Info nullX11Info; return nullX11Info; |