40 #include "private/qimagereaderwriterhelpers_p.h"
44 #include <private/qfactoryloader_p.h>
50 #ifndef QT_NO_IMAGEFORMATPLUGIN
63 const PluginKeyMap
keyMap = loader->keyMap();
71 plugin = qobject_cast<QImageIOPlugin *>(loader->instance(
i));
85 const int pluginCount = metaDataList.
size();
86 for (
int i = 0;
i < pluginCount; ++
i) {
91 const int keyCount =
keys.size();
92 for (
int k = 0; k < keyCount; ++k) {
97 resultKeys->append(
key);
105 loaderMutex()->lock();
107 loaderMutex()->unlock();
123 formats << _qt_BuiltInFormats[
i].extension;
125 #ifndef QT_NO_IMAGEFORMATPLUGIN
126 appendImagePluginFormats(loader(), pluginCapability(
cap), &formats);
129 std::sort(formats.
begin(), formats.
end());
138 for (
const auto &fmt : _qt_BuiltInFormats)
141 #ifndef QT_NO_IMAGEFORMATPLUGIN
142 appendImagePluginMimeTypes(loader(), pluginCapability(
cap), &mimeTypes);
145 std::sort(mimeTypes.
begin(), mimeTypes.
end());
146 mimeTypes.
erase(std::unique(mimeTypes.
begin(), mimeTypes.
end()), mimeTypes.
end());
155 for (
const auto &fmt : _qt_BuiltInFormats) {
156 if (fmt.mimeType ==
type && !formats.
contains(fmt.extension))
157 formats << fmt.extension;
161 #ifndef QT_NO_IMAGEFORMATPLUGIN
164 appendImagePluginMimeTypes(loader(), pluginCapability(
cap), &mimeTypes, &
keys);
165 for (
int i = 0;
i < mimeTypes.
size(); ++
i) {
166 if (mimeTypes.
at(
i) == mimeType) {
The QByteArray class provides an array of bytes.
bool startsWith(QByteArrayView bv) const
QByteArray mid(qsizetype index, qsizetype len=-1) const
The QCborArray class is used to hold an array of CBOR elements.
QCborValue at(qsizetype i) const
The QCborMap class is used to hold an associative container representable in CBOR.
QCborValue value(qint64 key) const
QString toString(const QString &defaultValue={}) const
QCborArray toArray() const
MetaDataList metaData() const
QObject * instance(int index) const
The QImageIOPlugin class defines an interface for writing an image format plugin. \reentrant.
virtual Capabilities capabilities(QIODevice *device, const QByteArray &format) const =0
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
qsizetype size() const noexcept
iterator erase(const_iterator begin, const_iterator end)
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
The QMutex class provides access serialization between threads.
The QSharedPointer class holds a strong reference to a shared pointer.
QByteArray toLatin1() const &
typename C::const_iterator const_iterator
PluginKeyMap::const_iterator PluginKeyMapConstIterator
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,(QImageIOHandlerFactoryInterface_iid, QLatin1String("/imageformats"))) static void appendImagePluginFormats(QFactoryLoader *loader
QList< QByteArray > imageFormatsForMimeType(const QByteArray &mimeType, Capability cap)
const PluginKeyMap keyMap
QSharedPointer< QFactoryLoader > pluginLoader()
QList< QByteArray > supportedImageFormats(Capability cap)
const PluginKeyMapConstIterator cend
QList< QByteArray > supportedMimeTypes(Capability cap)
#define QByteArrayLiteral(str)
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#define QImageIOHandlerFactoryInterface_iid
bool contains(const AT &t) const noexcept