Class: QgsLayoutFrame

class qgis.core.QgsLayoutFrame

Bases: QgsLayoutItem

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

New in version 3.0.

QgsLayoutFrame(layout: QgsLayout, multiFrame: QgsLayoutMultiFrame) Constructor for QgsLayoutFrame, with the specified parent layout and belonging to a multiFrame.

Methods

childEvent

cleanup

connectNotify

contextMenuEvent

create

Creates a new QgsLayoutFrame belonging to the specified layout.

createExpressionContext

rtype

QgsExpressionContext

customEvent

disconnectNotify

displayName

rtype

str

dragEnterEvent

dragLeaveEvent

dragMoveEvent

draw

param context

drawBackground

param context

drawFrame

param context

dropEvent

exportLayerBehavior

rtype

QgsLayoutItem.ExportLayerBehavior

extent

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

fixedSize

rtype

QgsLayoutSize

focusInEvent

focusOutEvent

hideBackgroundIfEmpty

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

hidePageIfEmpty

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

hoverEnterEvent

hoverLeaveEvent

hoverMoveEvent

icon

rtype

QIcon

inputMethodEvent

inputMethodQuery

isEmpty

Returns whether the frame is empty.

isSignalConnected

itemChange

keyPressEvent

keyReleaseEvent

minimumSize

rtype

QgsLayoutSize

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

multiFrame

Returns the parent multiframe for the frame.

prepareGeometryChange

readPropertiesFromElement

param itemElement

receivers

sceneEvent

sceneEventFilter

sender

senderSignalIndex

setContentSection

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

setHideBackgroundIfEmpty

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

setHidePageIfEmpty

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

timerEvent

type

rtype

int

updateMicroFocus

wheelEvent

writePropertiesToElement

param parentElement

childEvent(self, QChildEvent)
cleanup(self)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QGraphicsSceneContextMenuEvent)
create(layout: QgsLayout) QgsLayoutFrame

Creates a new QgsLayoutFrame belonging to the specified layout.

Parameters

layout (QgsLayout) –

Return type

QgsLayoutFrame

createExpressionContext(self) QgsExpressionContext
Return type

QgsExpressionContext

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
displayName(self) str
Return type

str

dragEnterEvent(self, QGraphicsSceneDragDropEvent)
dragLeaveEvent(self, QGraphicsSceneDragDropEvent)
dragMoveEvent(self, QGraphicsSceneDragDropEvent)
draw(self, context: QgsLayoutItemRenderContext)
Parameters

context (QgsLayoutItemRenderContext) –

drawBackground(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

drawFrame(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

dropEvent(self, QGraphicsSceneDragDropEvent)
exportLayerBehavior(self) QgsLayoutItem.ExportLayerBehavior
Return type

QgsLayoutItem.ExportLayerBehavior

extent(self) QRectF

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

Return type

QRectF

fixedSize(self) QgsLayoutSize
Return type

QgsLayoutSize

focusInEvent(self, QFocusEvent)
focusOutEvent(self, QFocusEvent)
hideBackgroundIfEmpty(self) bool

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

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

hoverEnterEvent(self, QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, QGraphicsSceneHoverEvent)
hoverMoveEvent(self, QGraphicsSceneHoverEvent)
icon(self) QIcon
Return type

QIcon

inputMethodEvent(self, QInputMethodEvent)
inputMethodQuery(self, Qt.InputMethodQuery) Any
isEmpty(self) bool

Returns whether the frame is empty.

Return type

bool

isSignalConnected(self, QMetaMethod) bool
itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
minimumSize(self) QgsLayoutSize
Return type

QgsLayoutSize

mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)
mouseMoveEvent(self, QGraphicsSceneMouseEvent)
mousePressEvent(self, QGraphicsSceneMouseEvent)
mouseReleaseEvent(self, QGraphicsSceneMouseEvent)
multiFrame(self) QgsLayoutMultiFrame

Returns the parent multiframe for the frame.

Return type

QgsLayoutMultiFrame

prepareGeometryChange(self)
readPropertiesFromElement(self, itemElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool
Parameters
Return type

bool

receivers(self, PYQT_SIGNAL) int
sceneEvent(self, QEvent) bool
sceneEventFilter(self, QGraphicsItem, QEvent) bool
sender(self) QObject
senderSignalIndex(self) int
setContentSection(self, section: QRectF)

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)

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)

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

timerEvent(self, QTimerEvent)
type(self) int
Return type

int

updateMicroFocus(self)
wheelEvent(self, QGraphicsSceneWheelEvent)
writePropertiesToElement(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool
Parameters
  • parentElement (QDomElement) –

  • document (QDomDocument) –

  • context (QgsReadWriteContext) –

Return type

bool