File indexing completed on 2025-01-18 10:08:15
0001
0002
0003
0004 #ifndef QPICTURE_H
0005 #define QPICTURE_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qiodevice.h>
0009 #include <QtCore/qshareddata.h>
0010 #include <QtCore/qstringlist.h>
0011 #include <QtGui/qpaintdevice.h>
0012
0013 QT_BEGIN_NAMESPACE
0014
0015 #ifndef QT_NO_PICTURE
0016
0017 class QPicturePrivate;
0018 class Q_GUI_EXPORT QPicture : public QPaintDevice
0019 {
0020 Q_DECLARE_PRIVATE(QPicture)
0021 public:
0022 explicit QPicture(int formatVersion = -1);
0023 QPicture(const QPicture &);
0024 ~QPicture();
0025
0026 bool isNull() const;
0027
0028 int devType() const override;
0029 uint size() const;
0030 const char* data() const;
0031 virtual void setData(const char* data, uint size);
0032
0033 bool play(QPainter *p);
0034
0035 bool load(QIODevice *dev);
0036 bool load(const QString &fileName);
0037 bool save(QIODevice *dev);
0038 bool save(const QString &fileName);
0039
0040 QRect boundingRect() const;
0041 void setBoundingRect(const QRect &r);
0042
0043 QPicture& operator=(const QPicture &p);
0044 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPicture)
0045 inline void swap(QPicture &other) noexcept
0046 { d_ptr.swap(other.d_ptr); }
0047 void detach();
0048 bool isDetached() const;
0049
0050 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QPicture &p);
0051 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QPicture &p);
0052
0053 QPaintEngine *paintEngine() const override;
0054
0055 protected:
0056 QPicture(QPicturePrivate &data);
0057
0058 int metric(PaintDeviceMetric m) const override;
0059
0060 private:
0061 bool exec(QPainter *p, QDataStream &ds, int i);
0062
0063 QExplicitlySharedDataPointer<QPicturePrivate> d_ptr;
0064 friend class QPicturePaintEngine;
0065 friend class QAlphaPaintEngine;
0066 friend class QPreviewPaintEngine;
0067
0068 public:
0069 typedef QExplicitlySharedDataPointer<QPicturePrivate> DataPtr;
0070 inline DataPtr &data_ptr() { return d_ptr; }
0071 };
0072
0073 Q_DECLARE_SHARED(QPicture)
0074
0075
0076
0077
0078
0079 #ifndef QT_NO_DATASTREAM
0080 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPicture &);
0081 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPicture &);
0082 #endif
0083
0084 #endif
0085
0086 QT_END_NAMESPACE
0087
0088 #endif