|
static double | calculatePrettySize (double minimumSize, double maximumSize) |
| Calculates a "pretty" size which falls between the range [minimumSize, maximumSize]. More...
|
|
static QgsRenderContext | createRenderContextForLayout (QgsLayout *layout, QPainter *painter, double dpi=-1) |
| Creates a render context suitable for the specified layout and painter destination. More...
|
|
static QgsRenderContext | createRenderContextForMap (QgsLayoutItemMap *map, QPainter *painter, double dpi=-1) |
| Creates a render context suitable for the specified layout map and painter destination. More...
|
|
static QgsLayoutItemPage::Orientation | decodePaperOrientation (const QString &string, bool &ok) |
| Decodes a string representing a paper orientation and returns the decoded orientation. More...
|
|
static void | drawText (QPainter *painter, const QRectF &rectangle, const QString &text, const QFont &font, const QColor &color=QColor(), Qt::AlignmentFlag halignment=Qt::AlignLeft, Qt::AlignmentFlag valignment=Qt::AlignTop, int flags=Qt::TextWordWrap) |
| Draws text on a painter within a rectangle, taking care of layout specific issues (calculation to pixel, scaling of font and painter to work around Qt font bugs). More...
|
|
static void | drawText (QPainter *painter, QPointF position, const QString &text, const QFont &font, const QColor &color=QColor()) |
| Draws text on a painter at a specific position, taking care of layout specific issues (calculation to pixel, scaling of font and painter to work around Qt font bugs). More...
|
|
static double | fontAscentMM (const QFont &font) |
| Calculates a font ascent in millimeters, including workarounds for QT font rendering issues. More...
|
|
static double | fontDescentMM (const QFont &font) |
| Calculate a font descent in millimeters, including workarounds for QT font rendering issues. More...
|
|
static double | fontHeightCharacterMM (const QFont &font, QChar character) |
| Calculate a font height in millimeters of a single character, including workarounds for QT font rendering issues. More...
|
|
static double | fontHeightMM (const QFont &font) |
| Calculate a font height in millimeters, including workarounds for QT font rendering issues. More...
|
|
static bool | itemIsAClippingSource (const QgsLayoutItem *item) |
| Returns true if an item is a clipping item for another layout item. More...
|
|
static QRectF | largestRotatedRectWithinBounds (const QRectF &originalRect, const QRectF &boundsRect, double rotation) |
| Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by the a specified rotation amount. More...
|
|
static QgsMapLayer * | mapLayerFromString (const QString &string, QgsProject *project) |
| Resolves a string into a map layer from a given project. More...
|
|
static double | normalizedAngle (double angle, bool allowNegative=false) |
| Ensures that an angle (in degrees) is in the range 0 <= angle < 360. More...
|
|
static QVector< double > | predefinedScales (const QgsLayout *layout) |
| Returns a list of predefined scales associated with a layout. More...
|
|
static double | relativePosition (double position, double beforeMin, double beforeMax, double afterMin, double afterMax) |
| Returns a scaled position given a before and after range. More...
|
|
static void | relativeResizeRect (QRectF &rectToResize, const QRectF &boundsBefore, const QRectF &boundsAfter) |
| Resizes a QRectF relative to a resized bounding rectangle. More...
|
|
static void | rotate (double angle, double &x, double &y) |
| Rotates a point / vector around the origin. More...
|
|
static QFont | scaledFontPixelSize (const QFont &font) |
| Returns a font where size is set in points and the size has been upscaled with FONT_WORKAROUND_SCALE to workaround QT font rendering bugs. More...
|
|
static Q_DECL_DEPRECATED double | scaleFactorFromItemStyle (const QStyleOptionGraphicsItem *style) |
| Extracts the scale factor from an item style. More...
|
|
static double | scaleFactorFromItemStyle (const QStyleOptionGraphicsItem *style, QPainter *painter) |
| Extracts the scale factor from an item style and painter. More...
|
|
static double | snappedAngle (double angle) |
| Snaps an angle (in degrees) to its closest 45 degree angle. More...
|
|
static double | textHeightMM (const QFont &font, const QString &text, double multiLineHeight=1.0) |
| Calculate a font height in millimeters for a text string, including workarounds for QT font rendering issues. More...
|
|
static double | textWidthMM (const QFont &font, const QString &text) |
| Calculate a font width in millimeters for a text string, including workarounds for QT font rendering issues. More...
|
|