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.
More...
|
| QgsLayoutModel (QgsLayout *layout, QObject *parent=nullptr) |
| Constructor for a QgsLayoutModel attached to the specified layout. More...
|
|
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
|
QVariant | data (const QModelIndex &index, int role) const override |
|
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
|
Qt::ItemFlags | flags (const QModelIndex &index) const override |
|
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
|
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
|
QModelIndex | indexForItem (QgsLayoutItem *item, int column=0) |
| Returns the QModelIndex corresponding to a QgsLayoutItem item and column, if possible. More...
|
|
QgsLayoutItem * | itemFromIndex (const QModelIndex &index) const |
| Returns the QgsLayoutItem corresponding to a QModelIndex index, if possible. More...
|
|
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
|
QStringList | mimeTypes () const override |
|
QModelIndex | parent (const QModelIndex &index) const override |
|
bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override |
|
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
|
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
|
Qt::DropActions | supportedDropActions () const override |
|
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, 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.
- Since
- QGIS 3.0
Definition at line 52 of file qgslayoutmodel.h.