Class: QgsOverlayWidgetLayout

A custom layout which can be used to overlay child widgets over a parent widget.

Added in version 3.38.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsOverlayWidgetLayout

Base classes

QLayout

QObject

QLayoutItem

Methods

addWidget

Adds a widget to the layout, which will be bound to the specified edge.

horizontalSpacing

Returns the spacing between widgets that are laid out side by side.

setHorizontalSpacing

Sets the spacing between widgets that are laid out side by side.

setVerticalSpacing

Sets the spacing between widgets that are laid out on top of each other.

verticalSpacing

Returns the spacing between widgets that are laid out on top of each other.

class qgis.gui.QgsOverlayWidgetLayout[source]

Bases: QLayout

__init__(parent: QWidget | None = None)

Constructor for QgsOverlayWidgetLayout, with the specified parent widget.

Parameters:

parent (Optional[QWidget] = None)

addWidget(self, widget: QWidget | None, edge: Qt.Edge)[source]

Adds a widget to the layout, which will be bound to the specified edge.

Note

Widgets on the left and right edges will always be positioned first, with top and bottom edge widgets expanding to take the remaining horizontal space.

Parameters:
  • widget (Optional[QWidget])

  • edge (Qt.Edge)

horizontalSpacing(self) int[source]

Returns the spacing between widgets that are laid out side by side.

Return type:

int

setHorizontalSpacing(self, spacing: int)[source]

Sets the spacing between widgets that are laid out side by side.

Parameters:

spacing (int)

setVerticalSpacing(self, spacing: int)[source]

Sets the spacing between widgets that are laid out on top of each other.

Parameters:

spacing (int)

verticalSpacing(self) int[source]

Returns the spacing between widgets that are laid out on top of each other.

Return type:

int