16 #ifndef QGSLAYOUTMANAGER_H 17 #define QGSLAYOUTMANAGER_H 19 #include "qgis_core.h" 23 #include <QAbstractListModel> 24 #include <QSortFilterProxyModel> 86 QList< QgsMasterLayoutInterface * > layouts()
const;
91 QList< QgsPrintLayout * > printLayouts()
const;
104 bool readXml(
const QDomElement &element,
const QDomDocument &doc );
110 QDomElement writeXml( QDomDocument &doc )
const;
128 void layoutAboutToBeAdded(
const QString &name );
131 void layoutAdded(
const QString &name );
134 void layoutRemoved(
const QString &name );
137 void layoutAboutToBeRemoved(
const QString &name );
146 QList< QgsMasterLayoutInterface * > mLayouts;
169 LayoutRole = Qt::UserRole + 1,
177 int rowCount(
const QModelIndex &parent )
const override;
178 QVariant data(
const QModelIndex &index,
int role )
const override;
179 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
180 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
198 void setAllowEmptyLayout(
bool allowEmpty );
207 void layoutAboutToBeAdded(
const QString &name );
208 void layoutAboutToBeRemoved(
const QString &name );
209 void layoutAdded(
const QString &name );
210 void layoutRemoved(
const QString &name );
214 bool mAllowEmpty =
false;
235 FilterPrintLayouts = 1 << 1,
236 FilterReports = 1 << 2,
238 Q_DECLARE_FLAGS( Filters,
Filter )
245 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
246 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
253 QgsLayoutManagerProxyModel::Filters filters()
const;
260 void setFilters( QgsLayoutManagerProxyModel::Filters filters );
264 Filters mFilters = Filters( FilterPrintLayouts | FilterReports );
267 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLayoutManagerProxyModel::Filters )
269 #endif // QGSLAYOUTMANAGER_H
bool allowEmptyLayout() const
Returns true if the model allows the empty layout ("not set") choice.
Filter
Available filter flags for filtering the model.
QSortFilterProxyModel subclass for QgsLayoutManagerModel.
List model representing the print layouts and reports available in a layout manager.
Reads and writes project states.
Manages storage of a set of layouts.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Interface for master layout type objects, such as print layouts and reports.
Individual print layout (QgsPrintLayout)