Subgroup: other

Class: QgsPrintLayout

class qgis.core.QgsPrintLayout

Bases: qgis._core.QgsLayout, qgis._core.QgsMasterLayoutInterface

Print layout, a QgsLayout subclass for static or atlas-based layouts.

New in version 3.0: Methods

activePanel
activeWindow
addEllipse addEllipse(self, float, float, float, float, pen: Union[QPen, QColor, Qt.GlobalColor, QGradient] = QPen(), brush: Union[QBrush, QColor, Qt.GlobalColor, QGradient] = QBrush()) -> QGraphicsEllipseItem
addItem
addItemsFromXml Add items from an XML representation to the layout.
addLayoutItem Adds an item to the layout.
addLine addLine(self, float, float, float, float, pen: Union[QPen, QColor, Qt.GlobalColor, QGradient] = QPen()) -> QGraphicsLineItem
addMultiFrame Adds a multiFrame to the layout.
addPath
addPixmap
addPolygon
addRect addRect(self, float, float, float, float, pen: Union[QPen, QColor, Qt.GlobalColor, QGradient] = QPen(), brush: Union[QBrush, QColor, Qt.GlobalColor, QGradient] = QBrush()) -> QGraphicsRectItem
addSimpleText
addText
addWidget
advance
atlas Returns the print layout’s atlas.
backgroundBrush
blockSignals
bspTreeDepth
childEvent
children
clear Clears the layout.
clearFocus
clearSelection
clone
collidingItems
connectNotify
contextMenuEvent
convertFromLayoutUnits Converts a length measurement from the layout’s native units to a specified target unit.
convertToLayoutUnits Converts a measurement into the layout’s native units.
createCommand
createExpressionContext
createItemGroup
customEvent
customProperties Return list of keys stored in custom properties for the layout.
customProperty Read a custom property from the layout.
deleteLater
deselectAll Clears any selected items in the layout.
destroyItemGroup
disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
drawBackground
drawForeground
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
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]
focusInEvent
focusItem
focusNextPrevChild
focusOutEvent
font
foregroundBrush
gridSettings Returns a reference to the layout’s grid settings, which stores settings relating to grid appearance, spacing and offsets.
groupItems Creates a new group from a list of layout items and adds the group to the layout.
guides Returns a reference to the layout’s guide collection, which manages page snap guides.
hasFocus
height
helpEvent
icon
inherits
initializeDefaults Initializes an empty layout, e.g.
inputMethodEvent
inputMethodQuery
installEventFilter
invalidate invalidate(self, float, float, float, float, layers: Union[QGraphicsScene.SceneLayers, QGraphicsScene.SceneLayer] = QGraphicsScene.AllLayers)
isActive
isSignalConnected
isWidgetType
isWindowType
itemAt itemAt(self, float, float, QTransform) -> QGraphicsItem
itemById Returns a layout item given its id.
itemByUuid Returns the layout item with matching uuid unique identifier, or a None if a matching item could not be found.
itemIndexMethod
items items(self, Union[QPointF, QPoint], mode: Qt.ItemSelectionMode = Qt.IntersectsItemShape, order: Qt.SortOrder = Qt.DescendingOrder, deviceTransform: QTransform = QTransform()) -> List[QGraphicsItem]
itemsBoundingRect
itemsModel Returns the items model attached to the layout.
keyPressEvent
keyReleaseEvent
killTimer
layoutBounds Calculates the bounds of all non-gui items in the layout.
layoutItemAt Returns the topmost layout item at a specified position.
layoutProject
layoutType
loadFromTemplate Load a layout template document.
lowerItem Lowers an item down the z-order.
metaObject
minimumRenderSize
mouseDoubleClickEvent
mouseGrabberItem
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveItemToBottom Lowers an item down to the bottom of the z-order.
moveItemToTop Raises an item up to the top of the z-order.
moveToThread
multiFrameByUuid Returns the layout multiframe with matching uuid unique identifier, or a None if a matching multiframe could not be found.
multiFrames Returns a list of multi frames contained in the layout.
name
objectName
pageCollection Returns a pointer to the layout’s page collection, which stores and manages page items in the layout.
pageItemBounds Returns the bounding box of the items contained on a specified page.
palette
parent
project The project associated with the layout.
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
raiseItem Raises an item up the z-order.
readLayoutXml
readXml
receivers
referenceMap Returns the map item which will be used to generate corresponding world files when the layout is exported.
refresh Forces the layout, and all items contained within it, to refresh.
removeCustomProperty Remove a custom property from the layout.
removeEventFilter
removeItem
removeLayoutItem Removes an item from the layout.
removeMultiFrame Removes a multiFrame from the layout (but does not delete it).
render
renderContext Returns a reference to the layout’s render context, which stores information relating to the current rendering settings for the layout.
reportContext Returns a reference to the layout’s report context, which stores information relating to the current reporting context for the layout.
saveAsTemplate Saves the layout as a template at the given file path.
sceneRect
selectedItems
selectedLayoutItems Returns list of selected layout items.
selectionArea
sendEvent
sender
senderSignalIndex
setActivePanel
setActiveWindow
setBackgroundBrush
setBspTreeDepth
setCustomProperty Set a custom property for the layout.
setFocus
setFocusItem
setFont
setForegroundBrush
setItemIndexMethod
setMinimumRenderSize
setName
setObjectName
setPalette
setParent
setProperty
setReferenceMap Sets the map item which will be used to generate corresponding world files when the layout is exported.
setSceneRect setSceneRect(self, float, float, float, float)
setSelectedItem Clears any selected items and sets item as the current selection.
setSelectionArea setSelectionArea(self, QPainterPath, mode: Qt.ItemSelectionMode = Qt.IntersectsItemShape, deviceTransform: QTransform = QTransform())
setStickyFocus
setStyle
setUnits Sets the native measurement units for the layout.
signalsBlocked
snapper Returns a reference to the layout’s snapper, which stores handles layout snap grids and lines and snapping points to the nearest matching point.
startTimer
stickyFocus
style
thread
timerEvent
tr
undoStack Returns a pointer to the layout’s undo stack, which manages undo/redo states for the layout and it’s associated objects.
ungroupItems Ungroups items by removing them from an item group and removing the group from the layout.
units Returns the native units for the layout.
update update(self, float, float, float, float)
updateBounds Updates the scene bounds of the layout.
updateZValues Resets the z-values of items based on their position in the internal z order list.
views
wheelEvent
width
writeLayoutXml
writeXml

Attributes

AllLayers
BackgroundLayer
BspTreeIndex
ForegroundLayer
ItemLayer
NoIndex
PrintLayout
Report
UndoLayoutDpi
UndoNone
ZGrid
ZGuide
ZItem
ZMouseHandles
ZPage
ZSmartGuide
ZSnapIndicator
ZViewTool
changed Is emitted when properties of the layout change.
destroyed destroyed(self, QObject = None) [signal]
nameChanged Emitted when the layout’s name is changed.
objectNameChanged objectNameChanged(self, str) [signal]
refreshed Is emitted when the layout has been refreshed and items should also be refreshed and updated.
sceneRectChanged sceneRectChanged(self, QRectF) [signal]
selectedItemChanged Emitted whenever the selected item changes.
selectionChanged selectionChanged(self) [signal]
staticMetaObject
variablesChanged Emitted whenever the expression variables stored in the layout have been changed.
atlas(self) → QgsLayoutAtlas

Returns the print layout’s atlas.

childEvent()
clone(self) → QgsPrintLayout
connectNotify()
contextMenuEvent()
createExpressionContext(self) → QgsExpressionContext
customEvent()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
drawBackground()
drawForeground()
dropEvent()
event()
eventFilter()
focusInEvent()
focusNextPrevChild()
focusOutEvent()
helpEvent()
icon(self) → QIcon
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
layoutProject(self) → QgsProject
layoutType(self) → QgsMasterLayoutInterface.Type
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
name(self) → str
nameChanged

Emitted when the layout’s name is changed.

See also

setName() [signal]

readLayoutXml(self, layoutElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool
readXml(self, layoutElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool
receivers()
sender()
senderSignalIndex()
setName(self, name: str)
timerEvent()
wheelEvent()
writeLayoutXml(self, document: QDomDocument, context: QgsReadWriteContext) → QDomElement
writeXml(self, document: QDomDocument, context: QgsReadWriteContext) → QDomElement