Coverage Report

Created: 2026-03-12 07:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qtbase/src/gui/image/qpicture.h
Line
Count
Source
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
4
#ifndef QPICTURE_H
5
#define QPICTURE_H
6
7
#include <QtGui/qtguiglobal.h>
8
#include <QtCore/qiodevice.h>
9
#include <QtCore/qshareddata.h>
10
#include <QtCore/qstringlist.h>
11
#include <QtGui/qpaintdevice.h>
12
13
QT_BEGIN_NAMESPACE
14
15
#ifndef QT_NO_PICTURE
16
17
class QPicturePrivate;
18
class Q_GUI_EXPORT QPicture : public QPaintDevice
19
{
20
0
    Q_DECLARE_PRIVATE(QPicture)
Unexecuted instantiation: QPicture::d_func()
Unexecuted instantiation: QPicture::d_func() const
21
0
public:
22
0
    explicit QPicture(int formatVersion = -1);
23
0
    QPicture(const QPicture &);
24
0
    ~QPicture();
25
0
26
0
    bool isNull() const;
27
0
28
0
    int devType() const override;
29
0
    uint size() const;
30
0
    const char* data() const;
31
0
    virtual void setData(const char* data, uint size);
32
0
33
0
    bool play(QPainter *p);
34
0
35
0
    bool load(QIODevice *dev);
36
0
    bool load(const QString &fileName);
37
0
    bool save(QIODevice *dev);
38
0
    bool save(const QString &fileName);
39
0
40
0
    QRect boundingRect() const;
41
0
    void setBoundingRect(const QRect &r);
42
0
43
0
    QPicture& operator=(const QPicture &p);
44
0
    QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPicture)
45
0
    inline void swap(QPicture &other) noexcept
46
0
    { d_ptr.swap(other.d_ptr); }
47
    void detach();
48
    bool isDetached() const;
49
50
    friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QPicture &p);
51
    friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QPicture &p);
52
53
    QPaintEngine *paintEngine() const override;
54
55
protected:
56
    QPicture(QPicturePrivate &data);
57
58
    int metric(PaintDeviceMetric m) const override;
59
60
private:
61
    bool exec(QPainter *p, QDataStream &ds, int i);
62
63
    QExplicitlySharedDataPointer<QPicturePrivate> d_ptr;
64
    friend class QPicturePaintEngine;
65
    friend class QAlphaPaintEngine;
66
    friend class QPreviewPaintEngine;
67
68
public:
69
    typedef QExplicitlySharedDataPointer<QPicturePrivate> DataPtr;
70
0
    inline DataPtr &data_ptr() { return d_ptr; }
71
};
72
73
Q_DECLARE_SHARED(QPicture)
74
75
/*****************************************************************************
76
  QPicture stream functions
77
 *****************************************************************************/
78
79
#ifndef QT_NO_DATASTREAM
80
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPicture &);
81
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPicture &);
82
#endif
83
84
#endif // QT_NO_PICTURE
85
86
QT_END_NAMESPACE
87
88
#endif // QPICTURE_H