|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/gui/qgssymbolbutton.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +class QgsSymbolButton : QToolButton |
| 12 | +{ |
| 13 | +%Docstring |
| 14 | + A button for creating and modifying QgsSymbol settings. |
| 15 | + |
| 16 | + The button shows a preview icon for the current symbol, and will open a detailed symbol editor dialog (or |
| 17 | + panel widget) when clicked. |
| 18 | + |
| 19 | +.. versionadded:: 3.0 |
| 20 | +%End |
| 21 | + |
| 22 | +%TypeHeaderCode |
| 23 | +#include "qgssymbolbutton.h" |
| 24 | +%End |
| 25 | + public: |
| 26 | + |
| 27 | + QgsSymbolButton( QWidget *parent /TransferThis/ = 0, const QString &dialogTitle = QString() ); |
| 28 | +%Docstring |
| 29 | + Construct a new symbol button. |
| 30 | + Use ``dialogTitle`` string to define the title to show in the symbol settings dialog. |
| 31 | +%End |
| 32 | + |
| 33 | + virtual QSize minimumSizeHint() const; |
| 34 | + |
| 35 | + void setSymbolType( QgsSymbol::SymbolType type ); |
| 36 | +%Docstring |
| 37 | + Sets the symbol ``type`` which the button requires. |
| 38 | + If the type differs from the current symbol type, the symbol will be reset |
| 39 | + to a default symbol style of the new type. |
| 40 | +.. seealso:: symbolType() |
| 41 | +%End |
| 42 | + |
| 43 | + QgsSymbol::SymbolType symbolType() const; |
| 44 | +%Docstring |
| 45 | + Returns the symbol type which the button requires. |
| 46 | +.. seealso:: setSymbolType() |
| 47 | + :rtype: QgsSymbol.SymbolType |
| 48 | +%End |
| 49 | + |
| 50 | + void setDialogTitle( const QString &title ); |
| 51 | +%Docstring |
| 52 | + Sets the ``title`` for the symbol settings dialog window. |
| 53 | +.. seealso:: dialogTitle() |
| 54 | +%End |
| 55 | + |
| 56 | + QString dialogTitle() const; |
| 57 | +%Docstring |
| 58 | + Returns the title for the symbol settings dialog window. |
| 59 | +.. seealso:: setDialogTitle() |
| 60 | + :rtype: str |
| 61 | +%End |
| 62 | + |
| 63 | + QgsSymbol *symbol(); |
| 64 | +%Docstring |
| 65 | + Returns the current symbol defined by the button. |
| 66 | +.. seealso:: setSymbol() |
| 67 | +.. seealso:: changed() |
| 68 | + :rtype: QgsSymbol |
| 69 | +%End |
| 70 | + |
| 71 | + |
| 72 | + QgsMapCanvas *mapCanvas() const; |
| 73 | +%Docstring |
| 74 | + Returns the map canvas associated with the widget. |
| 75 | +.. seealso:: setMapCanvas() |
| 76 | + :rtype: QgsMapCanvas |
| 77 | +%End |
| 78 | + |
| 79 | + void setMapCanvas( QgsMapCanvas *canvas ); |
| 80 | +%Docstring |
| 81 | + Sets a map ``canvas`` to associate with the widget. This allows the |
| 82 | + widget to fetch current settings from the map canvas, such as current scale. |
| 83 | +.. seealso:: mapCanvas() |
| 84 | +%End |
| 85 | + |
| 86 | + QgsVectorLayer *layer() const; |
| 87 | +%Docstring |
| 88 | + Returns the layer associated with the widget. |
| 89 | +.. seealso:: setLayer() |
| 90 | + :rtype: QgsVectorLayer |
| 91 | +%End |
| 92 | + |
| 93 | + void setLayer( QgsVectorLayer *layer ); |
| 94 | +%Docstring |
| 95 | + Sets a ``layer`` to associate with the widget. This allows the |
| 96 | + widget to setup layer related settings within the symbol settings dialog, |
| 97 | + such as correctly populating data defined override buttons. |
| 98 | +.. seealso:: layer() |
| 99 | +%End |
| 100 | + |
| 101 | + void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator ); |
| 102 | +%Docstring |
| 103 | + Register an expression context generator class that will be used to retrieve |
| 104 | + an expression context for the button when required. |
| 105 | +%End |
| 106 | + |
| 107 | + public slots: |
| 108 | + |
| 109 | + void setSymbol( QgsSymbol *symbol /Transfer/ ); |
| 110 | +%Docstring |
| 111 | + Sets the ``symbol`` for the button. Ownership of ``symbol`` is transferred to the |
| 112 | + button. |
| 113 | +.. seealso:: symbol() |
| 114 | +.. seealso:: changed() |
| 115 | +%End |
| 116 | + |
| 117 | + void setColor( const QColor &color ); |
| 118 | +%Docstring |
| 119 | + Sets the current ``color`` for the symbol. Will emit a changed() signal if the color is different |
| 120 | + to the previous symbol color. |
| 121 | +%End |
| 122 | + |
| 123 | + void copySymbol(); |
| 124 | +%Docstring |
| 125 | + Copies the current symbol to the clipboard. |
| 126 | +.. seealso:: pasteSymbol() |
| 127 | +%End |
| 128 | + |
| 129 | + void pasteSymbol(); |
| 130 | +%Docstring |
| 131 | + Pastes a symbol from the clipboard. If clipboard does not contain a valid |
| 132 | + symbol then no change is applied. |
| 133 | +.. seealso:: copySymbol() |
| 134 | +%End |
| 135 | + |
| 136 | + void copyColor(); |
| 137 | +%Docstring |
| 138 | + Copies the current symbol color to the clipboard. |
| 139 | +.. seealso:: pasteColor() |
| 140 | +%End |
| 141 | + |
| 142 | + void pasteColor(); |
| 143 | +%Docstring |
| 144 | + Pastes a color from the clipboard to the symbol. If clipboard does not contain a valid |
| 145 | + color or string representation of a color, then no change is applied. |
| 146 | +.. seealso:: copyColor() |
| 147 | +%End |
| 148 | + |
| 149 | + signals: |
| 150 | + |
| 151 | + void changed(); |
| 152 | +%Docstring |
| 153 | + Emitted when the symbol's settings are changed. |
| 154 | +.. seealso:: symbol() |
| 155 | +.. seealso:: setSymbol() |
| 156 | +%End |
| 157 | + |
| 158 | + protected: |
| 159 | + |
| 160 | + virtual void changeEvent( QEvent *e ); |
| 161 | + |
| 162 | + virtual void showEvent( QShowEvent *e ); |
| 163 | + |
| 164 | + virtual void resizeEvent( QResizeEvent *event ); |
| 165 | + |
| 166 | + |
| 167 | + virtual void mousePressEvent( QMouseEvent *e ); |
| 168 | + |
| 169 | + virtual void mouseMoveEvent( QMouseEvent *e ); |
| 170 | + |
| 171 | + virtual void dragEnterEvent( QDragEnterEvent *e ); |
| 172 | + |
| 173 | + |
| 174 | + virtual void dragLeaveEvent( QDragLeaveEvent *e ); |
| 175 | + |
| 176 | + |
| 177 | + virtual void dropEvent( QDropEvent *e ); |
| 178 | + |
| 179 | + |
| 180 | +}; |
| 181 | + |
| 182 | +/************************************************************************ |
| 183 | + * This file has been generated automatically from * |
| 184 | + * * |
| 185 | + * src/gui/qgssymbolbutton.h * |
| 186 | + * * |
| 187 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 188 | + ************************************************************************/ |
0 commit comments