17#ifndef QGSLAYOUTITEMGROUP_H
18#define QGSLAYOUTITEMGROUP_H
41 int type()
const override;
66 QList<QgsLayoutItem *>
items()
const;
75 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
override;
88 void updateBoundingRect();
92 QList< QString > mItemUuids;
93 QList< QPointer< QgsLayoutItem >> mItems;
94 QRectF mRectWithFrame;
void removeItems()
Removes all items from the group (but does not delete them).
void addItem(QgsLayoutItem *item)
Adds an item to the group.
QgsLayoutItemGroup(QgsLayout *layout)
Constructor for QgsLayoutItemGroup, belonging to the specified layout.
QList< QgsLayoutItem * > items() const
Returns a list of items contained by the group.
static QgsLayoutItemGroup * create(QgsLayout *layout)
Returns a new group item for the specified layout.
Contains settings and helpers relating to a render of a QgsLayoutItem.
friend class QgsLayoutItemGroup
virtual void cleanup()
Called just before a batch of items are deleted, allowing them to run cleanup tasks.
QgsLayoutItem(QgsLayout *layout, bool manageZValue=true)
Constructor for QgsLayoutItem, with the specified parent layout.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) override
Handles preparing a paint surface for the layout item and painting the item's content.
virtual QRectF rectWithFrame() const
Returns the item's rectangular bounds, including any bleed caused by the item's frame.
virtual void setVisibility(bool visible)
Sets whether the item is visible.
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores item state within an XML DOM element.
int page() const
Returns the page the item is currently on, with the first page returning 0.
virtual void finalizeRestoreFromXml()
Called after all pending items have been restored from XML.
int type() const override
Returns a unique graphics item type identifier.
virtual QString displayName() const
Gets item display name.
virtual void attemptResize(const QgsLayoutSize &size, bool includesFrame=false)
Attempts to resize the item to a specified target size.
virtual void attemptMove(const QgsLayoutPoint &point, bool useReferencePoint=true, bool includesFrame=false, int page=-1)
Attempts to move the item to a specified point.
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets item state from a DOM element.
ExportLayerBehavior
Behavior of item when exporting to layered outputs.
virtual ExportLayerBehavior exportLayerBehavior() const
Returns the behavior of this item during exporting to layered exports (e.g.
virtual void draw(QgsLayoutItemRenderContext &context)=0
Draws the item's contents using the specified item render context.
const QgsLayout * layout() const
Returns the layout the object is attached to.
Provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts.
Provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts.
A container for the context for various read/write operations on objects.