1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsLayoutModel: QAbstractItemModel
{
%Docstring(signature="appended")
A model for items attached to a layout. The model also maintains the
z-order for the layout, and must be notified whenever item stacking
changes.
Internally, :py:class:`QgsLayoutModel` maintains two lists. One contains
a complete list of all items for the layout, ordered by their position
within the z-order stack.
The second list contains only items which are currently displayed in the
layout's scene. It is used as a cache of the last known stacking order,
so that the model can compare the current stacking of items in the
layout to the last known state, and emit the corresponding signals as
required.
%End
%TypeHeaderCode
#include "qgslayoutmodel.h"
%End
public:
enum Columns /BaseType=IntEnum/
{
Visibility,
LockStatus,
ItemId,
};
explicit QgsLayoutModel( QgsLayout *layout, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for a QgsLayoutModel attached to the specified ``layout``.
%End
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex &index ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual bool setData( const QModelIndex &index, const QVariant &value, int role );
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
virtual Qt::DropActions supportedDropActions() const;
virtual QStringList mimeTypes() const;
virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
QgsLayoutItem *itemFromIndex( const QModelIndex &index ) const;
%Docstring
Returns the :py:class:`QgsLayoutItem` corresponding to a QModelIndex
``index``, if possible.
.. seealso:: :py:func:`indexForItem`
%End
QModelIndex indexForItem( QgsLayoutItem *item, int column = 0 );
%Docstring
Returns the QModelIndex corresponding to a :py:class:`QgsLayoutItem`
``item`` and ``column``, if possible.
.. seealso:: :py:func:`itemFromIndex`
%End
public slots:
};
class QgsLayoutProxyModel: QSortFilterProxyModel
{
%Docstring(signature="appended")
Allows for filtering a :py:class:`QgsLayoutModel` by item type.
%End
%TypeHeaderCode
#include "qgslayoutmodel.h"
%End
public:
QgsLayoutProxyModel( QgsLayout *layout, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for :py:class:`QgsLayoutProxyModelm`, attached to the
specified ``layout``.
%End
QgsLayoutItemRegistry::ItemType filterType() const;
%Docstring
Returns the current item type filter, or
:py:class:`QgsLayoutItemRegistry`.LayoutItem if no item type filter is
set.
.. seealso:: :py:func:`setFilterType`
%End
void setFilterType( QgsLayoutItemRegistry::ItemType filter );
%Docstring
Sets the item type ``filter``. Only matching item types will be shown.
Set ``filter`` to :py:class:`QgsLayoutItemRegistry`.LayoutItem to show
all item types.
.. seealso:: :py:func:`filterType`
%End
void setExceptedItemList( const QList< QgsLayoutItem * > &items );
%Docstring
Sets a list of specific ``items`` to exclude from the model.
.. seealso:: :py:func:`exceptedItemList`
%End
QList< QgsLayoutItem * > exceptedItemList() const;
%Docstring
Returns the list of specific items excluded from the model.
.. seealso:: :py:func:`setExceptedItemList`
%End
QgsLayoutModel *sourceLayerModel() const;
%Docstring
Returns the :py:class:`QgsLayoutModel` used in this proxy model.
%End
QgsLayoutItem *itemFromSourceIndex( const QModelIndex &sourceIndex ) const;
%Docstring
Returns the :py:class:`QgsLayoutItem` corresponding to an index from the
source :py:class:`QgsLayoutModel` model.
%End
QgsLayout *layout();
%Docstring
Returns the associated layout.
.. versionadded:: 3.8
%End
void setAllowEmptyItem( bool allowEmpty );
%Docstring
Sets whether an optional empty layout item is present in the model.
.. seealso:: :py:func:`allowEmptyItem`
.. versionadded:: 3.8
%End
bool allowEmptyItem() const;
%Docstring
Returns ``True`` if the model includes the empty item choice.
.. seealso:: :py:func:`setAllowEmptyItem`
.. versionadded:: 3.8
%End
void setItemFlags( QgsLayoutItem::Flags flags );
%Docstring
Sets layout item flags to use for filtering the available items.
Set ``flags`` to ``None`` to clear the flag based filtering.
.. seealso:: :py:func:`itemFlags`
.. versionadded:: 3.16
%End
QgsLayoutItem::Flags itemFlags() const;
%Docstring
Returns the layout item flags used for filtering the available items.
Returns ``None`` if no flag based filtering is occurring.
.. seealso:: :py:func:`setItemFlags`
.. versionadded:: 3.16
%End
protected:
virtual bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|