Class: QgsMargins

Methods

bottom

Returns the bottom margin.

isNull

Returns c True if all margins are is 0; otherwise returns False.

left

Returns the left margin.

right

Returns the right margin.

setBottom

Sets the bottom margin to bottom.

setLeft

Sets the left margin to left.

setRight

Sets the right margin to right.

setTop

Sets the top margin to top.

toString

Returns the margins encoded to a string.

top

Returns the top margin.

Static Methods

fromString

Returns a QgsMargins object decoded from a string, or a null QgsMargins if the string could not be interpreted as margins.

class qgis.core.QgsMargins[source]

Bases: object

__init__(left: float, top: float, right: float, bottom: float)

Constructs margins with the given left, top, right, bottom

See also

setLeft()

See also

setRight()

See also

setTop()

See also

setBottom()

Parameters:
  • left (float)

  • top (float)

  • right (float)

  • bottom (float)

__init__(a0: QgsMargins)
Parameters:

a0 (QgsMargins)

bottom(self) float[source]

Returns the bottom margin.

See also

setBottom()

Return type:

float

static fromString(string: str | None) QgsMargins[source]

Returns a QgsMargins object decoded from a string, or a null QgsMargins if the string could not be interpreted as margins.

See also

toString()

Parameters:

string (Optional[str])

Return type:

QgsMargins

isNull(self) bool[source]

Returns c True if all margins are is 0; otherwise returns False.

Return type:

bool

left(self) float[source]

Returns the left margin.

See also

setLeft()

Return type:

float

right(self) float[source]

Returns the right margin.

See also

setRight()

Return type:

float

setBottom(self, bottom: float)[source]

Sets the bottom margin to bottom.

See also

bottom()

Parameters:

bottom (float)

setLeft(self, left: float)[source]

Sets the left margin to left.

See also

left()

Parameters:

left (float)

setRight(self, right: float)[source]

Sets the right margin to right.

See also

right()

Parameters:

right (float)

setTop(self, top: float)[source]

Sets the top margin to top.

See also

top()

Parameters:

top (float)

toString(self) str[source]

Returns the margins encoded to a string.

See also

fromString()

Return type:

str

top(self) float[source]

Returns the top margin.

See also

setTop()

Return type:

float