# `QPixmapWidget`

digraph inheritance42b7f3384b { bgcolor=transparent; rankdir=UD; ratio=compress; size="8.0, 12.0"; "QObject" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QObject(parent: QObject|None = None)"]; "wrapper" -> "QObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QPaintDevice()"]; "simplewrapper" -> "QPaintDevice" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPixmapWidget" [URL="#taurus.qt.qtgui.display.QPixmapWidget",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="This widget displays an image (pixmap). By default the pixmap is"]; "QWidget" -> "QPixmapWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QWidget" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QWidget(parent: QWidget|None = None, flags: Qt.WindowFlags|Qt.WindowType = Qt.WindowFlags())"]; "QObject" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "simplewrapper" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "wrapper" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "simplewrapper" -> "wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class QPixmapWidget(parent=None, designMode=False)

  This widget displays an image (pixmap). By default the pixmap is scaled to the widget size and the aspect ratio is kept. The default alignment of the pixmap inside the widget space is horizontal left, vertical center.

  Import from `taurus.qt.qtgui.display` as:

      from taurus.qt.qtgui.display import QPixmapWidget

  DefaultAlignment = <PyQt5.QtCore.Qt.Alignment object>
  DefaultAspectRatioMode = 1
  DefaultTransformationMode = 1
  alignment

    This property holds the widget’s pixmap alignment

    Access functions:

    > - `QPixmapWidget.getAlignment()`

    > - `QPixmapWidget.setAlignment()`

    > - `QPixmapWidget.resetAlignment()`

  aspectRatioMode

    This property holds the widget’s pixmap aspect ratio mode

    Access functions:

    > - `QPixmapWidget.getAspectRatioMode()`

    > - `QPixmapWidget.setAspectRatioMode()`

    > - `QPixmapWidget.resetAspectRatioMode()`

  getAlignment()

    Returns the alignment to apply when drawing the pixmap. :return: the current alignment :rtype: PyQt5.Qt.Alignment

  getAspectRatioMode()

    Returns the aspect ratio to apply when drawing the pixmap. :return: the current aspect ratio :rtype: PyQt5.Qt.AspectRatioMode

  getPixmap()

    Returns the pixmap.Returns None if no pixmap is set. :return: the current pixmap :rtype: PyQt5.Qt.QPixmap

  classmethod getQtDesignerPluginInfo()
  getTransformationMode()

    Returns the transformation mode to apply when drawing the pixmap. :return: the current transformation mode :rtype: PyQt5.Qt.TransformationMode

  paintEvent(paintEvent)

    Overwrite the paintEvent from QWidget to draw the pixmap

  pixmap

    This property holds the widget’s pixmap

    Access functions:

    > - `QPixmapWidget.getPixmap()`

    > - `QPixmapWidget.setPixmap()`

    > - `QPixmapWidget.resetLedStatus()`

  recalculatePixmap()
  resetAlignment()

    Resets the transformation mode to Qt.Qt.AlignLeft | Qt.Qt.AlignVCenter

  resetAspectRatioMode()

    Resets the aspect ratio mode to KeepAspectRatio

  resetPixmap()

    Resets the pixmap for this widget.

  resetTransformationMode()

    Resets the transformation mode to SmoothTransformation

  resizeEvent(self, a0: QResizeEvent | None)
  setAlignment(alignment)

    Sets the alignment to apply when drawing the pixmap.

    Parameters:

      pixmap (PyQt5.Qt.Alignment) – the new alignment

  setAspectRatioMode(aspect)

    Sets the aspect ratio mode to apply when drawing the pixmap.

    Parameters:

      pixmap (PyQt5.Qt.AspectRatioMode) – the new aspect ratio mode

  setPixmap(pixmap)

    Sets the pixmap for this widget. Setting it to None disables pixmap

    Parameters:

      pixmap (PyQt5.Qt.QPixmap) – the new pixmap

  setTransformationMode(transformation)

    Sets the transformation mode to apply when drawing the pixmap.

    Parameters:

      pixmap (PyQt5.Qt.TransformationMode) – the new transformation mode

  transformationMode

    This property holds the widget’s pixmap transformation mode

    Access functions:

    > - `QPixmapWidget.getTransformationMode()`

    > - `QPixmapWidget.setTransformationMode()`

    > - `QPixmapWidget.resetTransformationMode()`