Subgroup: Layout
Class: QgsLayoutItemLegend¶
-
class
qgis.core.
QgsLayoutItemLegend
¶ Bases:
qgis._core.QgsLayoutItem
A layout item subclass for map legends.
New in version 3.0: Methods
acceptDrops
acceptHoverEvents
acceptTouchEvents
acceptedMouseButtons
adjustBoxSize
Sets the legend’s item bounds to fit the whole legend content. adjustPointForReferencePosition
advance
applyDataDefinedSize
applyItemSizeConstraint
attemptMove
Attempts to move the item to a specified point
.attemptMoveBy
Attempts to shift the item’s position by a specified deltaX
anddeltaY
, in layout units.attemptResize
Attempts to resize the item to a specified target size
.attemptSetSceneRect
Attempts to update the item’s position and size to match the passed rect
in layout coordinates.autoUpdateModel
Returns whether the legend content should auto update to reflect changes in the project’s layer tree. backgroundColor
Returns the background color for this item. beginCommand
Starts new undo command for this item. blendMode
Returns the item’s composition blending mode. blockSignals
boundingRect
boundingRegion
boundingRegionGranularity
boxSpace
Returns the legend box space. brush
cacheMode
cancelCommand
Cancels the current item command and discards it. childEvent
childItems
children
childrenBoundingRect
cleanup
Called just before a batch of items are deleted, allowing them to run cleanup tasks. clearFocus
clipPath
collidesWithItem
collidesWithPath
collidingItems
columnCount
Returns the legend column count. columnSpace
Returns the legend column spacing. commonAncestorItem
connectNotify
contains
containsAdvancedEffects
Returns true if the item contains contents with blend modes or transparency effects which can only be reproduced by rastering the item. contextMenuEvent
create
Returns a new legend item for the specified layout
.createCommand
createExpressionContext
cursor
customEvent
customProperties
Return list of keys stored in custom properties for the object. customProperty
Read a custom property from the object. data
dataDefinedProperties
Returns a reference to the object’s property collection, used for data defined overrides. deleteLater
deviceTransform
disconnect
disconnectNotify
displayName
dragEnterEvent
dragLeaveEvent
dragMoveEvent
draw
drawBackground
drawDebugRect
drawFrame
drawRasterStroke
Returns whether a stroke will be drawn around raster symbol items. dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveOpacity
endCommand
Completes the current item command and push it onto the layout’s undo stack. ensureVisible
ensureVisible(self, float, float, float, float, xMargin: int = 50, yMargin: int = 50) equalColumnWidth
Returns whether column widths should be equalized. estimatedFrameBleed
Returns the estimated amount the item’s frame bleeds outside the item’s actual rectangle. event
eventFilter
excludeFromExports
Returns whether the item should be excluded from layout exports and prints. filtersChildEvents
finalizeRestoreFromXml
findChild
findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] fixedSize
Returns the fixed size of the item, if applicable, or an empty size if item can be freely resized. flags
focusInEvent
focusItem
focusOutEvent
focusProxy
fontColor
Returns the legend font color. frameEnabled
Returns true if the item includes a frame. frameJoinStyle
Returns the join style used for drawing the item’s frame. frameStrokeColor
Returns the frame’s stroke color. frameStrokeWidth
Returns the frame’s stroke width. grabKeyboard
grabMouse
graphicsEffect
group
hasBackground
Returns true if the item has a background. hasCursor
hasFocus
hide
hoverEnterEvent
hoverLeaveEvent
hoverMoveEvent
icon
id
Returns the item’s ID name. inherits
inputMethodEvent
inputMethodHints
inputMethodQuery
installEventFilter
installSceneEventFilter
invalidateCache
Forces a deferred update of any cached image the item uses. isActive
isAncestorOf
isBlockedByModalPanel
isClipped
isEnabled
isGroupMember
Returns true if the item is part of a QgsLayoutItemGroup group. isLocked
Returns true if the item is locked, and cannot be interacted with using the mouse. isObscured
isObscured(self, float, float, float, float) -> bool isObscuredBy
isPanel
isSelected
isSignalConnected
isUnderMouse
isVisible
isVisibleTo
isWidget
isWidgetType
isWindow
isWindowType
itemChange
itemOpacity
Returns the item’s opacity. itemRotation
Returns the current rotation for the item, in degrees clockwise. itemTransform
keyPressEvent
keyReleaseEvent
killTimer
layout
Returns the layout the object is attached to. legendFilterByMapEnabled
Find out whether legend items are filtered to show just the ones visible in the associated map legendFilterOutAtlas
Returns whether to filter out legend elements outside of the current atlas feature. legendSettings
Returns the legend’s renderer settings object. lineSpacing
Returns the spacing in-between lines in layout units. linkedMap
Returns the associated map. mapFromItem
mapFromItem(self, QGraphicsItem, QRectF) -> QPolygonF mapFromParent
mapFromParent(self, QRectF) -> QPolygonF mapFromScene
mapFromScene(self, QRectF) -> QPolygonF mapRectFromItem
mapRectFromItem(self, QGraphicsItem, float, float, float, float) -> QRectF mapRectFromParent
mapRectFromParent(self, float, float, float, float) -> QRectF mapRectFromScene
mapRectFromScene(self, float, float, float, float) -> QRectF mapRectToItem
mapRectToItem(self, QGraphicsItem, float, float, float, float) -> QRectF mapRectToParent
mapRectToParent(self, float, float, float, float) -> QRectF mapRectToScene
mapRectToScene(self, float, float, float, float) -> QRectF mapToItem
mapToItem(self, QGraphicsItem, QRectF) -> QPolygonF mapToParent
mapToParent(self, QRectF) -> QPolygonF mapToScene
mapToScene(self, QRectF) -> QPolygonF metaObject
minimumSize
Returns the minimum allowed size of the item, if applicable, or an empty size if item can be freely resized. model
Returns the legend model. mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveBy
moveContent
Moves the content of the item, by a specified dx
anddy
in layout units.moveToThread
numberExportLayers
Returns the number of layers that this item requires for exporting during layered exports (e.g. objectName
opacity
opaqueArea
page
Returns the page the item is currently on, with the first page returning 0. pagePos
Returns the item’s position (in layout units) relative to the top left corner of its current page. pagePositionWithUnits
Returns the item’s position (in item units) relative to the top left corner of its current page. paint
panel
panelModality
parent
parentGroup
Returns the item’s parent group, if the item is part of a QgsLayoutItemGroup group. parentItem
parentObject
parentWidget
pen
pos
positionAtReferencePoint
positionWithUnits
Returns the item’s current position, including units. prepareGeometryChange
property
propertyDefinitions
Returns the layout object property definitions. pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. rasterStrokeColor
Returns the stroke color for the stroke drawn around raster symbol items. rasterStrokeWidth
Returns the stroke width (in layout units) for the stroke drawn around raster symbol items. readObjectPropertiesFromElement
readPropertiesFromElement
readXml
Sets the item state from a DOM element. receivers
rect
rectWithFrame
Returns the item’s rectangular bounds, including any bleed caused by the item’s frame. redraw
Triggers a redraw (update) of the item. referencePoint
Returns the reference point for positioning of the layout item. refresh
refreshBackgroundColor
refreshBlendMode
refreshDataDefinedProperty
refreshFrame
refreshItemPosition
refreshItemRotation
refreshItemSize
refreshOpacity
removeCustomProperty
Remove a custom property from the object. removeEventFilter
removeSceneEventFilter
requiresRasterization
Returns true if the item is drawn in such a way that forces the whole layout to be rasterized when exporting to vector formats. resetTransform
resizeToContents
Returns whether the legend should automatically resize to fit its contents. rotateItem
Rotates the item by a specified angle
in degrees clockwise around a specified reference point.rotation
rstyle
Returns reference to modifiable legend style. scale
scene
sceneBoundingRect
sceneEvent
sceneEventFilter
scenePos
sceneTransform
scroll
sender
senderSignalIndex
setAcceptDrops
setAcceptHoverEvents
setAcceptTouchEvents
setAcceptedMouseButtons
setActive
setAutoUpdateModel
Sets whether the legend content should auto update to reflect changes in the project’s layer tree. setBackgroundColor
Sets the background color
for this item.setBackgroundEnabled
Sets whether this item has a background drawn under it or not. setBlendMode
Sets the item’s composition blending mode
.setBoundingRegionGranularity
setBoxSpace
Sets the legend box space
.setBrush
setCacheMode
setColumnCount
Sets the legend column count
.setColumnSpace
Sets the legend column spacing
.setCursor
setCustomProperty
Set a custom property for the object. setData
setDataDefinedProperties
Sets the objects’s property collection, used for data defined overrides. setDrawRasterStroke
Sets whether a stroke will be drawn around raster symbol items. setEnabled
setEqualColumnWidth
Sets whether column widths should be equalized. setExcludeFromExports
Sets whether the item should be excluded from layout exports and prints. setFiltersChildEvents
setFixedSize
setFlag
setFlags
setFocus
setFocusProxy
setFontColor
Sets the legend font color
.setFrameEnabled
Sets whether this item has a frame drawn around it or not. setFrameJoinStyle
Sets the join style
used when drawing the item’s frame.setFrameStrokeColor
Sets the frame stroke color
.setFrameStrokeWidth
Sets the frame stroke width
.setGraphicsEffect
setGroup
setId
Set the item’s id
name.setInputMethodHints
setItemOpacity
Sets the item’s opacity
.setItemRotation
Sets the layout item’s rotation
, in degrees clockwise.setLegendFilterByMapEnabled
Set whether legend items should be filtered to show just the ones visible in the associated map. setLegendFilterOutAtlas
When set to true, during an atlas rendering, it will filter out legend elements where features are outside the current atlas feature. setLineSpacing
Sets the spacing
in-between multiple lines.setLinkedMap
Sets the map
to associate with the legend.setLocked
Sets whether the item is locked
, preventing mouse interactions with the item.setMinimumSize
setMoveContentPreviewOffset
Sets temporary offset for the item, by a specified dx
anddy
in layout units.setObjectName
setOpacity
setPanelModality
setParent
setParentGroup
Sets the item’s parent group
.setParentItem
setPen
setPos
setPos(self, float, float) setProperty
setRasterStrokeColor
Sets the stroke color
for the stroke drawn around raster symbol items.setRasterStrokeWidth
Sets the stroke width for the stroke drawn around raster symbol items. setRect
setRect(self, float, float, float, float) setReferencePoint
Sets the reference point
for positioning of the layout item.setResizeToContents
Sets whether the legend should automatically resize to fit its contents. setRotation
setScale
setSelected
Sets whether the item should be selected. setSplitLayer
Sets whether the legend items from a single layer can be split over multiple columns. setStyle
Sets the style of component
tostyle
for the legend.setStyleFont
Sets the style font
for a legendcomponent
.setStyleMargin
Set the margin
for a legendcomponent
.setSymbolHeight
Sets the legend symbol height
.setSymbolWidth
Sets the legend symbol width
.setTitle
Sets the legend title
.setTitleAlignment
Sets the alignment
of the legend title.setToolTip
setTransform
setTransformOriginPoint
setTransformOriginPoint(self, float, float) setTransformations
setVisibility
Sets whether the item is visible
.setVisible
setWmsLegendHeight
Sets the WMS legend height
.setWmsLegendWidth
Sets the WMS legend width
.setWrapString
Sets the legend text wrapping string
.setX
setY
setZValue
shape
shouldDrawItem
Returns whether the item should be drawn in the current context. show
signalsBlocked
sizeWithUnits
Returns the item’s current size, including units. splitLayer
Returns whether the legend items from a single layer can be split over multiple columns. stackBefore
startTimer
style
Returns legend style. styleFont
Returns the font settings for a legend component
.symbolHeight
Returns the legend symbol height. symbolWidth
Returns the legend symbol width. templateUuid
Returns the item’s original identification string. thread
timerEvent
title
Returns the legend title. titleAlignment
Returns the alignment of the legend title. toGraphicsObject
toolTip
topLeftToReferencePoint
topLevelItem
topLevelWidget
tr
transform
transformOriginPoint
transformations
type
ungrabKeyboard
ungrabMouse
unsetCursor
update
update(self, float, float, float, float) updateFilterByMap
Updates the legend content when filtered by map. updateLegend
Updates the model and all legend entries. updateMicroFocus
uuid
Returns the item identification string. wheelEvent
window
wmsLegendHeight
Returns the WMS legend height. wmsLegendWidth
Returns the WMS legend width. wrapString
Returns the legend text wrapping string. writeObjectPropertiesToElement
writePropertiesToElement
writeXml
Stores the item state in a DOM element. x
y
zValue
zoomContent
Zooms content of item. Attributes
AllProperties
BackgroundColor
BlendMode
DeviceCoordinateCache
EvaluatedValue
ExcludeFromExports
FrameColor
ItemAcceptsInputMethod
ItemChildAddedChange
ItemChildRemovedChange
ItemClipsChildrenToShape
ItemClipsToShape
ItemContainsChildrenInShape
ItemCoordinateCache
ItemCursorChange
ItemCursorHasChanged
ItemDoesntPropagateOpacityToChildren
ItemEnabledChange
ItemEnabledHasChanged
ItemFlagsChange
ItemFlagsHaveChanged
ItemHasNoContents
ItemHeight
ItemIgnoresParentOpacity
ItemIgnoresTransformations
ItemIsFocusable
ItemIsMovable
ItemIsPanel
ItemIsSelectable
ItemMatrixChange
ItemNegativeZStacksBehindParent
ItemOpacityChange
ItemOpacityHasChanged
ItemParentChange
ItemParentHasChanged
ItemPositionChange
ItemPositionHasChanged
ItemRotation
ItemRotationChange
ItemRotationHasChanged
ItemScaleChange
ItemScaleHasChanged
ItemSceneChange
ItemSceneHasChanged
ItemScenePositionHasChanged
ItemSelectedChange
ItemSelectedHasChanged
ItemSendsGeometryChanges
ItemSendsScenePositionChanges
ItemStacksBehindParent
ItemToolTipChange
ItemToolTipHasChanged
ItemTransformChange
ItemTransformHasChanged
ItemTransformOriginPointChange
ItemTransformOriginPointHasChanged
ItemUsesExtendedStyleOption
ItemVisibleChange
ItemVisibleHasChanged
ItemWidth
ItemZValueChange
ItemZValueHasChanged
LegendColumnCount
LegendTitle
LowerLeft
LowerMiddle
LowerRight
MapAtlasMargin
MapLayers
MapRotation
MapScale
MapStylePreset
MapXMax
MapXMin
MapYMax
MapYMin
Middle
MiddleLeft
MiddleRight
NoCache
NoProperty
NonModal
NumPages
Opacity
OriginalValue
PageNumber
PanelModal
PaperHeight
PaperOrientation
PaperWidth
PictureSource
PictureSvgBackgroundColor
PictureSvgStrokeColor
PictureSvgStrokeWidth
PositionX
PositionY
PresetPaperSize
ScalebarFillColor
ScalebarFillColor2
ScalebarLineColor
ScalebarLineWidth
SceneModal
SourceUrl
TestProperty
Transparency
Type
UndoArrowHeadFillColor
UndoArrowHeadStrokeColor
UndoArrowHeadWidth
UndoArrowStrokeWidth
UndoAtlasMargin
UndoBackgroundColor
UndoCustomCommand
UndoGridFramePenColor
UndoIncrementalMove
UndoIncrementalResize
UndoLabelFont
UndoLabelFontColor
UndoLabelMargin
UndoLabelText
UndoLegendBoxSpace
UndoLegendColumnCount
UndoLegendColumnSpace
UndoLegendFontColor
UndoLegendGroupFont
UndoLegendGroupSpace
UndoLegendIconSymbolSpace
UndoLegendItemFont
UndoLegendLayerFont
UndoLegendLayerSpace
UndoLegendLineSpacing
UndoLegendRasterStrokeColor
UndoLegendRasterStrokeWidth
UndoLegendSymbolHeight
UndoLegendSymbolSpace
UndoLegendSymbolWidth
UndoLegendText
UndoLegendTitleFont
UndoLegendTitleSpaceBottom
UndoLegendWmsLegendHeight
UndoLegendWmsLegendWidth
UndoMapAnnotationDistance
UndoMapGridAnnotationFontColor
UndoMapGridFrameFill1Color
UndoMapGridFrameFill2Color
UndoMapGridLineSymbol
UndoMapGridMarkerSymbol
UndoMapRotation
UndoNodeMove
UndoNone
UndoOpacity
UndoOverviewStyle
UndoPictureFillColor
UndoPictureNorthOffset
UndoPictureRotation
UndoPictureStrokeColor
UndoPictureStrokeWidth
UndoRotation
UndoScaleBarBoxContentSpace
UndoScaleBarFillColor
UndoScaleBarFillColor2
UndoScaleBarFontColor
UndoScaleBarHeight
UndoScaleBarLabelBarSize
UndoScaleBarLineWidth
UndoScaleBarMapUnitsSegment
UndoScaleBarSegmentSize
UndoScaleBarSegments
UndoScaleBarSegmentsLeft
UndoScaleBarStrokeColor
UndoScaleBarUnitText
UndoSetId
UndoShapeCornerRadius
UndoShapeStyle
UndoStrokeColor
UndoStrokeWidth
UndoZoomContent
UpperLeft
UpperMiddle
UpperRight
UserType
changed
Emitted when the object’s properties change. destroyed
destroyed(self, QObject = None) [signal] frameChanged
Emitted if the item’s frame style changes. lockChanged
Emitted if the item’s lock status changes. objectNameChanged
objectNameChanged(self, str) [signal] rotationChanged
Emitted on item rotation change. sizePositionChanged
Emitted when the item’s size or position changes. staticMetaObject
-
adjustBoxSize
(self)¶ Sets the legend’s item bounds to fit the whole legend content.
-
adjustPointForReferencePosition
()¶
-
applyDataDefinedSize
()¶
-
applyItemSizeConstraint
()¶
-
autoUpdateModel
(self) → bool¶ Returns whether the legend content should auto update to reflect changes in the project’s layer tree.
See also
-
boxSpace
(self) → float¶ Returns the legend box space.
See also
-
childEvent
()¶
-
columnCount
(self) → int¶ Returns the legend column count.
See also
-
columnSpace
(self) → float¶ Returns the legend column spacing.
See also
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
(layout: QgsLayout) → QgsLayoutItemLegend¶ Returns a new legend item for the specified
layout
.The caller takes responsibility for deleting the returned object.
-
customEvent
()¶
-
disconnectNotify
()¶
-
displayName
(self) → str¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
draw
(self, context: QgsRenderContext, itemStyle: QStyleOptionGraphicsItem = None)¶
-
drawBackground
()¶
-
drawDebugRect
()¶
-
drawFrame
()¶
-
drawRasterStroke
(self) → bool¶ Returns whether a stroke will be drawn around raster symbol items.
See also
See also
See also
-
dropEvent
()¶
-
equalColumnWidth
(self) → bool¶ Returns whether column widths should be equalized.
See also
-
finalizeRestoreFromXml
(self)¶
-
focusInEvent
()¶
-
focusOutEvent
()¶
-
fontColor
(self) → QColor¶ Returns the legend font color.
See also
-
hoverEnterEvent
()¶
-
hoverLeaveEvent
()¶
-
hoverMoveEvent
()¶
-
icon
(self) → QIcon¶
-
inputMethodEvent
()¶
-
inputMethodQuery
()¶
-
isSignalConnected
()¶
-
itemChange
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
legendFilterByMapEnabled
(self) → bool¶ Find out whether legend items are filtered to show just the ones visible in the associated map
See also
-
legendFilterOutAtlas
(self) → bool¶ Returns whether to filter out legend elements outside of the current atlas feature.
See also
-
legendSettings
(self) → QgsLegendSettings¶ Returns the legend’s renderer settings object.
-
lineSpacing
(self) → float¶ Returns the spacing in-between lines in layout units.
See also
-
linkedMap
(self) → QgsLayoutItemMap¶ Returns the associated map.
See also
-
model
(self) → QgsLegendModel¶ Returns the legend model.
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
paint
(self, painter: QPainter, itemStyle: QStyleOptionGraphicsItem, pWidget: QWidget)¶
-
positionAtReferencePoint
()¶
-
prepareGeometryChange
()¶
-
rasterStrokeColor
(self) → QColor¶ Returns the stroke color for the stroke drawn around raster symbol items. The stroke is only drawn if drawRasterStroke() is true.
See also
See also
See also
-
rasterStrokeWidth
(self) → float¶ Returns the stroke width (in layout units) for the stroke drawn around raster symbol items. The stroke is only drawn if drawRasterStroke() is true.
See also
See also
See also
-
readObjectPropertiesFromElement
()¶
-
readPropertiesFromElement
(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶
-
receivers
()¶
-
refresh
(self)¶
-
refreshBackgroundColor
()¶
-
refreshBlendMode
()¶
-
refreshDataDefinedProperty
(self, property: QgsLayoutObject.DataDefinedProperty = QgsLayoutObject.AllProperties)¶
-
refreshFrame
()¶
-
refreshItemPosition
()¶
-
refreshItemRotation
()¶
-
refreshItemSize
()¶
-
refreshOpacity
()¶
-
resizeToContents
(self) → bool¶ Returns whether the legend should automatically resize to fit its contents.
See also
-
rstyle
(self, s: QgsLegendStyle.Style) → QgsLegendStyle¶ Returns reference to modifiable legend style.
-
sceneEvent
()¶
-
sceneEventFilter
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setAutoUpdateModel
(self, autoUpdate: bool)¶ Sets whether the legend content should auto update to reflect changes in the project’s layer tree.
See also
-
setBoxSpace
(self, space: float)¶ Sets the legend box
space
.See also
-
setColumnCount
(self, count: int)¶ Sets the legend column
count
.See also
-
setColumnSpace
(self, spacing: float)¶ Sets the legend column
spacing
.See also
-
setDrawRasterStroke
(self, enabled: bool)¶ Sets whether a stroke will be drawn around raster symbol items.
Parameters: enabled – set to true to draw borders See also
See also
See also
-
setEqualColumnWidth
(self, equalize: bool)¶ Sets whether column widths should be equalized.
See also
-
setFixedSize
()¶
-
setFontColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the legend font
color
.See also
-
setLegendFilterByMapEnabled
(self, enabled: bool)¶ Set whether legend items should be filtered to show just the ones visible in the associated map.
See also
-
setLegendFilterOutAtlas
(self, doFilter: bool)¶ When set to true, during an atlas rendering, it will filter out legend elements where features are outside the current atlas feature.
See also
-
setLineSpacing
(self, spacing: float)¶ Sets the
spacing
in-between multiple lines.See also
-
setLinkedMap
(self, map: QgsLayoutItemMap)¶ Sets the
map
to associate with the legend.See also
-
setMinimumSize
()¶
-
setRasterStrokeColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the stroke
color
for the stroke drawn around raster symbol items. The stroke is only drawn if drawRasterStroke() is true.See also
See also
See also
-
setRasterStrokeWidth
(self, width: float)¶ Sets the stroke width for the stroke drawn around raster symbol items. The stroke is only drawn if drawRasterStroke() is true.
See also
See also
See also
-
setResizeToContents
(self, enabled: bool)¶ Sets whether the legend should automatically resize to fit its contents.
Parameters: enabled – set to false to disable automatic resizing. The legend frame will not be expanded to fit legend items, and items may be cropped from display.
See also
-
setSplitLayer
(self, enabled: bool)¶ Sets whether the legend items from a single layer can be split over multiple columns.
See also
-
setStyle
(self, component: QgsLegendStyle.Style, style: QgsLegendStyle)¶ Sets the style of
component
tostyle
for the legend.
-
setStyleFont
(self, component: QgsLegendStyle.Style, font: QFont)¶ Sets the style
font
for a legendcomponent
.See also
-
setStyleMargin
(self, component: QgsLegendStyle.Style, margin: float)¶ Set the
margin
for a legendcomponent
.setStyleMargin(self, component: QgsLegendStyle.Style, side: QgsLegendStyle.Side, margin: float) Set the
margin
for a particularside
of a legendcomponent
.
-
setSymbolHeight
(self, height: float)¶ Sets the legend symbol
height
.See also
-
setSymbolWidth
(self, width: float)¶ Sets the legend symbol
width
.See also
-
setTitleAlignment
(self, alignment: Qt.AlignmentFlag)¶ Sets the
alignment
of the legend title.See also
-
setWmsLegendHeight
(self, height: float)¶ Sets the WMS legend
height
.See also
-
setWmsLegendWidth
(self, width: float)¶ Sets the WMS legend
width
.See also
-
setWrapString
(self, string: str)¶ Sets the legend text wrapping
string
.See also
-
splitLayer
(self) → bool¶ Returns whether the legend items from a single layer can be split over multiple columns.
See also
-
style
(self, s: QgsLegendStyle.Style) → QgsLegendStyle¶ Returns legend style.
-
styleFont
(self, component: QgsLegendStyle.Style) → QFont¶ Returns the font settings for a legend
component
.See also
-
symbolHeight
(self) → float¶ Returns the legend symbol height.
See also
-
symbolWidth
(self) → float¶ Returns the legend symbol width.
See also
-
timerEvent
()¶
-
title
(self) → str¶ Returns the legend title.
See also
-
titleAlignment
(self) → Qt.AlignmentFlag¶ Returns the alignment of the legend title.
See also
-
topLeftToReferencePoint
()¶
-
type
(self) → int¶
-
updateFilterByMap
(self, redraw: bool = True)¶ Updates the legend content when filtered by map.
-
updateLegend
(self)¶ Updates the model and all legend entries.
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-
wmsLegendHeight
(self) → float¶ Returns the WMS legend height.
See also
-
wmsLegendWidth
(self) → float¶ Returns the WMS legend width.
See also
-
wrapString
(self) → str¶ Returns the legend text wrapping string.
See also
-
writeObjectPropertiesToElement
()¶
-
writePropertiesToElement
(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶
-