23 mResizeMode( UseExistingFrames ),
24 mCreateUndoCommands( createUndoCommands ),
25 mIsRecalculatingSize( false )
31 QgsComposerMultiFrame::QgsComposerMultiFrame()
33 , mResizeMode( UseExistingFrames )
34 , mCreateUndoCommands( false )
35 , mIsRecalculatingSize( false )
48 Q_UNUSED( renderExtent );
53 Q_UNUSED( frameIndex );
56 render( painter, renderExtent );
78 double totalHeight = size.height();
80 if ( totalHeight < 1 )
86 double currentHeight = 0;
95 bool removingPages =
true;
108 currentHeight = currentItem->rect().height();
111 currentItem->
setContentSection( QRectF( 0, 0, currentItem->rect().width(), currentHeight ) );
116 currentItem->
setContentSection( QRectF( 0, currentY, currentItem->rect().width(), currentHeight ) );
118 currentItem->update();
119 currentY += currentHeight;
146 double frameHeight = 0;
149 frameHeight = currentItem->rect().height();
164 QPointF( currentItem->pos().x(), newFrameY ),
165 QSizeF( currentItem->rect().width(), frameHeight ) );
169 newFrame->
setContentSection( QRectF( 0, 0, newFrame->rect().width(), newFrame->rect().height() ) );
170 currentY += frameHeight;
174 double contentHeight =
findNearbyPageBreak( currentY + newFrame->rect().height() ) - currentY;
175 newFrame->
setContentSection( QRectF( 0, currentY, newFrame->rect().width(), contentHeight ) );
176 currentY += contentHeight;
179 currentItem = newFrame;
192 QList<QgsComposerFrame*>::iterator frameIt =
mFrameItems.begin();
195 ( *frameIt )->setSceneRect( QRectF(( *frameIt )->scenePos().x(), ( *frameIt )->scenePos().y(),
196 ( *frameIt )->rect().width(), ( *frameIt )->rect().height() ) );
208 pos.y(), size.width(), size.height() );
228 return tr(
"<frame>" );
271 for (
int i =
mFrameItems.size() - 1; i >= 0; --i )
290 lastFrame->rect().width(), lastFrame->rect().height() );
292 lastFrame = newFrame;
309 mIsRecalculatingSize =
true;
310 int pageNumber = frameItem->
page();
318 mIsRecalculatingSize =
false;
325 QList<QgsComposerFrame*>::iterator frameIt =
mFrameItems.begin();
328 ( *frameIt )->update();
337 QList<QgsComposerFrame*>::iterator frameIt =
mFrameItems.begin();
367 QList<QgsComposerFrame*>::const_iterator frameIt =
mFrameItems.constBegin();
368 for ( ; frameIt !=
mFrameItems.constEnd(); ++frameIt )
370 ( *frameIt )->writeXML( elem, doc );
384 QDomNodeList frameList = itemElem.elementsByTagName(
"ComposerFrame" );
385 for (
int i = 0; i < frameList.size(); ++i )
387 QDomElement frameElem = frameList.at( i ).toElement();
389 newFrame->
readXML( frameElem, doc );