Class: QgsPixmapLabel

class qgis.gui.QgsPixmapLabel

Bases: PyQt5.QtWidgets.QLabel

The QgsPixmapLabel class shows a pixmap and adjusts its size to the space given to the widget by the layout and keeping its aspect ratio.

QgsPixmapLabel(parent: Optional[QWidget] = None) Constructor for QgsPixmapLabel

actionEvent(self, a0: QActionEvent | None)
changeEvent(self, a0: QEvent | None)
childEvent(self, a0: QChildEvent | None)
clear(self)

Clears any label contents.

closeEvent(self, a0: QCloseEvent | None)
connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, ev: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
drawFrame(self, a0: QPainter | None)
dropEvent(self, a0: QDropEvent | None)
enterEvent(self, a0: QEvent | None)
event(self, e: QEvent | None) bool
focusInEvent(self, ev: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, ev: QFocusEvent | None)
focusPreviousChild(self) bool
heightForWidth(self, width: int) int

Calculates the height for the given width.

Parameters:

width (int) – The width for the widget

Return type:

int

Returns:

An appropriate height

hideEvent(self, a0: QHideEvent | None)
initPainter(self, painter: QPainter | None)
initStyleOption(self, option: QStyleOptionFrame | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, ev: QKeyEvent | None)
keyReleaseEvent(self, a0: QKeyEvent | None)
leaveEvent(self, a0: QEvent | None)
metric(self, a0: QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, a0: QMouseEvent | None)
mouseMoveEvent(self, ev: QMouseEvent | None)
mousePressEvent(self, ev: QMouseEvent | None)
mouseReleaseEvent(self, ev: QMouseEvent | None)
moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
paintEvent(self, a0: QPaintEvent | None)
receivers(self, signal: PYQT_SIGNAL) int
resizeEvent(self, a0: QResizeEvent | None)
Parameters:

a0 (Optional[QResizeEvent])

sender(self) QObject | None
senderSignalIndex(self) int
setPixmap(self, a0: QPixmap)
Parameters:

a0 (QPixmap)

sharedPainter(self) QPainter | None
showEvent(self, a0: QShowEvent | None)
sizeHint(self) QSize

An optimal size for the widget. Effectively using the height determined from the width with the given aspect ratio.

Return type:

QSize

Returns:

A size hint

tabletEvent(self, a0: QTabletEvent | None)
timerEvent(self, a0: QTimerEvent | None)
updateMicroFocus(self)
wheelEvent(self, a0: QWheelEvent | None)