summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-04 11:17:47 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-04 11:17:47 (GMT)
commitbe212bf108e71ba3b5b75802b1f4de6613ba315c (patch)
treec541ad12e8698f04e8fe386c2e1b94e8baca6c1b /src/gui/image
parent67ae1b0dac175f48875507f3187ed49276a29ddf (diff)
parente6bb00250b321b149dd80259dc4f479088d5949b (diff)
downloadQt-be212bf108e71ba3b5b75802b1f4de6613ba315c.zip
Qt-be212bf108e71ba3b5b75802b1f4de6613ba315c.tar.gz
Qt-be212bf108e71ba3b5b75802b1f4de6613ba315c.tar.bz2
Merge commit 'origin/master'
Conflicts: src/corelib/global/qglobal.h src/corelib/kernel/qmetatype.cpp src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/gui/graphicsview/qgraphicssceneevent.h src/gui/itemviews/qheaderview.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qgesture.h src/gui/kernel/qgesturerecognizer.h src/gui/painting/qpaintengine_raster.cpp src/network/access/qhttpnetworkreply.cpp src/network/access/qnetworkcookie.h src/network/socket/qnativesocketengine_unix.cpp
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimageiohandler.h2
-rw-r--r--src/gui/image/qmovie.h2
-rw-r--r--src/gui/image/qpaintengine_pic_p.h2
-rw-r--r--src/gui/image/qpicture.h2
-rw-r--r--src/gui/image/qpixmap.cpp25
-rw-r--r--src/gui/image/qpixmap_raster.cpp10
-rw-r--r--src/gui/image/qpixmap_s60.cpp4
-rw-r--r--src/gui/image/qpixmapcache.cpp3
-rw-r--r--src/gui/image/qpixmapfilter_p.h8
9 files changed, 36 insertions, 22 deletions
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index 50508c0..97b2ba2 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -60,7 +60,7 @@ class QVariant;
class QImageIOHandlerPrivate;
class Q_GUI_EXPORT QImageIOHandler
{
- Q_DECLARE_PRIVATE(QImageIOHandler)
+ Q_DECLARE_SCOPED_PRIVATE(QImageIOHandler)
public:
QImageIOHandler();
virtual ~QImageIOHandler();
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index afee789..eda5aa1 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -74,7 +74,7 @@ class QMoviePrivate;
class Q_GUI_EXPORT QMovie : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QMovie)
+ Q_DECLARE_SCOPED_PRIVATE(QMovie)
Q_ENUMS(MovieState CacheMode)
Q_PROPERTY(int speed READ speed WRITE setSpeed)
Q_PROPERTY(CacheMode cacheMode READ cacheMode WRITE setCacheMode)
diff --git a/src/gui/image/qpaintengine_pic_p.h b/src/gui/image/qpaintengine_pic_p.h
index 1e6413e..2aaa5f0 100644
--- a/src/gui/image/qpaintengine_pic_p.h
+++ b/src/gui/image/qpaintengine_pic_p.h
@@ -65,7 +65,7 @@ class QBuffer;
class QPicturePaintEngine : public QPaintEngine
{
- Q_DECLARE_PRIVATE(QPicturePaintEngine)
+ Q_DECLARE_SCOPED_PRIVATE(QPicturePaintEngine)
public:
QPicturePaintEngine();
~QPicturePaintEngine();
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index c323f0e..4d9af37 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -56,7 +56,7 @@ QT_MODULE(Gui)
class QPicturePrivate;
class Q_GUI_EXPORT QPicture : public QPaintDevice
{
- Q_DECLARE_PRIVATE(QPicture)
+ Q_DECLARE_SCOPED_PRIVATE(QPicture)
public:
explicit QPicture(int formatVersion = -1);
QPicture(const QPicture &);
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 44181d1..1bcb846 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -261,7 +261,12 @@ QPixmap::QPixmap(const QString& fileName, const char *format, Qt::ImageConversio
if (!qt_pixmap_thread_test())
return;
- load(fileName, format, flags);
+ QT_TRY {
+ load(fileName, format, flags);
+ } QT_CATCH(...) {
+ deref();
+ QT_RETHROW;
+ }
}
/*!
@@ -309,12 +314,17 @@ QPixmap::QPixmap(const char * const xpm[])
if (!xpm)
return;
- QImage image(xpm);
- if (!image.isNull()) {
- if (data->pixelType() == QPixmapData::BitmapType)
- *this = QBitmap::fromImage(image);
- else
- *this = fromImage(image);
+ QT_TRY {
+ QImage image(xpm);
+ if (!image.isNull()) {
+ if (data->pixelType() == QPixmapData::BitmapType)
+ *this = QBitmap::fromImage(image);
+ else
+ *this = fromImage(image);
+ }
+ } QT_CATCH(...) {
+ deref();
+ QT_RETHROW;
}
}
#endif
@@ -1894,7 +1904,6 @@ int QPixmap::defaultDepth()
#elif defined(Q_OS_SYMBIAN)
return S60->screenDepth;
#endif
-
}
/*!
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 9cc896b..e0d952a 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -172,9 +172,13 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
}
}
#endif
- w = image.d->width;
- h = image.d->height;
- d = image.d->depth;
+ if (image.d) {
+ w = image.d->width;
+ h = image.d->height;
+ d = image.d->depth;
+ } else {
+ w = h = d = 0;
+ }
is_null = (w <= 0 || h <= 0);
setSerialNumber(image.serialNumber());
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 132e26e..0460c30 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -82,7 +82,7 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
return QPixmap();
TDisplayMode displayMode = screenDevice->DisplayMode();
- CFbsBitmap* temporary = new (ELeave) CFbsBitmap();
+ CFbsBitmap* temporary = q_check_ptr(new CFbsBitmap()); // CBase derived object needs check on new
TInt error = temporary->Create(srcRect.Size(), displayMode);
if (error == KErrNone)
error = screenDevice->CopyScreenToBitmap(temporary, srcRect);
@@ -171,7 +171,7 @@ CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
return 0;
}
- CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+ CFbsBitmap* bitmap = q_check_ptr(new CFbsBitmap()); // CBase derived object needs check on new
TSize size(width(), height());
if (bitmap->Create(size, mode) != KErrNone) {
CBase::Delete(bitmap);
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index b4a3a49..aedc90c 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -368,7 +368,8 @@ void QPMCache::resizeKeyArray(int size)
{
if (size <= keyArraySize || size == 0)
return;
- keyArray = reinterpret_cast<int *>(realloc(keyArray, size * sizeof(int)));
+ keyArray = q_check_ptr(reinterpret_cast<int *>(realloc(keyArray,
+ size * sizeof(int))));
for (int i = keyArraySize; i != size; ++i)
keyArray[i] = i + 1;
keyArraySize = size;
diff --git a/src/gui/image/qpixmapfilter_p.h b/src/gui/image/qpixmapfilter_p.h
index 51292b3..83fc1b9 100644
--- a/src/gui/image/qpixmapfilter_p.h
+++ b/src/gui/image/qpixmapfilter_p.h
@@ -70,7 +70,7 @@ class QPixmapFilterPrivate;
class Q_GUI_EXPORT QPixmapFilter : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QPixmapFilter)
+ Q_DECLARE_SCOPED_PRIVATE(QPixmapFilter)
public:
virtual ~QPixmapFilter() = 0;
@@ -98,7 +98,7 @@ class QPixmapConvolutionFilterPrivate;
class Q_GUI_EXPORT QPixmapConvolutionFilter : public QPixmapFilter
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QPixmapConvolutionFilter)
+ Q_DECLARE_SCOPED_PRIVATE(QPixmapConvolutionFilter)
public:
QPixmapConvolutionFilter(QObject *parent = 0);
@@ -122,7 +122,7 @@ class QPixmapColorizeFilterPrivate;
class Q_GUI_EXPORT QPixmapColorizeFilter : public QPixmapFilter
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QPixmapColorizeFilter)
+ Q_DECLARE_SCOPED_PRIVATE(QPixmapColorizeFilter)
public:
QPixmapColorizeFilter(QObject *parent = 0);
@@ -138,7 +138,7 @@ class QPixmapDropShadowFilterPrivate;
class Q_GUI_EXPORT QPixmapDropShadowFilter : public QPixmapFilter
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QPixmapDropShadowFilter)
+ Q_DECLARE_SCOPED_PRIVATE(QPixmapDropShadowFilter)
public:
QPixmapDropShadowFilter(QObject *parent = 0);