diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-08 08:55:35 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-08 10:33:19 +0200 |
commit | c64f19516dd2467bf5746eb24afe883bdbc15b25 (patch) | |
tree | 172ff1b48756d4b5440469c83799ed9dd8bd03c9 /src | |
parent | f009cff7f633e0ef9cebcca613b07df63d3e3d1a (diff) |
Use QList instead of QVector
Task-number: QTBUG-84469
Change-Id: I2edb875a4c3742adc9f52becb727e709a2beb7b9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/imageformats/icns/qicnshandler.cpp | 6 | ||||
-rw-r--r-- | src/plugins/imageformats/icns/qicnshandler_p.h | 6 | ||||
-rw-r--r-- | src/plugins/imageformats/shared/qiiofhelpers_p.h | 4 | ||||
-rw-r--r-- | src/plugins/imageformats/tiff/qtiffhandler.cpp | 12 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/imageformats/icns/qicnshandler.cpp b/src/plugins/imageformats/icns/qicnshandler.cpp index dde783c..05b8f5b 100644 --- a/src/plugins/imageformats/icns/qicnshandler.cpp +++ b/src/plugins/imageformats/icns/qicnshandler.cpp @@ -396,9 +396,9 @@ static inline QByteArray nameForCompressedIcon(quint8 iconNumber) return base + QByteArray::number(iconNumber); } -static inline QVector<QRgb> getColorTable(ICNSEntry::Depth depth) +static inline QList<QRgb> getColorTable(ICNSEntry::Depth depth) { - QVector<QRgb> table; + QList<QRgb> table; uint n = 1 << depth; const QRgb *data; switch (depth) { @@ -561,7 +561,7 @@ static QImage readLowDepthIcon(const ICNSEntry &icon, QDataStream &stream) const bool isMono = depth == ICNSEntry::DepthMono; const QImage::Format format = isMono ? QImage::Format_Mono : QImage::Format_Indexed8; - const QVector<QRgb> colortable = getColorTable(depth); + const QList<QRgb> colortable = getColorTable(depth); if (colortable.isEmpty()) return QImage(); QImage img(icon.width, icon.height, format); diff --git a/src/plugins/imageformats/icns/qicnshandler_p.h b/src/plugins/imageformats/icns/qicnshandler_p.h index e83d4eb..dc6aba1 100644 --- a/src/plugins/imageformats/icns/qicnshandler_p.h +++ b/src/plugins/imageformats/icns/qicnshandler_p.h @@ -42,7 +42,7 @@ #define QICNSHANDLER_P_H #include <QtGui/qimageiohandler.h> -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> #ifndef QT_NO_DATASTREAM @@ -155,8 +155,8 @@ private: }; int m_currentIconIndex; - QVector<ICNSEntry> m_icons; - QVector<ICNSEntry> m_masks; + QList<ICNSEntry> m_icons; + QList<ICNSEntry> m_masks; ScanState m_state; }; diff --git a/src/plugins/imageformats/shared/qiiofhelpers_p.h b/src/plugins/imageformats/shared/qiiofhelpers_p.h index 1b1771b..18862f1 100644 --- a/src/plugins/imageformats/shared/qiiofhelpers_p.h +++ b/src/plugins/imageformats/shared/qiiofhelpers_p.h @@ -54,7 +54,7 @@ #include <QImageIOPlugin> #include <private/qcore_mac_p.h> #include <ImageIO/ImageIO.h> -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE @@ -85,7 +85,7 @@ protected: bool getIntProperty(CFStringRef property, int *value); QImageIOHandler *q_ptr = nullptr; - QVector<QVariant> writeOptions; + QList<QVariant> writeOptions; QCFType<CGDataProviderRef> cgDataProvider = nullptr; QCFType<CGImageSourceRef> cgImageSource = nullptr; QCFType<CFDictionaryRef> cfImageDict = nullptr; diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index 091e640..b6c50b8 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler.cpp +++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp @@ -367,7 +367,7 @@ bool QTiffHandler::read(QImage *image) // Setup color tables if (format == QImage::Format_Mono || format == QImage::Format_Indexed8) { if (format == QImage::Format_Mono) { - QVector<QRgb> colortable(2); + QList<QRgb> colortable(2); if (d->photometric == PHOTOMETRIC_MINISBLACK) { colortable[0] = 0xff000000; colortable[1] = 0xffffffff; @@ -378,7 +378,7 @@ bool QTiffHandler::read(QImage *image) image->setColorTable(colortable); } else if (format == QImage::Format_Indexed8) { const uint16 tableSize = 256; - QVector<QRgb> qtColorTable(tableSize); + QList<QRgb> qtColorTable(tableSize); if (d->grayscale) { for (int i = 0; i<tableSize; ++i) { const int c = (d->photometric == PHOTOMETRIC_MINISBLACK) ? i : (255 - i); @@ -506,7 +506,7 @@ bool QTiffHandler::read(QImage *image) return true; } -static bool checkGrayscale(const QVector<QRgb> &colorTable) +static bool checkGrayscale(const QList<QRgb> &colorTable) { if (colorTable.size() != 256) return false; @@ -520,9 +520,9 @@ static bool checkGrayscale(const QVector<QRgb> &colorTable) return true; } -static QVector<QRgb> effectiveColorTable(const QImage &image) +static QList<QRgb> effectiveColorTable(const QImage &image) { - QVector<QRgb> colors; + QList<QRgb> colors; switch (image.format()) { case QImage::Format_Indexed8: colors = image.colorTable(); @@ -652,7 +652,7 @@ bool QTiffHandler::write(const QImage &image) || format == QImage::Format_Grayscale8 || format == QImage::Format_Grayscale16 || format == QImage::Format_Alpha8) { - QVector<QRgb> colorTable = effectiveColorTable(image); + QList<QRgb> colorTable = effectiveColorTable(image); bool isGrayscale = checkGrayscale(colorTable); if (isGrayscale) { uint16 photometric = PHOTOMETRIC_MINISBLACK; |