Class: QgsLegendPatchShapeButton

class qgis.gui.QgsLegendPatchShapeButton(parent: QWidget = None, dialogTitle: str = '')

Bases: PyQt5.QtWidgets.QToolButton

Construct a new patch shape button with the specified parent widget. Use dialogTitle string to define the title to show in the legend patch shape widget.

A button for creating and modifying QgsLegendPatchShape settings.

New in version 3.14.

Parameters
  • parent (QWidget = None) –

  • dialogTitle

actionEvent(self, QActionEvent)
changeEvent(self, e: QEvent)
Parameters

e (QEvent) –

changed

Emitted when the shape’s settings are changed.

See also

shape()

See also

setShape() [signal]

checkStateSet(self)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
dialogTitle(self)str

Returns the title for the symbol settings dialog window.

See also

setDialogTitle()

Return type

str

disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent)bool
focusInEvent(self, QFocusEvent)
focusNextChild(self)bool
focusNextPrevChild(self, bool)bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self)bool
hideEvent(self, QHideEvent)
hitButton(self, QPoint)bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionToolButton)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod)bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
messageBar(self)QgsMessageBar

Returns the message bar associated with the widget.

See also

setMessageBar()

New in version 3.6.

Return type

QgsMessageBar

metric(self, QPaintDevice.PaintDeviceMetric)int
minimumSizeHint(self)QSize
Return type

QSize

mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr)Tuple[bool, int]
nextCheckState(self)
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL)int
resizeEvent(self, event: QResizeEvent)
Parameters

event (QResizeEvent) –

sender(self)QObject
senderSignalIndex(self)int
setDialogTitle(self, title: str)

Sets the title for the symbol settings dialog window.

See also

dialogTitle()

Parameters

title (str) –

setMessageBar(self, bar: QgsMessageBar)

Sets the message bar associated with the widget. This allows the widget to push feedback messages to the appropriate message bar.

See also

messageBar()

New in version 3.6.

Parameters

bar (QgsMessageBar) –

setPreviewSymbol(self, symbol: QgsSymbol)

Sets the symbol to use for previewing the legend patch shape.

Ownership is transferred to the button. It is the caller’s responsibility to ensure that the symbol type matches the button’s symbolType()

Parameters

symbol (QgsSymbol) –

setShape(self, shape: QgsLegendPatchShape)

Sets the shape for the button.

See also

shape()

See also

changed()

Parameters

shape (QgsLegendPatchShape) –

setSymbolType(self, type: QgsSymbol.SymbolType)

Sets the symbol type which the button requires. If the type differs from the current symbol type, the symbol will be reset to a default symbol style of the new type.

See also

symbolType()

Parameters

type (QgsSymbol.SymbolType) –

setToDefault(self)

Resets the shape to the default shape.

shape(self)QgsLegendPatchShape

Returns the current shape defined by the button.

See also

setShape()

See also

changed()

Return type

QgsLegendPatchShape

sharedPainter(self)QPainter
showEvent(self, e: QShowEvent)
Parameters

e (QShowEvent) –

sizeHint(self)QSize
Return type

QSize

symbolType(self)QgsSymbol.SymbolType

Returns the symbol type which the button requires.

See also

setSymbolType()

Return type

QgsSymbol.SymbolType

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)