QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
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. | |
QgsMargins (double left, double top, double right, double bottom) | |
Constructs margins with the given left, top, right, bottom. | |
double | bottom () const |
Returns the bottom margin. | |
bool | isNull () const |
Returns all margins are is 0; otherwise returns false . | |
double | left () const |
Returns the left margin. | |
QgsMargins & | operator*= (double factor) |
Multiplies each component of this object by factor and returns a reference to it. | |
QgsMargins & | operator+= (const QgsMargins &margins) |
Add each component of margins to the respective component of this object and returns a reference to it. | |
QgsMargins & | operator+= (double addend) |
Adds the addend to each component of this object and returns a reference to it. | |
QgsMargins & | operator-= (const QgsMargins &margins) |
Subtract each component of margins from the respective component of this object and returns a reference to it. | |
QgsMargins & | operator-= (double subtrahend) |
Subtracts the subtrahend from each component of this object and returns a reference to it. | |
QgsMargins & | operator/= (double divisor) |
Multiplies each component of this object by factor and returns a reference to it. | |
double | right () const |
Returns the right margin. | |
void | setBottom (double bottom) |
Sets the bottom margin to bottom. | |
void | setLeft (double left) |
Sets the left margin to left. | |
void | setRight (double right) |
Sets the right margin to right. | |
void | setTop (double top) |
Sets the top margin to top. | |
double | top () const |
Returns the top margin. | |
QString | toString () const |
Returns the margins encoded to a string. | |
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. | |
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 36 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 52 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 62 of file qgsmargins.h.
|
inline |
|
inline |
Multiplies each component of this object by factor and returns a reference to it.
Definition at line 303 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 275 of file qgsmargins.h.
|
inline |
Adds the addend to each component of this object and returns a reference to it.
Definition at line 285 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 280 of file qgsmargins.h.
|
inline |
Subtracts the subtrahend from each component of this object and returns a reference to it.
Definition at line 294 of file qgsmargins.h.
|
inline |
Multiplies each component of this object by factor and returns a reference to it.
Definition at line 308 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.