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 QBITMAP_H |
5 | #define QBITMAP_H |
6 | |
7 | #include <QtGui/qtguiglobal.h> |
8 | #include <QtGui/qpixmap.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | |
13 | class QVariant; |
14 | |
15 | class Q_GUI_EXPORT QBitmap : public QPixmap |
16 | { |
17 | public: |
18 | QBitmap(); |
19 | #if QT_DEPRECATED_SINCE(6, 0) |
20 | QT_DEPRECATED_VERSION_X_6_0("Use fromPixmap instead.") explicit QBitmap(const QPixmap &); |
21 | #endif |
22 | QBitmap(int w, int h); |
23 | explicit QBitmap(const QSize &); |
24 | explicit QBitmap(const QString &fileName, const char *format = nullptr); |
25 | ~QBitmap() override; |
26 | |
27 | #if QT_DEPRECATED_SINCE(6, 0) |
28 | QT_DEPRECATED_VERSION_X_6_0("Use fromPixmap instead.") QBitmap &operator=(const QPixmap &); |
29 | #endif |
30 | inline void swap(QBitmap &other) { QPixmap::swap(other); } // prevent QBitmap<->QPixmap swaps |
31 | operator QVariant() const; |
32 | |
33 | inline void clear() { fill(fillColor: Qt::color0); } |
34 | |
35 | static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor); |
36 | static QBitmap fromImage(QImage &&image, Qt::ImageConversionFlags flags = Qt::AutoColor); |
37 | static QBitmap fromData(const QSize &size, const uchar *bits, |
38 | QImage::Format monoFormat = QImage::Format_MonoLSB); |
39 | static QBitmap fromPixmap(const QPixmap &pixmap); |
40 | |
41 | QBitmap transformed(const QTransform &matrix) const; |
42 | |
43 | typedef QExplicitlySharedDataPointer<QPlatformPixmap> DataPtr; |
44 | }; |
45 | Q_DECLARE_SHARED(QBitmap) |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif // QBITMAP_H |
50 |