Class: QgsLegendPatchShapeButton

class qgis.gui.QgsLegendPatchShapeButton

Bases: PyQt5.QtWidgets.QToolButton

A button for creating and modifying QgsLegendPatchShape settings.

New in version 3.14.

QgsLegendPatchShapeButton(parent: QWidget = None, dialogTitle: str = ‘’) 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.

Methods

actionEvent

changeEvent

param e

checkStateSet

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

dialogTitle

Returns the title for the symbol settings dialog window.

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

hitButton

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

messageBar

Returns the message bar associated with the widget.

metric

minimumSizeHint

rtype

QSize

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

param e

mouseReleaseEvent

moveEvent

nativeEvent

nextCheckState

paintEvent

receivers

resizeEvent

param event

sender

senderSignalIndex

setDialogTitle

Sets the title for the symbol settings dialog window.

setMessageBar

Sets the message bar associated with the widget.

setPreviewSymbol

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

setShape

Sets the shape for the button.

setSymbolType

Sets the symbol type which the button requires.

setToDefault

Resets the shape to the default shape.

shape

Returns the current shape defined by the button.

sharedPainter

showEvent

param e

sizeHint

rtype

QSize

symbolType

Returns the symbol type which the button requires.

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

changed

Emitted when the shape's settings are changed.

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: Qgis.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 (Qgis.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) Qgis.SymbolType

Returns the symbol type which the button requires.

See also

setSymbolType()

Return type

Qgis.SymbolType

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