|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/layout/qgslayoutitemlabel.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +class QgsLayoutItemLabel: QgsLayoutItem |
| 13 | +{ |
| 14 | +%Docstring |
| 15 | + A layout item subclass for text labels. |
| 16 | +.. versionadded:: 3.0 |
| 17 | +%End |
| 18 | + |
| 19 | +%TypeHeaderCode |
| 20 | +#include "qgslayoutitemlabel.h" |
| 21 | +%End |
| 22 | + public: |
| 23 | + |
| 24 | + enum Mode |
| 25 | + { |
| 26 | + ModeFont, |
| 27 | + ModeHtml, |
| 28 | + }; |
| 29 | + |
| 30 | + QgsLayoutItemLabel( QgsLayout *layout ); |
| 31 | +%Docstring |
| 32 | + Constructor for QgsLayoutItemLabel, with the specified parent ``layout``. |
| 33 | +%End |
| 34 | + |
| 35 | + static QgsLayoutItemLabel *create( QgsLayout *layout ) /Factory/; |
| 36 | +%Docstring |
| 37 | + Returns a new label item for the specified ``layout``. |
| 38 | + |
| 39 | + The caller takes responsibility for deleting the returned object. |
| 40 | + :rtype: QgsLayoutItemLabel |
| 41 | +%End |
| 42 | + |
| 43 | + |
| 44 | + virtual int type() const; |
| 45 | + |
| 46 | + virtual QString stringType() const; |
| 47 | + |
| 48 | + virtual QString displayName() const; |
| 49 | + |
| 50 | + void adjustSizeToText(); |
| 51 | +%Docstring |
| 52 | + Resizes the item so that the label's text fits to the item. Keeps the top left point stationary. |
| 53 | +%End |
| 54 | + |
| 55 | + QString text(); |
| 56 | +%Docstring |
| 57 | + Returns the label's preset text. |
| 58 | +.. seealso:: currentText() |
| 59 | +.. seealso:: setText() |
| 60 | + :rtype: str |
| 61 | +%End |
| 62 | + |
| 63 | + void setText( const QString &text ); |
| 64 | +%Docstring |
| 65 | + Sets the label's preset ``text``. |
| 66 | +.. seealso:: text() |
| 67 | +%End |
| 68 | + |
| 69 | + QString currentText() const; |
| 70 | +%Docstring |
| 71 | + Returns the text as it appears on the label (with evaluated expressions |
| 72 | + and other dynamic content). |
| 73 | +.. seealso:: text() |
| 74 | + :rtype: str |
| 75 | +%End |
| 76 | + |
| 77 | + Mode mode() const; |
| 78 | +%Docstring |
| 79 | + Returns the label's current mode. |
| 80 | +.. seealso:: setMode() |
| 81 | + :rtype: Mode |
| 82 | +%End |
| 83 | + |
| 84 | + void setMode( Mode mode ); |
| 85 | +%Docstring |
| 86 | + Sets the label's current ``mode``, allowing the label |
| 87 | + to switch between font based and HTML based rendering. |
| 88 | +.. seealso:: mode() |
| 89 | +%End |
| 90 | + |
| 91 | + QFont font() const; |
| 92 | +%Docstring |
| 93 | + Returns the label's current font. |
| 94 | +.. seealso:: setFont() |
| 95 | + :rtype: QFont |
| 96 | +%End |
| 97 | + |
| 98 | + void setFont( const QFont &font ); |
| 99 | +%Docstring |
| 100 | + Sets the label's current ``font``. |
| 101 | +.. seealso:: font() |
| 102 | +%End |
| 103 | + |
| 104 | + Qt::AlignmentFlag vAlign() const; |
| 105 | +%Docstring |
| 106 | + Returns for the vertical alignment of the label. |
| 107 | +.. seealso:: setVAlign() |
| 108 | +.. seealso:: hAlign() |
| 109 | + :rtype: Qt.AlignmentFlag |
| 110 | +%End |
| 111 | + |
| 112 | + Qt::AlignmentFlag hAlign() const; |
| 113 | +%Docstring |
| 114 | + Returns the horizontal alignment of the label. |
| 115 | +.. seealso:: vAlign() |
| 116 | +.. seealso:: setHAlign() |
| 117 | + :rtype: Qt.AlignmentFlag |
| 118 | +%End |
| 119 | + |
| 120 | + void setHAlign( Qt::AlignmentFlag alignment ); |
| 121 | +%Docstring |
| 122 | + Sets the horizontal ``alignment`` of the label. |
| 123 | +.. seealso:: hAlign() |
| 124 | +.. seealso:: setVAlign() |
| 125 | +%End |
| 126 | + |
| 127 | + void setVAlign( Qt::AlignmentFlag alignment ); |
| 128 | +%Docstring |
| 129 | + Sets for the vertical ``alignment`` of the label. |
| 130 | +.. seealso:: vAlign() |
| 131 | +.. seealso:: setHAlign() |
| 132 | +%End |
| 133 | + |
| 134 | + double marginX() const; |
| 135 | +%Docstring |
| 136 | + Returns the horizontal margin between the edge of the frame and the label |
| 137 | + contents, in layout units. |
| 138 | +.. seealso:: setMargin() |
| 139 | +.. seealso:: marginY() |
| 140 | + :rtype: float |
| 141 | +%End |
| 142 | + |
| 143 | + double marginY() const; |
| 144 | +%Docstring |
| 145 | + Returns the vertical margin between the edge of the frame and the label |
| 146 | + contents, in layout units. |
| 147 | +.. seealso:: setMargin() |
| 148 | +.. seealso:: marginX() |
| 149 | + :rtype: float |
| 150 | +%End |
| 151 | + |
| 152 | + void setMargin( double margin ); |
| 153 | +%Docstring |
| 154 | + Sets the ``margin`` between the edge of the frame and the label contents. |
| 155 | + This method sets both the horizontal and vertical margins to the same |
| 156 | + value. The margins can be individually controlled using the setMarginX() |
| 157 | + and setMarginY() methods. |
| 158 | + |
| 159 | + Margins are set using the current layout units. |
| 160 | + |
| 161 | +.. seealso:: setMarginX() |
| 162 | +.. seealso:: setMarginY() |
| 163 | +%End |
| 164 | + |
| 165 | + void setMarginX( double margin ); |
| 166 | +%Docstring |
| 167 | + Sets the horizontal ``margin`` between the edge of the frame and the label |
| 168 | + contents, in layout units. |
| 169 | +.. seealso:: setMargin() |
| 170 | +.. seealso:: setMarginY() |
| 171 | +%End |
| 172 | + |
| 173 | + void setMarginY( double margin ); |
| 174 | +%Docstring |
| 175 | + Sets the vertical ``margin`` between the edge of the frame and the label |
| 176 | + contents, in layout units. |
| 177 | +.. seealso:: setMargin() |
| 178 | +.. seealso:: setMarginX() |
| 179 | +%End |
| 180 | + |
| 181 | + void setFontColor( const QColor &color ); |
| 182 | +%Docstring |
| 183 | + Sets the label font ``color``. |
| 184 | +.. seealso:: fontColor() |
| 185 | +%End |
| 186 | + |
| 187 | + QColor fontColor() const; |
| 188 | +%Docstring |
| 189 | + Returns the label font color. |
| 190 | +.. seealso:: setFontColor() |
| 191 | + :rtype: QColor |
| 192 | +%End |
| 193 | + |
| 194 | + virtual QRectF boundingRect() const; |
| 195 | + |
| 196 | + |
| 197 | + virtual void setFrameEnabled( const bool drawFrame ); |
| 198 | + |
| 199 | + |
| 200 | + virtual void setFrameStrokeWidth( const QgsLayoutMeasurement &strokeWidth ); |
| 201 | + |
| 202 | + |
| 203 | + public slots: |
| 204 | + |
| 205 | + virtual void refresh(); |
| 206 | + |
| 207 | + |
| 208 | + protected: |
| 209 | + virtual void draw( QgsRenderContext &context, const QStyleOptionGraphicsItem *itemStyle = 0 ); |
| 210 | + |
| 211 | + virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const; |
| 212 | + |
| 213 | + virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context ); |
| 214 | + |
| 215 | + |
| 216 | +}; |
| 217 | + |
| 218 | +/************************************************************************ |
| 219 | + * This file has been generated automatically from * |
| 220 | + * * |
| 221 | + * src/core/layout/qgslayoutitemlabel.h * |
| 222 | + * * |
| 223 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 224 | + ************************************************************************/ |
0 commit comments