18#ifndef QGSLAYOUTMODEL_H
19#define QGSLAYOUTMODEL_H
25#include <QAbstractItemModel>
27#include <QSortFilterProxyModel>
71 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
72 QModelIndex parent(
const QModelIndex &index )
const override;
73 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
74 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
75 QVariant data(
const QModelIndex &index,
int role )
const override;
76 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
77 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
78 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
79 Qt::DropActions supportedDropActions()
const override;
80 QStringList mimeTypes()
const override;
81 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
82 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
83 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
96 int zOrderListSize()
const;
186 QList<QgsLayoutItem *> &zOrderList();
202 void setItemRestored( QgsComposerItem *item );
244 QgsLayoutItem *itemFromIndex(
const QModelIndex &index )
const;
250 QModelIndex indexForItem(
QgsLayoutItem *item,
int column = 0 );
260 void setSelected(
const QModelIndex &index );
266 QList<QgsLayoutItem *> mItemZList;
269 QList<QgsLayoutItem *> mItemsInScene;
283 void refreshItemsInScene();
290 void rebuildSceneItemList();
331 void setExceptedItemList(
const QList< QgsLayoutItem * > &items );
348 QgsLayoutItem *itemFromSourceIndex(
const QModelIndex &sourceIndex )
const;
361 void setAllowEmptyItem(
bool allowEmpty );
368 bool allowEmptyItem()
const;
391 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
392 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
397 QList< QgsLayoutItem * > mExceptedList;
398 bool mAllowEmpty =
false;
@ LayoutItem
Base class for items.
Base class for graphical items within a QgsLayout.
A model for items attached to a layout.
friend class TestQgsLayoutGui
friend class TestQgsLayoutModel
QgsLayoutModel(QgsLayout *layout, QObject *parent=nullptr)
Constructor for a QgsLayoutModel attached to the specified layout.
Columns
Columns returned by the model.
@ Visibility
Item visibility checkbox.
@ LockStatus
Item lock status checkbox.
QgsLayoutModel * sourceLayerModel() const
Returns the QgsLayoutModel used in this proxy model.
QgsLayoutProxyModel(QgsLayout *layout, QObject *parent=nullptr)
Constructor for QgsLayoutProxyModelm, attached to the specified layout.
QgsLayout * layout()
Returns the associated layout.
QgsLayoutItemRegistry::ItemType filterType() const
Returns the current item type filter, or QgsLayoutItemRegistry::LayoutItem if no item type filter is ...
QList< QgsLayoutItem * > exceptedItemList() const
Returns the list of specific items excluded from the model.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.