Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qxpmhandler_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 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
QXPMHANDLER_P_H
6
#
define
QXPMHANDLER_P_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
19
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
20
#
include
"QtGui/qimageiohandler.h"
21
22
#
ifndef
QT_NO_IMAGEFORMAT_XPM
23
24
QT_BEGIN_NAMESPACE
25
26
class
QXpmHandler :
public
QImageIOHandler
27
{
28
public
:
29
QXpmHandler();
30
bool
canRead()
const
override;
31
bool
read(QImage *image) override;
32
bool
write(
const
QImage &image) override;
33
34
static
bool
canRead(QIODevice *device);
35
36
QVariant option(ImageOption option)
const
override;
37
void
setOption(ImageOption option,
const
QVariant &value) override;
38
bool
supportsOption(ImageOption option)
const
override;
39
40
private
:
41
bool
readHeader();
42
bool
readImage(QImage *image);
43
enum
State {
44
Ready,
45
ReadHeader,
46
Error
47
};
48
State state;
49
int
width;
50
int
height;
51
int
ncols;
52
int
cpp;
53
QByteArray buffer;
54
int
index;
55
QString fileName;
56
};
57
58
QT_END_NAMESPACE
59
60
#
endif
// QT_NO_IMAGEFORMAT_XPM
61
62
#
endif
// QXPMHANDLER_P_H
qtbase
src
gui
image
qxpmhandler_p.h
Generated on
for Qt by
1.18.0