4.17. Pixmap widget class

The Pixmap class inherits QLabel Qt class.

Widget's input value

The Pixmap class accepts the following values :

  • A path to a file containing graphical data. The formats accepted depends on your system but common formats (JPEG, GIF, BMP, PNG, XPM) are usually accepted.
  • A standard pixmap name, ex: SP_DesktopIcon. For a list of standard pixmaps, see the StandardPixmap property of the QStyle class in Qt documentation.
  • A base64 string representing graphical data.
  • A list representing XPM data.
  • A QPixmap object.

Widget's attributes

format
This attribute holds the format that the Pixmap class uses to give his value. The available formats depends on your system, but usually the common formats (JPEG, GIF, BMP, PNG, XPM) can be used.
quality
The quality attribute must be in the range 0-100 or -1. Specify 0 to obtain small compressed data (less quality), 100 for large uncompressed data (best quality), and -1 to use the default settings. This attribute default is -1.
scale
If set to True, the pixmap's content scales when the pixmap widget is resized. The default is True.
ratio
This attribute defines what happens to the aspect ratio when scaling the pixmap. Possible values are :
  • ignore : the size is scaled freely. The aspect ratio is not preserved.
  • keep : The size is scaled as large as possible, preserving the aspect ratio. This is the default.
  • expand : The size is scaled as small as possible outside the pixmap, preserving the aspect ratio.
transformation
This attribute defines whether pixmap scaling should be smooth or not. Possible value are : fast or smooth. The default is smooth.

Widget's output value

A base64 string representing the pixmap shown using the specified image format and quality.