Class: QgsSymbolButton¶
-
class
qgis.gui.
QgsSymbolButton
(parent: QWidget = None, dialogTitle: str = '')¶ Bases:
PyQt5.QtWidgets.QToolButton
Construct a new symbol button. Use
dialogTitle
string to define the title to show in the symbol settings dialog.A button for creating and modifying
QgsSymbol
settings.The button shows a preview icon for the current symbol, and will open a detailed symbol editor dialog (or panel widget) when clicked.
New in version 3.0.
- Parameters
parent (QWidget = None) –
dialogTitle –
-
actionEvent
(self, QActionEvent)¶
-
changeEvent
(self, e: QEvent)¶ - Parameters
e (QEvent) –
-
changed
¶ Emitted when the symbol’s settings are changed.
See also
See also
setSymbol()
[signal]
-
checkStateSet
(self)¶
-
childEvent
(self, QChildEvent)¶
-
closeEvent
(self, QCloseEvent)¶
-
connectNotify
(self, QMetaMethod)¶
-
contextMenuEvent
(self, QContextMenuEvent)¶
-
copyColor
(self)¶ Copies the current symbol color to the clipboard.
See also
-
copySymbol
(self)¶ Copies the current symbol to the clipboard.
See also
-
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
- Return type
str
-
disconnectNotify
(self, QMetaMethod)¶
-
dragEnterEvent
(self, e: QDragEnterEvent)¶ - Parameters
e (QDragEnterEvent) –
-
dragLeaveEvent
(self, e: QDragLeaveEvent)¶ - Parameters
e (QDragLeaveEvent) –
-
dragMoveEvent
(self, QDragMoveEvent)¶
-
dropEvent
(self, e: QDropEvent)¶ - Parameters
e (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, e: QKeyEvent)¶ - Parameters
e (QKeyEvent) –
-
keyReleaseEvent
(self, QKeyEvent)¶
-
layer
(self) → QgsVectorLayer¶ Returns the layer associated with the widget.
See also
- Return type
-
leaveEvent
(self, QEvent)¶
-
mapCanvas
(self) → QgsMapCanvas¶ Returns the map canvas associated with the widget.
See also
- Return type
-
messageBar
(self) → QgsMessageBar¶ Returns the message bar associated with the widget.
See also
New in version 3.6.
- Return type
-
metric
(self, QPaintDevice.PaintDeviceMetric) → int¶
-
minimumSizeHint
(self) → QSize¶ - Return type
QSize
-
mouseDoubleClickEvent
(self, QMouseEvent)¶
-
mouseMoveEvent
(self, e: QMouseEvent)¶ - Parameters
e (QMouseEvent) –
-
mousePressEvent
(self, e: QMouseEvent)¶ - Parameters
e (QMouseEvent) –
-
mouseReleaseEvent
(self, e: QMouseEvent)¶ - Parameters
e (QMouseEvent) –
-
moveEvent
(self, QMoveEvent)¶
-
nativeEvent
(self, Union[QByteArray, bytes, bytearray], sip.voidptr) → Tuple[bool, int]¶
-
nextCheckState
(self)¶
-
paintEvent
(self, QPaintEvent)¶
-
pasteColor
(self)¶ Pastes a color from the clipboard to the symbol. If clipboard does not contain a valid color or string representation of a color, then no change is applied.
See also
-
pasteSymbol
(self)¶ Pastes a symbol from the clipboard. If clipboard does not contain a valid symbol then no change is applied.
See also
-
receivers
(self, PYQT_SIGNAL) → int¶
-
registerExpressionContextGenerator
(self, generator: QgsExpressionContextGenerator)¶ Register an expression context generator class that will be used to retrieve an expression context for the button when required.
- Parameters
generator (QgsExpressionContextGenerator) –
-
resizeEvent
(self, event: QResizeEvent)¶ - Parameters
event (QResizeEvent) –
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the current
color
for the symbol. Will emit achanged()
signal if the color is different to the previous symbol color.- Parameters
color (Union[QColor) –
-
setDialogTitle
(self, title: str)¶ Sets the
title
for the symbol settings dialog window.See also
- Parameters
title (str) –
-
setLayer
(self, layer: QgsVectorLayer)¶ Sets a
layer
to associate with the widget. This allows the widget to setup layer related settings within the symbol settings dialog, such as correctly populating data defined override buttons.See also
- Parameters
layer (QgsVectorLayer) –
-
setMapCanvas
(self, canvas: QgsMapCanvas)¶ Sets a map
canvas
to associate with the widget. This allows the widget to fetch current settings from the map canvas, such as current scale.See also
- Parameters
canvas (QgsMapCanvas) –
-
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
New in version 3.6.
- Parameters
bar (QgsMessageBar) –
-
setSymbol
(self, symbol: QgsSymbol)¶ Sets the
symbol
for the button. Ownership ofsymbol
is transferred to the button.See also
See also
- Parameters
symbol (QgsSymbol) –
-
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
- Parameters
type (QgsSymbol.SymbolType) –
-
showEvent
(self, e: QShowEvent)¶ - Parameters
e (QShowEvent) –
-
sizeHint
(self) → QSize¶ - Return type
QSize
-
symbol
(self) → QgsSymbol¶ Returns the current symbol defined by the button.
See also
See also
- Return type
-
symbolType
(self) → QgsSymbol.SymbolType¶ Returns the symbol type which the button requires.
See also
- Return type
-
tabletEvent
(self, QTabletEvent)¶
-
timerEvent
(self, QTimerEvent)¶
-
updateMicroFocus
(self)¶
-
wheelEvent
(self, QWheelEvent)¶