16 #ifndef QGSLAYOUTMANAGER_H 17 #define QGSLAYOUTMANAGER_H 19 #include "qgis_core.h" 23 #include <QAbstractListModel> 24 #include <QSortFilterProxyModel> 87 QList< QgsMasterLayoutInterface * > layouts()
const;
92 QList< QgsPrintLayout * > printLayouts()
const;
105 bool readXml(
const QDomElement &element,
const QDomDocument &doc );
111 QDomElement writeXml( QDomDocument &doc )
const;
140 void layoutAboutToBeAdded(
const QString &name );
143 void layoutAdded(
const QString &name );
146 void layoutRemoved(
const QString &name );
149 void layoutAboutToBeRemoved(
const QString &name );
158 QList< QgsMasterLayoutInterface * > mLayouts;
181 LayoutRole = Qt::UserRole + 1,
189 int rowCount(
const QModelIndex &parent )
const override;
190 QVariant data(
const QModelIndex &index,
int role )
const override;
191 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
192 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
210 void setAllowEmptyLayout(
bool allowEmpty );
219 void layoutAboutToBeAdded(
const QString &name );
220 void layoutAboutToBeRemoved(
const QString &name );
221 void layoutAdded(
const QString &name );
222 void layoutRemoved(
const QString &name );
226 bool mAllowEmpty =
false;
247 FilterPrintLayouts = 1 << 1,
248 FilterReports = 1 << 2,
250 Q_DECLARE_FLAGS( Filters,
Filter )
257 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
258 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
265 QgsLayoutManagerProxyModel::Filters filters()
const;
272 void setFilters( QgsLayoutManagerProxyModel::Filters filters );
276 Filters mFilters = Filters( FilterPrintLayouts | FilterReports );
279 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLayoutManagerProxyModel::Filters )
281 #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.
An interface for classes which can visit style entity (e.g.
QSortFilterProxyModel subclass for QgsLayoutManagerModel.
List model representing the print layouts and reports available in a layout manager.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
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)