From e778042ed7dc5c12aeea0dfcd5401bc9d002dc53 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 28 Jan 2013 11:17:55 +0800 Subject: Doc, Qt GUI: Fix "no \inmodule command" warnings Explicitly add "\inmodule QtGui" to Qt GUI classes Change-Id: Id641c1dc98770fbd994cecc375ca46c01f083236 Reviewed-by: Friedemann Kleint Reviewed-by: Jerome Pasion --- src/gui/image/qpicture.cpp | 1 + src/gui/image/qpictureformatplugin.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src/gui/image') diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index bfc31930dd..f6de22851d 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -1278,6 +1278,7 @@ QList QPicture::outputFormats() \ingroup painting \ingroup io + \inmodule QtGui QPictureIO contains a QIODevice object that is used for picture data I/O. The programmer can install new picture file formats in addition diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp index bef72595ad..29d6912201 100644 --- a/src/gui/image/qpictureformatplugin.cpp +++ b/src/gui/image/qpictureformatplugin.cpp @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE for custom picture format plugins. \ingroup plugins + \inmodule QtGui The picture format plugin is a simple plugin interface that makes it easy to create custom picture formats that can be used -- cgit v1.2.3 From f262815f2ef147113780312a410eccdf4b318a82 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 26 Jan 2013 13:39:56 +0100 Subject: Fix some more old references and links to Nokia Task-number: QTBUG-28156 Change-Id: I9ba0d6f1e92103219bec1e61e716b6b2f269a8ad Reviewed-by: Laszlo Papp Reviewed-by: Jerome Pasion --- src/gui/image/qpixmapcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index c9560fd816..f996d032b8 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE memory. The \e{Qt Quarterly} article - \l{http://qt.nokia.com/doc/qq/qq12-qpixmapcache.html}{Optimizing + \l{http://doc.qt.digia.com/qq/qq12-qpixmapcache.html}{Optimizing with QPixmapCache} explains how to use QPixmapCache to speed up applications by caching the results of painting. -- cgit v1.2.3 From 8995453263721507a4c923b905f50f800010d9ad Mon Sep 17 00:00:00 2001 From: Poul Sysolyatin Date: Mon, 21 Jan 2013 13:48:21 +0700 Subject: Added 'jpeg' to QImageReader::supportedImageFormats() When Qt build statically result of QImageReader::supportedImageFormats() must contain 'jpeg' and 'jpg' if JPEG support enabled. Task-number: QTBUG-29222 Change-Id: I94d731c2d1e2ede148e2e5261a310a840a1d5523 Reviewed-by: Gunnar Sletta --- src/gui/image/qimagereader.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/image') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 71408ecd23..a6e15ede11 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -162,6 +162,7 @@ enum _qt_BuiltInFormatType { #endif #ifndef QT_NO_IMAGEFORMAT_JPEG _qt_JpgFormat, + _qt_JpegFormat, #endif #ifdef QT_BUILTIN_GIF_READER _qt_GifFormat, @@ -194,6 +195,7 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = { #endif #ifndef QT_NO_IMAGEFORMAT_JPEG {_qt_JpgFormat, "jpg"}, + {_qt_JpegFormat, "jpeg"}, #endif #ifdef QT_BUILTIN_GIF_READER {_qt_GifFormat, "gif"}, @@ -422,6 +424,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, #endif #ifndef QT_NO_IMAGEFORMAT_JPEG case _qt_JpgFormat: + case _qt_JpegFormat: if (QJpegHandler::canRead(device)) handler = new QJpegHandler; break; -- cgit v1.2.3 From 9d432881804edc3f680de610e40b669f97df6f9b Mon Sep 17 00:00:00 2001 From: Poul Sysolyatin Date: Mon, 21 Jan 2013 14:00:07 +0700 Subject: Exclude BMP from supported formats if it disabled by Qt build If Qt build without BMP support, we need exclude this format from output of QImageWriter::supportedImageFormats() and QImageReader::supportedImageFormats() methods. Task-number: QTBUG-27028 Change-Id: I44e8956247066c0836b1ff7bf9a1f356fe568af1 Reviewed-by: Gunnar Sletta --- src/gui/image/qimagereader.cpp | 4 ++++ src/gui/image/qimagewriter.cpp | 2 ++ 2 files changed, 6 insertions(+) (limited to 'src/gui/image') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index a6e15ede11..5eaf7bb8f2 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -167,7 +167,9 @@ enum _qt_BuiltInFormatType { #ifdef QT_BUILTIN_GIF_READER _qt_GifFormat, #endif +#ifndef QT_NO_IMAGEFORMAT_BMP _qt_BmpFormat, +#endif #ifndef QT_NO_IMAGEFORMAT_PPM _qt_PpmFormat, _qt_PgmFormat, @@ -200,7 +202,9 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = { #ifdef QT_BUILTIN_GIF_READER {_qt_GifFormat, "gif"}, #endif +#ifndef QT_NO_IMAGEFORMAT_BMP {_qt_BmpFormat, "bmp"}, +#endif #ifndef QT_NO_IMAGEFORMAT_PPM {_qt_PpmFormat, "ppm"}, {_qt_PgmFormat, "pgm"}, diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 8e0f3fdcf0..20e601be03 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -708,7 +708,9 @@ void supportedImageHandlerFormats(QFactoryLoader *loader, QList QImageWriter::supportedImageFormats() { QSet formats; +#ifndef QT_NO_IMAGEFORMAT_BMP formats << "bmp"; +#endif #ifndef QT_NO_IMAGEFORMAT_PPM formats << "pbm" << "pgm" << "ppm"; #endif -- cgit v1.2.3 From a9458a175598a0da0fdfbfed7f9470878af25b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 24 Jan 2013 09:09:28 +0100 Subject: Clean up logical dpi for QImage. Revert to the pre highdpi-patch behaviour. Before, both physical and logical DPI would be based on the dpmx/dpmy variables, which could be changed with setDotsPerMeter(). The highdpi patch introduced separate ldpmx/ldpmy variables, which were not changed by setDotsPerMeter(). This broke when loading images: setDotsPerMeter would be called but the logical dpi would not change. Remove ldpmx/ldpmy. Keep scaling the physical dpi by the devicePixelRatio, which will be set to 1 by default. Task-number: QTBUG-29187 Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282 Reviewed-by: Gunnar Sletta --- src/gui/image/qimage.cpp | 6 ++---- src/gui/image/qimage_p.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index de1e555771..975ef54d6b 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -99,8 +99,6 @@ QImageData::QImageData() format(QImage::Format_ARGB32), bytes_per_line(0), ser_no(qimage_serial_number.fetchAndAddRelaxed(1)), detach_no(0), - ldpmx(qt_defaultDpiX() * 100 / qreal(2.54)), - ldpmy(qt_defaultDpiY() * 100 / qreal(2.54)), dpmx(qt_defaultDpiX() * 100 / qreal(2.54)), dpmy(qt_defaultDpiY() * 100 / qreal(2.54)), offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false), @@ -4984,11 +4982,11 @@ int QImage::metric(PaintDeviceMetric metric) const return d->depth; case PdmDpiX: - return qRound(d->ldpmx * 0.0254); + return qRound(d->dpmx * 0.0254); break; case PdmDpiY: - return qRound(d->ldpmy * 0.0254); + return qRound(d->dpmy * 0.0254); break; case PdmPhysicalDpiX: diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index e79eb9d562..18c686e917 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -82,10 +82,8 @@ struct Q_GUI_EXPORT QImageData { // internal image data int ser_no; // serial number int detach_no; - qreal ldpmx; // logical dots per meter X (or 0) - qreal ldpmy; // logical dots per meter Y (or 0) - qreal dpmx; // device dots per meter X (or 0) - qreal dpmy; // device dots per meter Y (or 0) + qreal dpmx; // dots per meter X (or 0) + qreal dpmy; // dots per meter Y (or 0) QPoint offset; // offset in pixels uint own_data : 1; -- cgit v1.2.3 From 85b2ba2a928ee9c50d2b8191851f2ef816a52412 Mon Sep 17 00:00:00 2001 From: Julien Brianceau Date: Tue, 5 Feb 2013 12:00:49 +0100 Subject: doc: Fix QPixmapCache size default value in doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPixmapCache size default value is always 10 Mb since change I2ac33765 Change-Id: I28c99433948b07e9c84d0afda7aa5a8f49d2cd18 Reviewed-by: Samuel Rødal --- src/gui/image/qpixmapcache.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 4a8330d9f3..f4d2afed7a 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -75,10 +75,8 @@ QT_BEGIN_NAMESPACE behavior of the QHash and QCache classes. The cache becomes full when the total size of all pixmaps in the - cache exceeds cacheLimit(). The initial cache limit is - 2048 KB (2 MB) on embedded platforms, 10240 KB (10 MB) on desktop - platforms; you can change this by calling setCacheLimit() with the - required value. + cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); + you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (\e{width} * \e{height} * \e{depth})/8 bytes of memory. @@ -90,7 +88,7 @@ QT_BEGIN_NAMESPACE \sa QCache, QPixmap */ -static int cache_limit = 10240; // 10 MB cache limit for desktop +static int cache_limit = 10240; // 10 MB cache limit /*! \class QPixmapCache::Key @@ -596,8 +594,7 @@ bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap) /*! Returns the cache limit (in kilobytes). - The default cache limit is 2048 KB on embedded platforms, 10240 KB on - desktop platforms. + The default cache limit is 10240 KB. \sa setCacheLimit() */ @@ -610,8 +607,7 @@ int QPixmapCache::cacheLimit() /*! Sets the cache limit to \a n kilobytes. - The default setting is 2048 KB on embedded platforms, 10240 KB on - desktop platforms. + The default setting is 10240 KB. \sa cacheLimit() */ -- cgit v1.2.3 From af84313c622af880e95d461ea8b7dbca58d2dffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 5 Feb 2013 09:44:26 +0100 Subject: Fixed crash in image reader when reading certain BMP files. If the high bit in a mask is set, for instance if the mask is 0xff000000, and we shift it to the right by 24 positions, since the mask was not declared as unsigned we ended up with a mask value of 0xffffffff. We then add 1 to this value and divide by the result, causing a division by zero crash. The masks need to be declared unsigned to prevent sign bit extension when shifting right. Task-number: QTBUG-29194 Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999 Reviewed-by: Gunnar Sletta --- src/gui/image/qbmphandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp index 062714c769..6abde5e420 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -143,7 +143,7 @@ static QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi) return s; } -static int calc_shift(int mask) +static int calc_shift(uint mask) { int result = 0; while (mask && !(mask & 1)) { @@ -207,9 +207,9 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int #endif int w = bi.biWidth, h = bi.biHeight, nbits = bi.biBitCount; int t = bi.biSize, comp = bi.biCompression; - int red_mask = 0; - int green_mask = 0; - int blue_mask = 0; + uint red_mask = 0; + uint green_mask = 0; + uint blue_mask = 0; int red_shift = 0; int green_shift = 0; int blue_shift = 0; -- cgit v1.2.3 From 62d25e4d4f02a53da25b9f14cc9e0244d6655312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 12 Feb 2013 12:58:08 +0100 Subject: Fixed QPixmapCache associating path with wrong QPixmap. QPixmap::load() would not detach, so multiple paths could get associated with the same QPixmap, causing the wrong pixmap to be shown. Task-number: QTBUG-29639 Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62 Reviewed-by: aavit --- src/gui/image/qpixmap.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/image') diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 852025117b..b6a21f588e 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -760,6 +760,8 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers return false; } + detach(); + QFileInfo info(fileName); QString key = QLatin1String("qt_pixmap") % info.absoluteFilePath() -- cgit v1.2.3