|  | Home · All Classes · Modules

# QMargins Class Reference
[QtCore module]

The QMargins class defines the four margins of a rectangle. More...

### Methods

- __init__ (self)
- __init__ (self, int, int, int, int)
- __init__ (self, QMargins)
- int bottom (self)
- bool isNull (self)
- int left (self)
- int right (self)
- setBottom (self, int)
- setLeft (self, int)
- setRight (self, int)
- setTop (self, int)
- int top (self)

### Special Methods

- bool __eq__ (self, QMargins)
- bool __ne__ (self, QMargins)

## Detailed Description

The QMargins class defines the four margins of a rectangle.

QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

The isNull() function returns true only if all margins are set to zero.

QMargin objects can be streamed as well as compared.

## Method Documentation

### QMargins.__init__ (self)

Constructs a margins object with all margins set to 0.

See also isNull().

### QMargins.__init__ (self, int, int, int, int)

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

See also setLeft(), setRight(), setTop(), and setBottom().

### QMargins.__init__ (self, QMargins)

### int QMargins.bottom (self)

Returns the bottom margin.

See also setBottom().

### bool QMargins.isNull (self)

Returns true if all margins are is 0; otherwise returns false.

### int QMargins.left (self)

Returns the left margin.

See also setLeft().

### int QMargins.right (self)

Returns the right margin.

See also setRight().

### QMargins.setBottom (self, int)

Sets the bottom margin to bottom.

See also bottom().

### QMargins.setLeft (self, int)

Sets the left margin to left.

See also left().

### QMargins.setRight (self, int)

Sets the right margin to right.

See also right().

### QMargins.setTop (self, int)

Sets the Top margin to Top.

See also top().

### int QMargins.top (self)

Returns the top margin.

See also setTop().

### bool QMargins.__eq__ (self, QMargins)

### bool QMargins.__ne__ (self, QMargins)