Replace QList<QByteArray> with QByteArrayList

This commit is contained in:
Jonas Kvinge
2023-03-18 19:41:36 +01:00
parent 16b4f5d065
commit 394955a03f
7 changed files with 22 additions and 16 deletions

View File

@@ -17,12 +17,12 @@
*
*/
#include <QList>
#include <QBuffer>
#include <QByteArray>
#include <QByteArrayList>
#include <QString>
#include <QStringList>
#include <QUrl>
#include <QBuffer>
#include <QImage>
#include <QImageReader>
#include <QPixmap>
@@ -61,16 +61,16 @@ QStringList ImageUtils::SupportedImageFormats() {
}
QList<QByteArray> ImageUtils::ImageFormatsForMimeType(const QByteArray &mimetype) {
QByteArrayList ImageUtils::ImageFormatsForMimeType(const QByteArray &mimetype) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
return QImageReader::imageFormatsForMimeType(mimetype);
#else
if (mimetype == "image/bmp") return QList<QByteArray>() << "BMP";
else if (mimetype == "image/gif") return QList<QByteArray>() << "GIF";
else if (mimetype == "image/jpeg") return QList<QByteArray>() << "JPG";
else if (mimetype == "image/png") return QList<QByteArray>() << "PNG";
else return QList<QByteArray>();
if (mimetype == "image/bmp") return QByteArrayList() << "BMP";
else if (mimetype == "image/gif") return QByteArrayList() << "GIF";
else if (mimetype == "image/jpeg") return QByteArrayList() << "JPG";
else if (mimetype == "image/png") return QByteArrayList() << "PNG";
else return QByteArrayList();
#endif
}