16 #ifndef QGSLAYOUTGUIDECOLLECTION_H 17 #define QGSLAYOUTGUIDECOLLECTION_H 19 #include "qgis_core.h" 25 #include <QAbstractListModel> 26 #include <QSortFilterProxyModel> 27 #include <QGraphicsLineItem> 80 Qt::Orientation orientation()
const;
124 QGraphicsLineItem *item();
130 double layoutPosition()
const;
136 void setLayoutPosition(
double position );
143 void positionChanged();
147 Qt::Orientation mOrientation = Qt::Vertical;
153 QPointer< QgsLayoutItemPage > mPage;
155 QPointer< QgsLayout > mLayout;
158 QGraphicsLineItem *mLineItem =
nullptr;
178 OrientationRole = Qt::UserRole,
192 QString
stringType()
const override {
return QStringLiteral(
"LayoutGuideCollection" ); }
195 int rowCount(
const QModelIndex & )
const override;
196 int columnCount(
const QModelIndex & )
const override;
197 QVariant data(
const QModelIndex &index,
int role )
const override;
198 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
199 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
200 QVariant headerData(
int section, Qt::Orientation orientation,
201 int role = Qt::DisplayRole )
const override;
202 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
220 void setGuideLayoutPosition(
QgsLayoutGuide *guide,
double position );
231 void applyGuidesToAllOtherPages(
int sourcePage );
241 QList< QgsLayoutGuide * > guides();
249 QList< QgsLayoutGuide * > guides( Qt::Orientation orientation,
int page = -1 );
255 QList< QgsLayoutGuide * > guidesOnPage(
int page );
261 bool visible()
const;
267 void setVisible(
bool visible );
279 bool readXml(
const QDomElement &collectionElement,
const QDomDocument &document,
const QgsReadWriteContext &context )
override;
283 void pageAboutToBeRemoved(
int pageNumber );
296 QList< QgsLayoutGuide * > mGuides;
299 bool mGuidesVisible =
true;
300 bool mBlockUndoCommands =
false;
302 friend class QgsLayoutGuideCollectionUndoCommand;
329 void setPage(
int page );
331 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
332 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
335 Qt::Orientation mOrientation = Qt::Horizontal;
340 #endif //QGSLAYOUTGUIDECOLLECTION_H The class is used as a container of context for various read/write operations on other objects...
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
Contains the configuration for a single snap guide used by a layout.
Filters QgsLayoutGuideCollection models to guides of a single orientation (horizontal or vertical)...
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
Guide position in layout coordinates.
Stores and manages the snap guides used by a layout.
virtual QgsLayout * layout()=0
Returns the layout the object belongs to.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A manager for a collection of pages in a layout.
Guide position units role.
An interface for layout objects which can be stored and read from DOM elements.
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
QString stringType() const override
Returns the object type as a string.
Item representing the paper in a layout.