QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
The QgsMargins class defines the four margins of a rectangle. More...
#include <qgsmargins.h>
Public Member Functions | |
QgsMargins ()=default | |
Constructs a margins object with all margins set to 0. More... | |
QgsMargins (double left, double top, double right, double bottom) | |
Constructs margins with the given left, top, right, bottom. More... | |
double | bottom () const |
Returns the bottom margin. More... | |
bool | isNull () const |
Returns all margins are is 0; otherwise returns false . More... | |
double | left () const |
Returns the left margin. More... | |
QgsMargins & | operator*= (double factor) |
Multiplies each component of this object by factor and returns a reference to it. More... | |
QgsMargins & | operator+= (const QgsMargins &margins) |
Add each component of margins to the respective component of this object and returns a reference to it. More... | |
QgsMargins & | operator+= (double addend) |
Adds the addend to each component of this object and returns a reference to it. More... | |
QgsMargins & | operator-= (const QgsMargins &margins) |
Subtract each component of margins from the respective component of this object and returns a reference to it. More... | |
QgsMargins & | operator-= (double subtrahend) |
Subtracts the subtrahend from each component of this object and returns a reference to it. More... | |
QgsMargins & | operator/= (double divisor) |
Multiplies each component of this object by factor and returns a reference to it. More... | |
double | right () const |
Returns the right margin. More... | |
void | setBottom (double bottom) |
Sets the bottom margin to bottom. More... | |
void | setLeft (double left) |
Sets the left margin to left. More... | |
void | setRight (double right) |
Sets the right margin to right. More... | |
void | setTop (double top) |
Sets the top margin to top. More... | |
double | top () const |
Returns the top margin. More... | |
QString | toString () const |
Returns the margins encoded to a string. More... | |
Static Public Member Functions | |
static QgsMargins | fromString (const QString &string) |
Returns a QgsMargins object decoded from a string, or a null QgsMargins if the string could not be interpreted as margins. More... | |
The QgsMargins class defines the four margins of a rectangle.
QgsMargins 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.
Definition at line 37 of file qgsmargins.h.
|
default |
Constructs a margins object with all margins set to 0.
|
inline |
Constructs margins with the given left, top, right, bottom.
Definition at line 53 of file qgsmargins.h.
|
inline |
|
static |
Returns a QgsMargins object decoded from a string, or a null QgsMargins if the string could not be interpreted as margins.
Definition at line 27 of file qgsmargins.cpp.
|
inline |
Returns
all margins are is 0; otherwise returns true
iffalse
.
Definition at line 63 of file qgsmargins.h.
|
inline |
|
inline |
Multiplies each component of this object by factor and returns a reference to it.
Definition at line 296 of file qgsmargins.h.
|
inline |
Add each component of margins to the respective component of this object and returns a reference to it.
Definition at line 268 of file qgsmargins.h.
|
inline |
Adds the addend to each component of this object and returns a reference to it.
Definition at line 278 of file qgsmargins.h.
|
inline |
Subtract each component of margins from the respective component of this object and returns a reference to it.
Definition at line 273 of file qgsmargins.h.
|
inline |
Subtracts the subtrahend from each component of this object and returns a reference to it.
Definition at line 287 of file qgsmargins.h.
|
inline |
Multiplies each component of this object by factor and returns a reference to it.
Definition at line 301 of file qgsmargins.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
QString QgsMargins::toString | ( | ) | const |
Returns the margins encoded to a string.
Definition at line 18 of file qgsmargins.cpp.