Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsharedimageloader_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSHAREDIMAGELOADER_H
6#define QSHAREDIMAGELOADER_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20
21#include <QImage>
22#include <QVariant>
23#include <QLoggingCategory>
24#include <qqml.h>
25
27
28Q_DECLARE_LOGGING_CATEGORY(lcSharedImage);
29
31
32class Q_LABSSHAREDIMAGE_EXPORT QSharedImageLoader : public QObject
33{
34 Q_OBJECT
35 Q_DECLARE_PRIVATE(QSharedImageLoader)
36
37 // We need to provide some type, in order to mention the 1.0 version.
38 QML_ANONYMOUS
39 QML_ADDED_IN_VERSION(1, 0)
40
41public:
42 typedef QVector<QVariant> ImageParameters;
43
44 QSharedImageLoader(QObject *parent = nullptr);
45 ~QSharedImageLoader();
46
47 QImage load(const QString &path, ImageParameters *params = nullptr);
48
49protected:
50 virtual QImage loadFile(const QString &path, ImageParameters *params);
51 virtual QString key(const QString &path, ImageParameters *params);
52
53private:
54 Q_DISABLE_COPY(QSharedImageLoader)
55};
56
57QT_END_NAMESPACE
58
59#endif // QSHAREDIMAGELOADER_H
void storeImageToMem(void *data, const QImage &img)
bool verifyMem(const void *data, int size)
QImage createImageFromMem(const void *data, void *cleanupInfo)
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
Q_STATIC_ASSERT(sizeof(SharedImageHeader) % 4==0)
void cleanupSharedImage(void *)