Class: QgsLayoutFrame

Base class for frame items, which form a layout multiframe item.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutFrame

Base classes

QgsLayoutItem

Base class for graphical items within a QgsLayout.

QgsLayoutObject

A base class for objects which belong to a layout.

QObject

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

QGraphicsRectItem

QAbstractGraphicsShapeItem

QGraphicsItem

QgsLayoutUndoObjectInterface

Interface for layout objects which support undo/redo commands.

class qgis.core.QgsLayoutFrame[source]

Bases: QgsLayoutItem

__init__(layout: QgsLayout | None, multiFrame: QgsLayoutMultiFrame | None)

Constructor for QgsLayoutFrame, with the specified parent layout and belonging to a multiFrame.

Parameters:
static create(layout: QgsLayout | None) QgsLayoutFrame | None[source]

Creates a new QgsLayoutFrame belonging to the specified layout.

Parameters:

layout (Optional[QgsLayout])

Return type:

Optional[QgsLayoutFrame]

extent(self) QRectF[source]

Returns the visible portion of the multi frame’s content which is shown in this frame, in layout units.

Return type:

QRectF

hideBackgroundIfEmpty(self) bool[source]

Returns whether the background and frame stroke should be hidden if this frame is empty

Return type:

bool

Returns:

True if background and stroke should be hidden if frame is empty

hidePageIfEmpty(self) bool[source]

Returns whether the page should be hidden (ie, not included in layout exports) if this frame is empty

Return type:

bool

Returns:

True if page should be hidden if frame is empty

isEmpty(self) bool[source]

Returns whether the frame is empty.

Return type:

bool

multiFrame(self) QgsLayoutMultiFrame | None[source]

Returns the parent multiframe for the frame.

Return type:

Optional[QgsLayoutMultiFrame]

setContentSection(self, section: QRectF)[source]

Sets the visible part of the multiframe’s content which is visible within this frame (relative to the total multiframe extent in layout units).

See also

extent()

Parameters:

section (QRectF)

setHideBackgroundIfEmpty(self, hideBackgroundIfEmpty: bool)[source]

Sets whether the background and frame stroke should be hidden if this frame is empty

Parameters:

hideBackgroundIfEmpty (bool) – set to True if background and stroke should be hidden if frame is empty

setHidePageIfEmpty(self, hidePageIfEmpty: bool)[source]

Sets whether the page should be hidden (ie, not included in layout exports) if this frame is empty

Parameters:

hidePageIfEmpty (bool) – set to True if page should be hidden if frame is empty