|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/symbology/qgsstylemodel.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +class QgsStyleModel: QAbstractItemModel |
| 13 | +{ |
| 14 | +%Docstring |
| 15 | + |
| 16 | +A QAbstractItemModel subclass for showing symbol and color ramp entities contained |
| 17 | +within a QgsStyle database. |
| 18 | + |
| 19 | +.. seealso:: :py:class:`QgsStyleProxyModel` |
| 20 | + |
| 21 | +.. versionadded:: 3.4 |
| 22 | +%End |
| 23 | + |
| 24 | +%TypeHeaderCode |
| 25 | +#include "qgsstylemodel.h" |
| 26 | +%End |
| 27 | + public: |
| 28 | + |
| 29 | + enum Column |
| 30 | + { |
| 31 | + Name, |
| 32 | + Tags, |
| 33 | + }; |
| 34 | + |
| 35 | + enum Role |
| 36 | + { |
| 37 | + TypeRole, |
| 38 | + TagRole, |
| 39 | + SymbolTypeRole, |
| 40 | + }; |
| 41 | + |
| 42 | + explicit QgsStyleModel( QgsStyle *style, QObject *parent /TransferThis/ = 0 ); |
| 43 | +%Docstring |
| 44 | +Constructor for QgsStyleModel, for the specified ``style`` and ``parent`` object. |
| 45 | + |
| 46 | +The ``style`` object must exist for the lifetime of this model. |
| 47 | +%End |
| 48 | + |
| 49 | + virtual QVariant data( const QModelIndex &index, int role ) const; |
| 50 | + |
| 51 | + virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole ); |
| 52 | + |
| 53 | + virtual Qt::ItemFlags flags( const QModelIndex &index ) const; |
| 54 | + |
| 55 | + virtual QVariant headerData( int section, Qt::Orientation orientation, |
| 56 | + int role = Qt::DisplayRole ) const; |
| 57 | + virtual QModelIndex index( int row, int column, |
| 58 | + const QModelIndex &parent = QModelIndex() ) const; |
| 59 | + virtual QModelIndex parent( const QModelIndex &index ) const; |
| 60 | + |
| 61 | + virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const; |
| 62 | + |
| 63 | + virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const; |
| 64 | + |
| 65 | + |
| 66 | +}; |
| 67 | + |
| 68 | +class QgsStyleProxyModel: QSortFilterProxyModel |
| 69 | +{ |
| 70 | +%Docstring |
| 71 | + |
| 72 | +A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle database. |
| 73 | + |
| 74 | +.. seealso:: :py:class:`QgsStyleModel` |
| 75 | + |
| 76 | +.. versionadded:: 3.4 |
| 77 | +%End |
| 78 | + |
| 79 | +%TypeHeaderCode |
| 80 | +#include "qgsstylemodel.h" |
| 81 | +%End |
| 82 | + public: |
| 83 | + |
| 84 | + explicit QgsStyleProxyModel( QgsStyle *style, QObject *parent /TransferThis/ = 0 ); |
| 85 | +%Docstring |
| 86 | +Constructor for QgsStyleProxyModel, for the specified ``style`` and ``parent`` object. |
| 87 | + |
| 88 | +The ``style`` object must exist for the lifetime of this model. |
| 89 | +%End |
| 90 | + |
| 91 | + QString filterString() const; |
| 92 | +%Docstring |
| 93 | +Returns the current filter string, if set. |
| 94 | + |
| 95 | +.. seealso:: :py:func:`setFilterString` |
| 96 | +%End |
| 97 | + |
| 98 | + QgsStyle::StyleEntity entityFilter() const; |
| 99 | +%Docstring |
| 100 | +Returns the style entity type filter. |
| 101 | + |
| 102 | +.. note:: |
| 103 | + |
| 104 | + This filter is only active if entityFilterEnabled() is true. |
| 105 | + |
| 106 | +.. seealso:: :py:func:`setEntityFilter` |
| 107 | +%End |
| 108 | + |
| 109 | + void setEntityFilter( QgsStyle::StyleEntity filter ); |
| 110 | +%Docstring |
| 111 | +Sets the style entity type ``filter``. |
| 112 | + |
| 113 | +.. note:: |
| 114 | + |
| 115 | + This filter is only active if entityFilterEnabled() is true. |
| 116 | + |
| 117 | +.. seealso:: :py:func:`entityFilter` |
| 118 | +%End |
| 119 | + |
| 120 | + bool entityFilterEnabled() const; |
| 121 | +%Docstring |
| 122 | +Returns true if filtering by entity type is enabled. |
| 123 | + |
| 124 | +.. seealso:: :py:func:`setEntityFilterEnabled` |
| 125 | + |
| 126 | +.. seealso:: :py:func:`entityFilter` |
| 127 | +%End |
| 128 | + |
| 129 | + void setEntityFilterEnabled( bool enabled ); |
| 130 | +%Docstring |
| 131 | +Sets whether filtering by entity type is ``enabled``. |
| 132 | + |
| 133 | +If ``enabled`` is false, then the value of entityFilter() will have no |
| 134 | +effect on the model filtering. |
| 135 | + |
| 136 | +.. seealso:: :py:func:`entityFilterEnabled` |
| 137 | + |
| 138 | +.. seealso:: :py:func:`setEntityFilter` |
| 139 | +%End |
| 140 | + |
| 141 | + QgsSymbol::SymbolType symbolType() const; |
| 142 | +%Docstring |
| 143 | +Returns the symbol type filter. |
| 144 | + |
| 145 | +.. note:: |
| 146 | + |
| 147 | + This filter is only active if symbolTypeFilterEnabled() is true, and has |
| 148 | + no effect on non-symbol entities (i.e. color ramps). |
| 149 | + |
| 150 | +.. seealso:: :py:func:`setSymbolType` |
| 151 | +%End |
| 152 | + |
| 153 | + void setSymbolType( QgsSymbol::SymbolType type ); |
| 154 | +%Docstring |
| 155 | +Sets the symbol ``type`` filter. |
| 156 | + |
| 157 | +.. note:: |
| 158 | + |
| 159 | + This filter is only active if symbolTypeFilterEnabled() is true. |
| 160 | + |
| 161 | +.. seealso:: :py:func:`symbolType` |
| 162 | +%End |
| 163 | + |
| 164 | + bool symbolTypeFilterEnabled() const; |
| 165 | +%Docstring |
| 166 | +Returns true if filtering by symbol type is enabled. |
| 167 | + |
| 168 | +.. seealso:: :py:func:`setSymbolTypeFilterEnabled` |
| 169 | + |
| 170 | +.. seealso:: :py:func:`symbolType` |
| 171 | +%End |
| 172 | + |
| 173 | + void setSymbolTypeFilterEnabled( bool enabled ); |
| 174 | +%Docstring |
| 175 | +Sets whether filtering by symbol type is ``enabled``. |
| 176 | + |
| 177 | +If ``enabled`` is false, then the value of symbolType() will have no |
| 178 | +effect on the model filtering. This has |
| 179 | +no effect on non-symbol entities (i.e. color ramps). |
| 180 | + |
| 181 | +.. seealso:: :py:func:`symbolTypeFilterEnabled` |
| 182 | + |
| 183 | +.. seealso:: :py:func:`setSymbolType` |
| 184 | +%End |
| 185 | + |
| 186 | + void setTagId( int id ); |
| 187 | +%Docstring |
| 188 | +Sets a tag ``id`` to filter style entities by. Only entities with the given |
| 189 | +tag will be shown in the model. |
| 190 | + |
| 191 | +Set ``id`` to -1 to disable tag filtering. |
| 192 | + |
| 193 | +.. seealso:: :py:func:`tagId` |
| 194 | +%End |
| 195 | + |
| 196 | + int tagId() const; |
| 197 | +%Docstring |
| 198 | +Returns the tag id used to filter style entities by. |
| 199 | + |
| 200 | +If returned value is -1, then no tag filtering is being conducted. |
| 201 | + |
| 202 | +.. seealso:: :py:func:`setTagId` |
| 203 | +%End |
| 204 | + |
| 205 | + void setSmartGroupId( int id ); |
| 206 | +%Docstring |
| 207 | +Sets a smart group ``id`` to filter style entities by. Only entities within the given |
| 208 | +smart group will be shown in the model. |
| 209 | + |
| 210 | +Set ``id`` to -1 to disable smart group filtering. |
| 211 | + |
| 212 | +.. seealso:: :py:func:`smartGroupId` |
| 213 | +%End |
| 214 | + |
| 215 | + int smartGroupId() const; |
| 216 | +%Docstring |
| 217 | +Returns the smart group id used to filter style entities by. |
| 218 | + |
| 219 | +If returned value is -1, then no smart group filtering is being conducted. |
| 220 | + |
| 221 | +.. seealso:: :py:func:`setSmartGroupId` |
| 222 | +%End |
| 223 | + |
| 224 | + virtual bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const; |
| 225 | + |
| 226 | + |
| 227 | + bool favoritesOnly() const; |
| 228 | +%Docstring |
| 229 | +Returns true if the model is showing only favorited entities. |
| 230 | + |
| 231 | +.. seealso:: :py:func:`setFavoritesOnly` |
| 232 | +%End |
| 233 | + |
| 234 | + void setFavoritesOnly( bool favoritesOnly ); |
| 235 | +%Docstring |
| 236 | +Sets whether the model should show only favorited entities. |
| 237 | + |
| 238 | +.. seealso:: :py:func:`setFavoritesOnly` |
| 239 | +%End |
| 240 | + |
| 241 | + public slots: |
| 242 | + |
| 243 | + void setFilterString( const QString &filter ); |
| 244 | +%Docstring |
| 245 | +Sets a ``filter`` string, such that only symbol entities with names matching the |
| 246 | +specified string will be shown. |
| 247 | + |
| 248 | +.. seealso:: :py:func:`filterString` |
| 249 | +%End |
| 250 | + |
| 251 | +}; |
| 252 | + |
| 253 | +/************************************************************************ |
| 254 | + * This file has been generated automatically from * |
| 255 | + * * |
| 256 | + * src/core/symbology/qgsstylemodel.h * |
| 257 | + * * |
| 258 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 259 | + ************************************************************************/ |
0 commit comments