QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgslayoutmultiframe.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutmultiframe.cpp
3 -----------------------
4 begin : October 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#include "qgslayoutmultiframe.h"
17#include "moc_qgslayoutmultiframe.cpp"
19#include "qgslayoutframe.h"
20#include "qgslayout.h"
22#include "qgslayoutundostack.h"
24#include <QUuid>
25
27 : QgsLayoutObject( layout )
28 , mUuid( QUuid::createUuid().toString() )
29{
30 mLayout->addMultiFrame( this );
31
32 connect( mLayout->pageCollection(), &QgsLayoutPageCollection::changed, this, &QgsLayoutMultiFrame::handlePageChange );
33}
34
39
40QSizeF QgsLayoutMultiFrame::fixedFrameSize( const int frameIndex ) const
41{
42 Q_UNUSED( frameIndex )
43 return QSizeF( 0, 0 );
44}
45
46QSizeF QgsLayoutMultiFrame::minFrameSize( const int frameIndex ) const
47{
48 Q_UNUSED( frameIndex )
49 return QSizeF( 0, 0 );
50}
51
53{
54 return yPos;
55}
56
57void QgsLayoutMultiFrame::addFrame( QgsLayoutFrame *frame, bool recalcFrameSizes )
58{
59 if ( !frame || mFrameItems.contains( frame ) )
60 return;
61
62 mFrameItems.push_back( frame );
63 frame->mMultiFrame = this;
65 connect( frame, &QgsLayoutFrame::destroyed, this, [this, frame ]
66 {
67 handleFrameRemoval( frame );
68 } );
69 if ( mLayout && !frame->scene() )
70 {
71 mLayout->addLayoutItem( frame );
72 }
73
74 if ( recalcFrameSizes )
75 {
77 }
78}
79
81{
82 if ( mode != mResizeMode )
83 {
84 mLayout->undoStack()->beginMacro( tr( "Change Resize Mode" ) );
85 mResizeMode = mode;
87 mLayout->undoStack()->endMacro();
88 emit changed();
89 }
90}
91
92QList<QgsLayoutFrame *> QgsLayoutMultiFrame::frames() const
93{
94 return mFrameItems;
95}
96
98{
99 if ( mFrameItems.empty() )
100 {
101 return;
102 }
103
104 QSizeF size = totalSize();
105 double totalHeight = size.height();
106
107 if ( totalHeight < 1 )
108 {
109 return;
110 }
111
112 if ( mBlockUndoCommands )
113 mLayout->undoStack()->blockCommands( true );
114
115 double currentY = 0;
116 double currentHeight = 0;
117 QgsLayoutFrame *currentItem = nullptr;
118
119 for ( int i = 0; i < mFrameItems.size(); ++i )
120 {
121 if ( mResizeMode != RepeatOnEveryPage && currentY >= totalHeight )
122 {
123 if ( mResizeMode == RepeatUntilFinished || mResizeMode == ExtendToNextPage ) //remove unneeded frames in extent mode
124 {
125 bool removingPages = true;
126 for ( int j = mFrameItems.size(); j > i; --j )
127 {
128 int numPagesBefore = mLayout->pageCollection()->pageCount();
129 removeFrame( j - 1, removingPages );
130 //if removing the frame didn't also remove the page, then stop removing pages
131 removingPages = removingPages && ( mLayout->pageCollection()->pageCount() < numPagesBefore );
132 }
133 return;
134 }
135 }
136
137 currentItem = mFrameItems.value( i );
138 currentHeight = currentItem->rect().height();
140 {
141 currentItem->setContentSection( QRectF( 0, 0, currentItem->rect().width(), currentHeight ) );
142 }
143 else
144 {
145 currentHeight = findNearbyPageBreak( currentY + currentHeight ) - currentY;
146 currentItem->setContentSection( QRectF( 0, currentY, currentItem->rect().width(), currentHeight ) );
147 }
148 currentItem->update();
149 currentY += currentHeight;
150 }
151
152 //at end of frames but there is still content left. Add other pages if ResizeMode ==
153 if ( mLayout->pageCollection()->pageCount() > 0 && currentItem && mResizeMode != UseExistingFrames )
154 {
155 while ( ( mResizeMode == RepeatOnEveryPage ) || currentY < totalHeight )
156 {
157 //find out on which page the lower left point of the last frame is
158 int page = mLayout->pageCollection()->predictPageNumberForPoint( QPointF( 0, currentItem->pos().y() + currentItem->rect().height() ) ) + 1;
159
161 {
162 if ( page >= mLayout->pageCollection()->pageCount() )
163 {
164 break;
165 }
166 }
167 else
168 {
169 //add new pages if required
170 for ( int p = mLayout->pageCollection()->pageCount() - 1 ; p < page; ++p )
171 {
172 mLayout->pageCollection()->extendByNewPage();
173 }
174 }
175
176 double currentPageHeight = mLayout->pageCollection()->page( page )->rect().height();
177
178 double frameHeight = 0;
179 switch ( mResizeMode )
180 {
183 {
184 frameHeight = currentItem->rect().height();
185 break;
186 }
187 case ExtendToNextPage:
188 {
189 frameHeight = ( currentY + currentPageHeight ) > totalHeight ? totalHeight - currentY : currentPageHeight;
190 break;
191 }
192
194 break;
195 }
196
197 double newFrameY = mLayout->pageCollection()->page( page )->pos().y();
199 {
200 newFrameY += currentItem->pagePos().y();
201 }
202
203 //create new frame
204 QgsLayoutFrame *newFrame = createNewFrame( currentItem,
205 QPointF( currentItem->pos().x(), newFrameY ),
206 QSizeF( currentItem->rect().width(), frameHeight ) );
207
209 {
210 newFrame->setContentSection( QRectF( 0, 0, newFrame->rect().width(), newFrame->rect().height() ) );
211 currentY += frameHeight;
212 }
213 else
214 {
215 double contentHeight = findNearbyPageBreak( currentY + newFrame->rect().height() ) - currentY;
216 newFrame->setContentSection( QRectF( 0, currentY, newFrame->rect().width(), contentHeight ) );
217 currentY += contentHeight;
218 }
219
220 currentItem = newFrame;
221 }
222 }
223
224 if ( mBlockUndoCommands )
225 mLayout->undoStack()->blockCommands( false );
226}
227
229{
230 if ( mFrameItems.empty() )
231 {
232 //no frames, nothing to do
233 return;
234 }
235
236 const QList< QgsLayoutFrame * > frames = mFrameItems;
237 for ( QgsLayoutFrame *frame : frames )
238 {
240 }
241}
242
247
248QgsLayoutFrame *QgsLayoutMultiFrame::createNewFrame( QgsLayoutFrame *currentFrame, QPointF pos, QSizeF size )
249{
250 if ( !currentFrame )
251 {
252 return nullptr;
253 }
254
255 QgsLayoutFrame *newFrame = new QgsLayoutFrame( mLayout, this );
256 newFrame->attemptSetSceneRect( QRectF( pos.x(), pos.y(), size.width(), size.height() ) );
257
258 //copy some settings from the parent frame
259 newFrame->setBackgroundColor( currentFrame->backgroundColor() );
260 newFrame->setBackgroundEnabled( currentFrame->hasBackground() );
261 newFrame->setBlendMode( currentFrame->blendMode() );
262 newFrame->setFrameEnabled( currentFrame->frameEnabled() );
263 newFrame->setFrameStrokeColor( currentFrame->frameStrokeColor() );
264 newFrame->setFrameJoinStyle( currentFrame->frameJoinStyle() );
265 newFrame->setFrameStrokeWidth( currentFrame->frameStrokeWidth() );
266 newFrame->setItemOpacity( currentFrame->itemOpacity() );
267 newFrame->setHideBackgroundIfEmpty( currentFrame->hideBackgroundIfEmpty() );
268
269 addFrame( newFrame, false );
270
271 return newFrame;
272}
273
275{
276 return tr( "<Multiframe>" );
277}
278
279QgsAbstractLayoutUndoCommand *QgsLayoutMultiFrame::createCommand( const QString &text, int id, QUndoCommand *parent )
280{
281 return new QgsLayoutMultiFrameUndoCommand( this, text, id, parent );
282}
283
290
292{
293 if ( !mLayout )
294 return;
295
296 mLayout->undoStack()->beginCommand( this, commandText, command );
297}
298
300{
301 if ( mLayout )
302 mLayout->undoStack()->endCommand();
303}
304
306{
307 if ( mLayout )
308 mLayout->undoStack()->cancelCommand();
309}
310
312{
313 for ( int i = 0; i < mFrameUuids.count(); ++i )
314 {
315 QgsLayoutFrame *frame = nullptr;
316 const QString uuid = mFrameUuids.at( i );
317 if ( !uuid.isEmpty() )
318 {
319 QgsLayoutItem *item = mLayout->itemByUuid( uuid, true );
320 frame = qobject_cast< QgsLayoutFrame * >( item );
321 }
322 if ( !frame )
323 {
324 const QString templateUuid = mFrameTemplateUuids.at( i );
325 if ( !templateUuid.isEmpty() )
326 {
327 QgsLayoutItem *item = mLayout->itemByTemplateUuid( templateUuid );
328 frame = qobject_cast< QgsLayoutFrame * >( item );
329 }
330 }
331
332 if ( frame )
333 {
334 addFrame( frame );
335 }
336 }
337}
338
344
345void QgsLayoutMultiFrame::handleFrameRemoval( QgsLayoutFrame *frame )
346{
347 if ( mBlockUpdates )
348 return;
349
350 if ( !frame )
351 {
352 return;
353 }
354 int index = mFrameItems.indexOf( frame );
355 if ( index == -1 )
356 {
357 return;
358 }
359
360 mFrameItems.removeAt( index );
361 if ( !mFrameItems.isEmpty() )
362 {
363 if ( resizeMode() != QgsLayoutMultiFrame::RepeatOnEveryPage && !mIsRecalculatingSize )
364 {
365 //removing a frame forces the multi frame to UseExistingFrames resize mode
366 //otherwise the frame may not actually be removed, leading to confusing ui behavior
368 emit changed();
370 }
371 }
372}
373
374void QgsLayoutMultiFrame::handlePageChange()
375{
376 if ( mLayout->pageCollection()->pageCount() < 1 )
377 {
378 return;
379 }
380
382 {
383 return;
384 }
385
386 //remove items beginning on non-existing pages
387 for ( int i = mFrameItems.size() - 1; i >= 0; --i )
388 {
390 int page = mLayout->pageCollection()->predictPageNumberForPoint( frame->pos() );
391 if ( page >= mLayout->pageCollection()->pageCount() )
392 {
393 removeFrame( i );
394 }
395 }
396
397 if ( !mFrameItems.empty() )
398 {
399 //page number of the last item
400 QgsLayoutFrame *lastFrame = mFrameItems.last();
401 int lastItemPage = mLayout->pageCollection()->predictPageNumberForPoint( lastFrame->pos() );
402
403 for ( int i = lastItemPage + 1; i < mLayout->pageCollection()->pageCount(); ++i )
404 {
405 //copy last frame to current page
406 std::unique_ptr< QgsLayoutFrame > newFrame = std::make_unique< QgsLayoutFrame >( mLayout, this );
407
408 newFrame->attemptSetSceneRect( QRectF( lastFrame->pos().x(),
409 mLayout->pageCollection()->page( i )->pos().y() + lastFrame->pagePos().y(),
410 lastFrame->rect().width(), lastFrame->rect().height() ) );
411 lastFrame = newFrame.get();
412 addFrame( newFrame.release(), false );
413 }
414 }
415
417 update();
418}
419
420void QgsLayoutMultiFrame::removeFrame( int i, const bool removeEmptyPages )
421{
422 if ( i >= mFrameItems.count() )
423 {
424 return;
425 }
426
427 QgsLayoutFrame *frameItem = mFrameItems.at( i );
428 if ( mLayout )
429 {
430 mIsRecalculatingSize = true;
431 int pageNumber = frameItem->page();
432 //remove item, but don't create undo command
433 mLayout->undoStack()->blockCommands( true );
434 mLayout->removeLayoutItem( frameItem );
435 //if frame was the only item on the page, remove the page
436 if ( removeEmptyPages && mLayout->pageCollection()->pageIsEmpty( pageNumber ) )
437 {
438 mLayout->pageCollection()->deletePage( pageNumber );
439 }
440 mLayout->undoStack()->blockCommands( false );
441 mIsRecalculatingSize = false;
442 }
443
444 if ( i >= mFrameItems.count() )
445 {
446 return;
447 }
448
449 mFrameItems.removeAt( i );
450}
451
453{
454 for ( QgsLayoutFrame *frame : std::as_const( mFrameItems ) )
455 {
456 frame->update();
457 }
458}
459
461{
462 mBlockUpdates = true;
463 ResizeMode bkResizeMode = mResizeMode;
465 mLayout->undoStack()->blockCommands( true );
466 for ( QgsLayoutFrame *frame : std::as_const( mFrameItems ) )
467 {
468 mLayout->removeLayoutItem( frame );
469 }
470 mLayout->undoStack()->blockCommands( false );
471 mFrameItems.clear();
472 mResizeMode = bkResizeMode;
473 mBlockUpdates = false;
474}
475
477{
478 if ( i < 0 || i >= mFrameItems.size() )
479 {
480 return nullptr;
481 }
482 return mFrameItems.at( i );
483}
484
486{
487 return mFrameItems.indexOf( frame );
488}
489
490bool QgsLayoutMultiFrame::writeXml( QDomElement &parentElement, QDomDocument &doc, const QgsReadWriteContext &context, bool includeFrames ) const
491{
492 QDomElement element = doc.createElement( QStringLiteral( "LayoutMultiFrame" ) );
493 element.setAttribute( QStringLiteral( "resizeMode" ), mResizeMode );
494 element.setAttribute( QStringLiteral( "uuid" ), mUuid );
495 element.setAttribute( QStringLiteral( "templateUuid" ), mUuid );
496 element.setAttribute( QStringLiteral( "type" ), type() );
497
499 {
500 if ( !frame )
501 continue;
502
503 QDomElement childItem = doc.createElement( QStringLiteral( "childFrame" ) );
504 childItem.setAttribute( QStringLiteral( "uuid" ), frame->uuid() );
505 childItem.setAttribute( QStringLiteral( "templateUuid" ), frame->uuid() );
506
507 if ( includeFrames )
508 {
509 frame->writeXml( childItem, doc, context );
510 }
511
512 element.appendChild( childItem );
513 }
514
515 writeObjectPropertiesToElement( element, doc, context );
516 writePropertiesToElement( element, doc, context );
517 parentElement.appendChild( element );
518 return true;
519}
520
521bool QgsLayoutMultiFrame::readXml( const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context, bool includeFrames )
522{
523 if ( element.nodeName() != QLatin1String( "LayoutMultiFrame" ) )
524 {
525 return false;
526 }
527
528 mBlockUndoCommands = true;
529 mLayout->undoStack()->blockCommands( true );
530
531 readObjectPropertiesFromElement( element, doc, context );
532
533 mUuid = element.attribute( QStringLiteral( "uuid" ), QUuid::createUuid().toString() );
534 mTemplateUuid = element.attribute( QStringLiteral( "templateUuid" ), QUuid::createUuid().toString() );
535 mResizeMode = static_cast< ResizeMode >( element.attribute( QStringLiteral( "resizeMode" ), QStringLiteral( "0" ) ).toInt() );
536
537 deleteFrames();
538 mFrameUuids.clear();
539 mFrameTemplateUuids.clear();
540 QDomNodeList elementNodes = element.elementsByTagName( QStringLiteral( "childFrame" ) );
541 for ( int i = 0; i < elementNodes.count(); ++i )
542 {
543 QDomNode elementNode = elementNodes.at( i );
544 if ( !elementNode.isElement() )
545 continue;
546
547 QDomElement frameElement = elementNode.toElement();
548
549 QString uuid = frameElement.attribute( QStringLiteral( "uuid" ) );
550 mFrameUuids << uuid;
551 QString templateUuid = frameElement.attribute( QStringLiteral( "templateUuid" ) );
552 mFrameTemplateUuids << templateUuid;
553
554 if ( includeFrames )
555 {
556 QDomNodeList frameNodes = frameElement.elementsByTagName( QStringLiteral( "LayoutItem" ) );
557 if ( !frameNodes.isEmpty() )
558 {
559 QDomElement frameItemElement = frameNodes.at( 0 ).toElement();
560 std::unique_ptr< QgsLayoutFrame > newFrame = std::make_unique< QgsLayoutFrame >( mLayout, this );
561 newFrame->readXml( frameItemElement, doc, context );
562 addFrame( newFrame.release(), false );
563 }
564 }
565 }
566
567 bool result = readPropertiesFromElement( element, doc, context );
568
569 mBlockUndoCommands = false;
570 mLayout->undoStack()->blockCommands( false );
571 return result;
572}
573
574bool QgsLayoutMultiFrame::writePropertiesToElement( QDomElement &, QDomDocument &, const QgsReadWriteContext & ) const
575{
576 return true;
577}
578
579bool QgsLayoutMultiFrame::readPropertiesFromElement( const QDomElement &, const QDomDocument &, const QgsReadWriteContext & )
580{
581
582 return true;
583}
584
Base class for commands to undo/redo layout and layout object changes.
static QgsExpressionContextScope * multiFrameScope(const QgsLayoutMultiFrame *frame)
Creates a new scope which contains variables and functions relating to a QgsLayoutMultiFrame.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
Base class for frame items, which form a layout multiframe item.
void setContentSection(const QRectF &section)
Sets the visible part of the multiframe's content which is visible within this frame (relative to the...
bool hideBackgroundIfEmpty() const
Returns whether the background and frame stroke should be hidden if this frame is empty.
void setHideBackgroundIfEmpty(bool hideBackgroundIfEmpty)
Sets whether the background and frame stroke should be hidden if this frame is empty.
Base class for graphical items within a QgsLayout.
QColor backgroundColor(bool useDataDefined=true) const
Returns the background color for this item.
bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const
Stores the item state in a DOM element.
virtual void setFrameStrokeWidth(QgsLayoutMeasurement width)
Sets the frame stroke width.
void setBackgroundColor(const QColor &color)
Sets the background color for this item.
QgsLayoutMeasurement frameStrokeWidth() const
Returns the frame's stroke width.
double itemOpacity() const
Returns the item's opacity.
void setItemOpacity(double opacity)
Sets the item's opacity.
void refreshItemSize()
Refreshes an item's size by rechecking it against any possible item fixed or minimum sizes.
int page() const
Returns the page the item is currently on, with the first page returning 0.
void setFrameStrokeColor(const QColor &color)
Sets the frame stroke color.
void setFrameJoinStyle(Qt::PenJoinStyle style)
Sets the join style used when drawing the item's frame.
virtual void setFrameEnabled(bool drawFrame)
Sets whether this item has a frame drawn around it or not.
void sizePositionChanged()
Emitted when the item's size or position changes.
virtual QString uuid() const
Returns the item identification string.
QPointF pagePos() const
Returns the item's position (in layout units) relative to the top left corner of its current page.
void setBlendMode(QPainter::CompositionMode mode)
Sets the item's composition blending mode.
bool frameEnabled() const
Returns true if the item includes a frame.
bool hasBackground() const
Returns true if the item has a background.
void attemptSetSceneRect(const QRectF &rect, bool includesFrame=false)
Attempts to update the item's position and size to match the passed rect in layout coordinates.
QColor frameStrokeColor() const
Returns the frame's stroke color.
void setBackgroundEnabled(bool drawBackground)
Sets whether this item has a background drawn under it or not.
QPainter::CompositionMode blendMode() const
Returns the item's composition blending mode.
Qt::PenJoinStyle frameJoinStyle() const
Returns the join style used for drawing the item's frame.
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores multiframe state within an XML DOM element.
void setResizeMode(ResizeMode mode)
Sets the resize mode for the multiframe, and recalculates frame sizes to match.
virtual QSizeF totalSize() const =0
Returns the total size of the multiframe's content, in layout units.
virtual void addFrame(QgsLayoutFrame *frame, bool recalcFrameSizes=true)
Adds a frame to the multiframe.
QgsLayoutMultiFrame(QgsLayout *layout)
Construct a new multiframe item, attached to the specified layout.
bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context, bool includeFrames=false) const
Stores the multiframe state in a DOM element.
virtual void finalizeRestoreFromXml()
Called after all pending items have been restored from XML.
QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id, QUndoCommand *parent=nullptr) override
Creates a new layout undo command with the specified text and parent.
bool readXml(const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context, bool includeFrames=false)
Sets the item state from a DOM element.
void deleteFrames()
Removes and deletes all child frames.
QgsLayoutFrame * frame(int index) const
Returns the child frame at a specified index from the multiframe.
virtual QSizeF fixedFrameSize(int frameIndex=-1) const
Returns the fixed size for a frame, if desired.
void removeFrame(int index, bool removeEmptyPages=false)
Removes a frame by index from the multiframe.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QList< QgsLayoutFrame * > mFrameItems
void cancelCommand()
Cancels the current item command and discards it.
virtual int type() const =0
Returns unique multiframe type id.
ResizeMode resizeMode() const
Returns the resize mode for the multiframe.
virtual QSizeF minFrameSize(int frameIndex=-1) const
Returns the minimum size for a frames, if desired.
virtual double findNearbyPageBreak(double yPos)
Finds the optimal position to break a frame at.
QString uuid() const
Returns the multiframe identification string.
ResizeMode
Specifies the behavior for creating new frames to fit the multiframe's content.
@ UseExistingFrames
Don't automatically create new frames, just use existing frames.
@ RepeatOnEveryPage
Repeats the same frame on every page.
@ ExtendToNextPage
Creates new full page frames on the following page(s) until the entire multiframe content is visible.
void refresh() override
Refreshes the multiframe, causing a recalculation of any property overrides.
void endCommand()
Completes the current item command and push it onto the layout's undo stack.
QgsLayoutFrame * createNewFrame(QgsLayoutFrame *currentFrame, QPointF pos, QSizeF size)
Creates a new frame and adds it to the multi frame and layout.
void beginCommand(const QString &commandText, UndoCommand command=UndoNone)
Starts new undo command for this item.
QList< QgsLayoutFrame * > frames() const
Returns a list of all child frames for this multiframe.
virtual void recalculateFrameSizes()
Recalculates the portion of the multiframe item which is shown in each of its component frames.
void update()
Forces a redraw of all child frames.
int frameIndex(QgsLayoutFrame *frame) const
Returns the index of a frame within the multiframe.
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::DataDefinedProperty::AllProperties)
Refreshes a data defined property for the multi frame by reevaluating the property's value and redraw...
void recalculateFrameRects()
Forces a recalculation of all the associated frame's scene rectangles.
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets multiframe state from a DOM element.
virtual QString displayName() const
Returns the multiframe display name.
UndoCommand
Multiframe item undo commands, used for collapsing undo commands.
A base class for objects which belong to a layout.
bool readObjectPropertiesFromElement(const QDomElement &parentElement, const QDomDocument &document, const QgsReadWriteContext &context)
Sets object properties from a DOM element.
void changed()
Emitted when the object's properties change.
virtual void refresh()
Refreshes the object, causing a recalculation of any property overrides.
QPointer< QgsLayout > mLayout
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
DataDefinedProperty
Data defined properties for different item types.
bool writeObjectPropertiesToElement(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const
Stores object properties within an XML DOM element.
void changed()
Emitted when pages are added or removed from the collection.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition qgslayout.h:49
The class is used as a container of context for various read/write operations on other objects.