API reference - Class QPixmap

Notation used in Ruby API documentation

Description: Binding of QPixmap

Class hierarchy: QPixmap » QPaintDevice

Public constructors

new QPixmapnewConstructor QPixmap::QPixmap()
new QPixmapnew(int w,
int h)
Constructor QPixmap::QPixmap(int w, int h)
new QPixmapnew(const QSize arg1)Constructor QPixmap::QPixmap(const QSize &)
new QPixmapnew(string fileName,
string format = 0,
const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)
Constructor QPixmap::QPixmap(const QString &fileName, const char *format, QFlags<Qt::ImageConversionFlag> flags)
new QPixmapnew(const QPixmap arg1)Constructor QPixmap::QPixmap(const QPixmap &)

Public methods

[const]bool!Method bool QPixmap::operator!()
void_assign(const QPixmap other)Assigns another object to self
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]QPixmapalphaChannelMethod QPixmap QPixmap::alphaChannel()
voidalphaChannel=(const QPixmap arg1)Method void QPixmap::setAlphaChannel(const QPixmap &)
voidassign(const QPixmap other)Assigns another object to self
[const]long longcacheKeyMethod qint64 QPixmap::cacheKey()
[const]QPixmapcopy(int x,
int y,
int width,
int height)
Method QPixmap QPixmap::copy(int x, int y, int width, int height)
[const]QPixmapcopy(const QRect rect = QRect())Method QPixmap QPixmap::copy(const QRect &rect)
[const]QBitmapcreateHeuristicMask(bool clipTight = true)Method QBitmap QPixmap::createHeuristicMask(bool clipTight)
[const]QBitmapcreateMaskFromColor(const QColor maskColor)Method QBitmap QPixmap::createMaskFromColor(const QColor &maskColor)
[const]QBitmapcreateMaskFromColor(const QColor maskColor,
const Qt_MaskMode mode)
Method QBitmap QPixmap::createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode)
[const]intdepthMethod int QPixmap::depth()
voiddetachMethod void QPixmap::detach()
[const]new QPixmap ptrdupCreates a copy of self
voidfill(const QColor fillColor = Qt::white)Method void QPixmap::fill(const QColor &fillColor)
voidfill(const QWidget ptr widget,
const QPoint ofs)
Method void QPixmap::fill(const QWidget *widget, const QPoint &ofs)
voidfill(const QWidget ptr widget,
int xofs,
int yofs)
Method void QPixmap::fill(const QWidget *widget, int xofs, int yofs)
[const]boolhasAlphaMethod bool QPixmap::hasAlpha()
[const]boolhasAlphaChannelMethod bool QPixmap::hasAlphaChannel()
[const]intheightMethod int QPixmap::height()
[const]boolisDetached?Method bool QPixmap::isDetached()
[const]boolisNull?Method bool QPixmap::isNull()
[const]boolisQBitmap?Method bool QPixmap::isQBitmap()
boolload(string fileName,
string format = 0,
const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)
Method bool QPixmap::load(const QString &fileName, const char *format, QFlags<Qt::ImageConversionFlag> flags)
boolloadFromData(string buf,
unsigned int len,
string format = 0,
const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)
Method bool QPixmap::loadFromData(const unsigned char *buf, unsigned int len, const char *format, QFlags<Qt::ImageConversionFlag> flags)
boolloadFromData(string data,
string format = 0,
const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)
Method bool QPixmap::loadFromData(const QByteArray &data, const char *format, QFlags<Qt::ImageConversionFlag> flags)
[const]QBitmapmaskMethod QBitmap QPixmap::mask()
voidmask=(const QBitmap arg1)Method void QPixmap::setMask(const QBitmap &)
[virtual,const]QPaintEngine ptrpaintEngineVirtual method QPaintEngine *QPixmap::paintEngine()
[const]QRectrectMethod QRect QPixmap::rect()
[const]boolsave(string fileName,
string format = 0,
int quality = -1)
Method bool QPixmap::save(const QString &fileName, const char *format, int quality)
[const]boolsave(QIODevice ptr device,
string format = 0,
int quality = -1)
Method bool QPixmap::save(QIODevice *device, const char *format, int quality)
[const]QPixmapscaled(int w,
int h,
const Qt_AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
const Qt_TransformationMode mode = Qt::FastTransformation)
Method QPixmap QPixmap::scaled(int w, int h, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)
[const]QPixmapscaled(const QSize s,
const Qt_AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
const Qt_TransformationMode mode = Qt::FastTransformation)
Method QPixmap QPixmap::scaled(const QSize &s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)
[const]QPixmapscaledToHeight(int h,
const Qt_TransformationMode mode = Qt::FastTransformation)
Method QPixmap QPixmap::scaledToHeight(int h, Qt::TransformationMode mode)
[const]QPixmapscaledToWidth(int w,
const Qt_TransformationMode mode = Qt::FastTransformation)
Method QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode)
voidscroll(int dx,
int dy,
int x,
int y,
int width,
int height,
QRegion ptr exposed = 0)
Method void QPixmap::scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed)
voidscroll(int dx,
int dy,
const QRect rect,
QRegion ptr exposed = 0)
Method void QPixmap::scroll(int dx, int dy, const QRect &rect, QRegion *exposed)
[const]intserialNumberMethod int QPixmap::serialNumber()
voidsetAlphaChannel(const QPixmap arg1)Method void QPixmap::setAlphaChannel(const QPixmap &)
voidsetMask(const QBitmap arg1)Method void QPixmap::setMask(const QBitmap &)
[const]QSizesizeMethod QSize QPixmap::size()
[const]QImagetoImageMethod QImage QPixmap::toImage()
[const]QPixmaptransformed(const QMatrix arg1,
const Qt_TransformationMode mode = Qt::FastTransformation)
Method QPixmap QPixmap::transformed(const QMatrix &, Qt::TransformationMode mode)
[const]QPixmaptransformed(const QTransform arg1,
const Qt_TransformationMode mode = Qt::FastTransformation)
Method QPixmap QPixmap::transformed(const QTransform &, Qt::TransformationMode mode)
[const]intwidthMethod int QPixmap::width()

Public static methods and constants

intdefaultDepthStatic method int QPixmap::defaultDepth()
QPixmapfromImage(const QImage image,
const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)
Static method QPixmap QPixmap::fromImage(const QImage &image, QFlags<Qt::ImageConversionFlag> flags)
QPixmapgrabWidget(QWidget ptr widget,
const QRect rect)
Static method QPixmap QPixmap::grabWidget(QWidget *widget, const QRect &rect)
QPixmapgrabWidget(QWidget ptr widget,
int x = 0,
int y = 0,
int w = -1,
int h = -1)
Static method QPixmap QPixmap::grabWidget(QWidget *widget, int x, int y, int w, int h)
QPixmapgrabWindow(unsigned long arg1,
int x = 0,
int y = 0,
int w = -1,
int h = -1)
Static method QPixmap QPixmap::grabWindow(WId, int x, int y, int w, int h)
QMatrixtrueMatrix(const QMatrix m,
int w,
int h)
Static method QMatrix QPixmap::trueMatrix(const QMatrix &m, int w, int h)
QTransformtrueMatrix(const QTransform m,
int w,
int h)
Static method QTransform QPixmap::trueMatrix(const QTransform &m, int w, int h)

Protected methods (static, non-static and constructors)

[virtual,const]intmetric(const QPaintDevice_PaintDeviceMetric arg1)Virtual method int QPixmap::metric(QPaintDevice::PaintDeviceMetric)

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

[const] bool !

Description: Method bool QPixmap::operator!()

Python specific notes:

This method is available as method 'not_' in Python

void _assign(const QPixmap other)

Description: Assigns another object to self

void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

[const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

[const] QPixmap alphaChannel

Description: Method QPixmap QPixmap::alphaChannel()

Python specific notes:

The object exposes a readable attribute 'alphaChannel'. This is the getter.

void alphaChannel=(const QPixmap arg1)

Description: Method void QPixmap::setAlphaChannel(const QPixmap &)

Python specific notes:

The object exposes a writable attribute 'alphaChannel'. This is the setter.

void assign(const QPixmap other)

Description: Assigns another object to self

[const] long long cacheKey

Description: Method qint64 QPixmap::cacheKey()

[const] QPixmap copy(int x,int y,int width,int height)

Description: Method QPixmap QPixmap::copy(int x, int y, int width, int height)

[const] QPixmap copy(const QRect rect = QRect())

Description: Method QPixmap QPixmap::copy(const QRect &rect)

void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

[const] QBitmap createHeuristicMask(bool clipTight = true)

Description: Method QBitmap QPixmap::createHeuristicMask(bool clipTight)

[const] QBitmap createMaskFromColor(const QColor maskColor)

Description: Method QBitmap QPixmap::createMaskFromColor(const QColor &maskColor)

[const] QBitmap createMaskFromColor(const QColor maskColor,const Qt_MaskMode mode)

Description: Method QBitmap QPixmap::createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode)

[static] int defaultDepth

Description: Static method int QPixmap::defaultDepth()

This method is static and can be called without an instance.

[const] int depth

Description: Method int QPixmap::depth()

void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

[const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

void detach

Description: Method void QPixmap::detach()

[const] new QPixmap ptr dup

Description: Creates a copy of self

void fill(const QColor fillColor = Qt::white)

Description: Method void QPixmap::fill(const QColor &fillColor)

void fill(const QWidget ptr widget,const QPoint ofs)

Description: Method void QPixmap::fill(const QWidget *widget, const QPoint &ofs)

void fill(const QWidget ptr widget,int xofs,int yofs)

Description: Method void QPixmap::fill(const QWidget *widget, int xofs, int yofs)

[static] QPixmap fromImage(const QImage image,const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)

Description: Static method QPixmap QPixmap::fromImage(const QImage &image, QFlags<Qt::ImageConversionFlag> flags)

This method is static and can be called without an instance.

[static] QPixmap grabWidget(QWidget ptr widget,const QRect rect)

Description: Static method QPixmap QPixmap::grabWidget(QWidget *widget, const QRect &rect)

This method is static and can be called without an instance.

[static] QPixmap grabWidget(QWidget ptr widget,int x = 0,int y = 0,int w = -1,int h = -1)

Description: Static method QPixmap QPixmap::grabWidget(QWidget *widget, int x, int y, int w, int h)

This method is static and can be called without an instance.

[static] QPixmap grabWindow(unsigned long arg1,int x = 0,int y = 0,int w = -1,int h = -1)

Description: Static method QPixmap QPixmap::grabWindow(WId, int x, int y, int w, int h)

This method is static and can be called without an instance.

[const] bool hasAlpha

Description: Method bool QPixmap::hasAlpha()

[const] bool hasAlphaChannel

Description: Method bool QPixmap::hasAlphaChannel()

[const] int height

Description: Method int QPixmap::height()

[const] bool isDetached?

Description: Method bool QPixmap::isDetached()

[const] bool isNull?

Description: Method bool QPixmap::isNull()

[const] bool isQBitmap?

Description: Method bool QPixmap::isQBitmap()

[const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

bool load(string fileName,string format = 0,const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)

Description: Method bool QPixmap::load(const QString &fileName, const char *format, QFlags<Qt::ImageConversionFlag> flags)

bool loadFromData(string buf,unsigned int len,string format = 0,const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)

Description: Method bool QPixmap::loadFromData(const unsigned char *buf, unsigned int len, const char *format, QFlags<Qt::ImageConversionFlag> flags)

bool loadFromData(string data,string format = 0,const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)

Description: Method bool QPixmap::loadFromData(const QByteArray &data, const char *format, QFlags<Qt::ImageConversionFlag> flags)

[const] QBitmap mask

Description: Method QBitmap QPixmap::mask()

Python specific notes:

The object exposes a readable attribute 'mask'. This is the getter.

void mask=(const QBitmap arg1)

Description: Method void QPixmap::setMask(const QBitmap &)

Python specific notes:

The object exposes a writable attribute 'mask'. This is the setter.

[virtual,const] int metric(const QPaintDevice_PaintDeviceMetric arg1)

Description: Virtual method int QPixmap::metric(QPaintDevice::PaintDeviceMetric)

This method can be reimplemented in a derived class.

[static] new QPixmap new

Description: Constructor QPixmap::QPixmap()

This method creates an object of class QPixmap.

Python specific notes:

This method is the default initializer of the object

[static] new QPixmap new(int w,int h)

Description: Constructor QPixmap::QPixmap(int w, int h)

This method creates an object of class QPixmap.

Python specific notes:

This method is the default initializer of the object

[static] new QPixmap new(const QSize arg1)

Description: Constructor QPixmap::QPixmap(const QSize &)

This method creates an object of class QPixmap.

Python specific notes:

This method is the default initializer of the object

[static] new QPixmap new(string fileName,string format = 0,const Qt_QFlags_ImageConversionFlag flags = Qt::AutoColor)

Description: Constructor QPixmap::QPixmap(const QString &fileName, const char *format, QFlags<Qt::ImageConversionFlag> flags)

This method creates an object of class QPixmap.

Python specific notes:

This method is the default initializer of the object

[static] new QPixmap new(const QPixmap arg1)

Description: Constructor QPixmap::QPixmap(const QPixmap &)

This method creates an object of class QPixmap.

Python specific notes:

This method is the default initializer of the object

[virtual,const] QPaintEngine ptr paintEngine

Description: Virtual method QPaintEngine *QPixmap::paintEngine()

This method can be reimplemented in a derived class.

[const] QRect rect

Description: Method QRect QPixmap::rect()

[const] bool save(string fileName,string format = 0,int quality = -1)

Description: Method bool QPixmap::save(const QString &fileName, const char *format, int quality)

[const] bool save(QIODevice ptr device,string format = 0,int quality = -1)

Description: Method bool QPixmap::save(QIODevice *device, const char *format, int quality)

[const] QPixmap scaled(int w,int h,const Qt_AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,const Qt_TransformationMode mode = Qt::FastTransformation)

Description: Method QPixmap QPixmap::scaled(int w, int h, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)

[const] QPixmap scaled(const QSize s,const Qt_AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,const Qt_TransformationMode mode = Qt::FastTransformation)

Description: Method QPixmap QPixmap::scaled(const QSize &s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)

[const] QPixmap scaledToHeight(int h,const Qt_TransformationMode mode = Qt::FastTransformation)

Description: Method QPixmap QPixmap::scaledToHeight(int h, Qt::TransformationMode mode)

[const] QPixmap scaledToWidth(int w,const Qt_TransformationMode mode = Qt::FastTransformation)

Description: Method QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode)

void scroll(int dx,int dy,int x,int y,int width,int height,QRegion ptr exposed = 0)

Description: Method void QPixmap::scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed)

void scroll(int dx,int dy,const QRect rect,QRegion ptr exposed = 0)

Description: Method void QPixmap::scroll(int dx, int dy, const QRect &rect, QRegion *exposed)

[const] int serialNumber

Description: Method int QPixmap::serialNumber()

void setAlphaChannel(const QPixmap arg1)

Description: Method void QPixmap::setAlphaChannel(const QPixmap &)

Python specific notes:

The object exposes a writable attribute 'alphaChannel'. This is the setter.

void setMask(const QBitmap arg1)

Description: Method void QPixmap::setMask(const QBitmap &)

Python specific notes:

The object exposes a writable attribute 'mask'. This is the setter.

[const] QSize size

Description: Method QSize QPixmap::size()

Python specific notes:

This method is also available as 'len(object)'

[const] QImage toImage

Description: Method QImage QPixmap::toImage()

[const] QPixmap transformed(const QMatrix arg1,const Qt_TransformationMode mode = Qt::FastTransformation)

Description: Method QPixmap QPixmap::transformed(const QMatrix &, Qt::TransformationMode mode)

[const] QPixmap transformed(const QTransform arg1,const Qt_TransformationMode mode = Qt::FastTransformation)

Description: Method QPixmap QPixmap::transformed(const QTransform &, Qt::TransformationMode mode)

[static] QMatrix trueMatrix(const QMatrix m,int w,int h)

Description: Static method QMatrix QPixmap::trueMatrix(const QMatrix &m, int w, int h)

This method is static and can be called without an instance.

[static] QTransform trueMatrix(const QTransform m,int w,int h)

Description: Static method QTransform QPixmap::trueMatrix(const QTransform &m, int w, int h)

This method is static and can be called without an instance.

[const] int width

Description: Method int QPixmap::width()