17 #ifndef QGSLAYOUTITEMPAGE_H 18 #define QGSLAYOUTITEMPAGE_H 20 #include "qgis_core.h" 35 class CORE_EXPORT QgsLayoutItemPageGrid:
public QGraphicsRectItem
38 QgsLayoutItemPageGrid(
double x,
double y,
double width,
double height,
QgsLayout *layout );
40 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
override;
71 UndoPageSymbol = 3000,
87 int type()
const override;
105 bool setPageSize(
const QString &size,
Orientation orientation = Portrait );
146 QRectF boundingRect()
const override;
166 double mMaximumShadowWidth = -1;
168 std::unique_ptr< QgsLayoutItemPageGrid > mGrid;
169 mutable QRectF mBoundingRect;
172 std::unique_ptr< QgsFillSymbol > mPageStyleSymbol;
174 void createDefaultPageStyleSymbol();
176 friend class TestQgsLayoutPage;
179 #endif //QGSLAYOUTITEMPAGE_H The class is used as a container of context for various read/write operations on other objects...
Base class for graphical items within a QgsLayout.
int type() const override
Returns a unique graphics item type identifier.
Base class for commands to undo/redo layout and layout object changes.
UndoCommand
Layout item undo commands, used for collapsing undo commands.
An interface for classes which can visit style entity (e.g.
virtual void drawFrame(QgsRenderContext &context)
Draws the frame around the item.
const QgsFillSymbol * pageStyleSymbol() const
Returns the symbol to use for drawing the page background.
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets item state from a DOM element.
virtual void drawBackground(QgsRenderContext &context)
Draws the background for the item.
virtual void attemptResize(const QgsLayoutSize &size, bool includesFrame=false)
Attempts to resize the item to a specified target size.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified style entity visitor, causing it to visit all style entities associated with th...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
virtual void redraw()
Triggers a redraw (update) of the item.
Contains settings and helpers relating to a render of a QgsLayoutItem.
virtual QString displayName() const
Gets item display name.
Contains information about the context of a rendering operation.
ExportLayerBehavior
Behavior of item when exporting to layered outputs.
Orientation
Page orientation.
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores item state within an XML DOM element.
virtual void draw(QgsLayoutItemRenderContext &context)=0
Draws the item's contents using the specified item render context.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
virtual ExportLayerBehavior exportLayerBehavior() const
Returns the behavior of this item during exporting to layered exports (e.g.
QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id, QUndoCommand *parent=nullptr) override
Creates a new layout undo command with the specified text and parent.
Item representing the paper in a layout.