17 #ifndef QGSLAYOUTPAGECOLLECTION_H 18 #define QGSLAYOUTPAGECOLLECTION_H 20 #include "qgis_core.h" 54 QString
stringType()
const override {
return QStringLiteral(
"LayoutPageCollection" ); }
62 QList< QgsLayoutItemPage * > pages();
68 int pageCount()
const;
100 QList< QgsLayoutItemPage * > visiblePages(
const QRectF ®ion )
const;
107 QList< int > visiblePageNumbers(
const QRectF ®ion )
const;
114 bool pageIsEmpty(
int page )
const;
119 QList< QgsLayoutItem *> itemsOnPage(
int page )
const;
125 template<
class T>
void itemsOnPage( QList<T *> &itemList,
int page )
const SIP_SKIP
128 const QList<QGraphicsItem *> graphicsItemList = mLayout->items();
129 for ( QGraphicsItem *graphicsItem : graphicsItemList )
131 T *item =
dynamic_cast<T *
>( graphicsItem );
132 if ( item && item->page() == page )
134 itemList.push_back( item );
147 bool shouldExportPage(
int page )
const;
201 void deletePage(
int pageNumber );
244 void beginPageSizeChange();
252 void endPageSizeChange();
266 double maximumPageWidth()
const;
274 QSizeF maximumPageSize()
const;
282 bool hasUniformPageSizes()
const;
298 int pageNumberForPoint( QPointF point )
const;
315 int predictPageNumberForPoint( QPointF point )
const;
333 QPointF pagePositionToLayoutPosition(
int page,
const QgsLayoutPoint &position )
const;
346 QPointF positionOnPage( QPointF point )
const;
351 double spaceBetweenPages()
const;
356 double pageShadowWidth()
const;
378 bool readXml(
const QDomElement &collectionElement,
const QDomDocument &document,
const QgsReadWriteContext &context )
override;
410 void pageAboutToBeRemoved(
int pageNumber );
416 std::unique_ptr< QgsLayoutGuideCollection > mGuideCollection;
419 std::unique_ptr< QgsFillSymbol > mPageStyleSymbol;
421 QList< QgsLayoutItemPage * > mPages;
423 bool mBlockUndoCommands =
false;
425 QMap< QString, QPair< int, QgsLayoutPoint > > mPreviousItemPositions;
427 void createDefaultPageStyleSymbol();
429 friend class QgsLayoutPageCollectionUndoCommand;
432 #endif //QGSLAYOUTPAGECOLLECTION_H The class is used as a container of context for various read/write operations on other objects...
QString stringType() const override
Returns the object type as a string.
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
const QgsFillSymbol * pageStyleSymbol() const
Returns the symbol to use for drawing pages in the collection.
This class provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts.
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.
void itemsOnPage(QList< T * > &itemList, int page) const
Returns layout items of a specific type on a specified page.
An interface for layout objects which can be stored and read from DOM elements.
LayoutUnit
Layout measurement units.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
The QgsMargins class defines the four margins of a rectangle.
Item representing the paper in a layout.