Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbitmap.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
4#ifndef QBITMAP_H
5#define QBITMAP_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtGui/qpixmap.h>
9
11
12
13class QVariant;
14
15class Q_GUI_EXPORT QBitmap : public QPixmap
16{
17public:
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(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,
39 static QBitmap fromPixmap(const QPixmap &pixmap);
40
41 QBitmap transformed(const QTransform &matrix) const;
42
43 typedef QExplicitlySharedDataPointer<QPlatformPixmap> DataPtr;
44};
45Q_DECLARE_SHARED(QBitmap)
46
48
49#endif // QBITMAP_H
\inmodule QtGui
Definition qbitmap.h:16
void clear()
Clears the bitmap, setting all its bits to Qt::color0.
Definition qbitmap.h:33
QExplicitlySharedDataPointer< QPlatformPixmap > DataPtr
Definition qbitmap.h:43
void swap(QBitmap &other)
Definition qbitmap.h:30
~QBitmap() override
\inmodule QtGui
Definition qimage.h:37
Format
The following image formats are available in Qt.
Definition qimage.h:41
@ Format_MonoLSB
Definition qimage.h:44
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
void swap(QPixmap &other) noexcept
Swaps pixmap other with this pixmap.
Definition qpixmap.h:43
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
@ AutoColor
Definition qnamespace.h:478
@ color0
Definition qnamespace.h:28
Definition image.cpp:4
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLbitfield flags
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum matrix
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
#define QT_DEPRECATED_VERSION_X_6_0(text)
unsigned char uchar
Definition qtypes.h:32
ba fill(true)
QSharedPointer< T > other(t)
[5]
widget render & pixmap