16#ifndef QGSLAYOUTGUIDECOLLECTION_H
17#define QGSLAYOUTGUIDECOLLECTION_H
27#include <QAbstractListModel>
28#include <QGraphicsLineItem>
30#include <QSortFilterProxyModel>
33using namespace Qt::StringLiterals;
126 QGraphicsLineItem *
item();
148 Qt::Orientation mOrientation = Qt::Vertical;
154 QPointer< QgsLayoutItemPage > mPage;
156 QPointer< QgsLayout > mLayout;
159 QGraphicsLineItem *mLineItem =
nullptr;
200 QString
stringType()
const override {
return u
"LayoutGuideCollection"_s; }
203 int rowCount(
const QModelIndex & )
const override;
204 int columnCount(
const QModelIndex & )
const override;
205 QVariant data(
const QModelIndex &index,
int role )
const override;
206 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
207 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
208 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
209 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
227 void setGuideLayoutPosition(
QgsLayoutGuide *guide,
double position );
238 void applyGuidesToAllOtherPages(
int sourcePage );
248 QList< QgsLayoutGuide * > guides();
256 QList< QgsLayoutGuide * > guides( Qt::Orientation orientation,
int page = -1 );
262 QList< QgsLayoutGuide * > guidesOnPage(
int page );
268 bool visible()
const;
274 void setVisible(
bool visible );
280 bool writeXml( QDomElement &parentElement, QDomDocument &document,
const QgsReadWriteContext &context )
const override;
286 bool readXml(
const QDomElement &collectionElement,
const QDomDocument &document,
const QgsReadWriteContext &context )
override;
290 void pageAboutToBeRemoved(
int pageNumber );
299 QgsLayout *mLayout =
nullptr;
300 QgsLayoutPageCollection *mPageCollection =
nullptr;
302 QList< QgsLayoutGuide * > mGuides;
305 bool mGuidesVisible =
true;
306 bool mBlockUndoCommands =
false;
334 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
335 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
338 Qt::Orientation mOrientation = Qt::Horizontal;
Stores and manages the snap guides used by a layout.
QString stringType() const override
Returns the object type as a string.
QgsLayoutGuideCollection(QgsLayout *layout, QgsLayoutPageCollection *pageCollection)
Constructor for QgsLayoutGuideCollection belonging to the specified layout, and linked to the specifi...
friend class QgsLayoutGuideCollectionUndoCommand
void setPage(int page)
Sets the current page for filtering matching guides.
QgsLayoutGuideProxyModel(QObject *parent, Qt::Orientation orientation, int page)
Constructor for QgsLayoutGuideProxyModel, filtered to guides of the specified orientation and page on...
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Contains the configuration for a single snap guide used by a layout.
QgsLayoutMeasurement position() const
Returns the guide's position within the page.
QgsLayoutItemPage * page()
Returns the page the guide is contained within.
Qt::Orientation orientation() const
Returns the guide's orientation.
QgsLayout * layout() const
Returns the layout the guide belongs to.
void setLayout(QgsLayout *layout)
Sets the layout the guide belongs to.
void setLayoutPosition(double position)
Sets the guide's position in absolute layout units.
void setPage(QgsLayoutItemPage *page)
Sets the page the guide is contained within.
void setPosition(QgsLayoutMeasurement position)
Sets the guide's position within the page.
QgsLayoutGuide(Qt::Orientation orientation, QgsLayoutMeasurement position, QgsLayoutItemPage *page)
Constructor for a new guide with the specified orientation and initial position.
double layoutPosition() const
Returns the guide's position in absolute layout units.
void positionChanged()
Emitted when the guide's position is changed.
void update()
Updates the position of the guide's line item.
QGraphicsLineItem * item()
Returns the guide's line item.
Item representing the paper in a layout.
Provides a method of storing measurements for use in QGIS layouts using a variety of different measur...
A manager for a collection of pages in a layout.
An interface for layout objects which can be stored and read from DOM elements.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A container for the context for various read/write operations on objects.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)