Skip to content

Commit 0ed3d47

Browse files
committed
Recalculate content if one of the frames changes size
1 parent c01edd4 commit 0ed3d47

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/core/composer/qgscomposermultiframe.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ void QgsComposerMultiFrame::recalculateFrameSizes()
3737
item->setContentSection( QRectF( 0, 0, item->rect().width(), item->rect().height() ) );
3838
}
3939
}
40+
41+
void QgsComposerMultiFrame::addFrame( QgsComposerFrame* frame )
42+
{
43+
mFrameItems.push_back( frame );
44+
QObject::connect( frame, SIGNAL( sizeChanged() ), this, SLOT( recalculateFrameSizes() ) );
45+
}

src/core/composer/qgscomposermultiframe.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ class QgsComposerMultiFrame: public QObject
4141
virtual QSizeF totalSize() const = 0;
4242
virtual void render( QPainter* p, const QRectF& renderExtent ) = 0;
4343

44-
void addFrame( QgsComposerFrame* frame ) { mFrameItems.push_back( frame ); }
44+
void addFrame( QgsComposerFrame* frame );
4545

4646
protected:
4747
QgsComposition* mComposition;
4848
QList<QgsComposerFrame*> mFrameItems;
4949

50+
protected slots:
5051
void recalculateFrameSizes();
5152

5253
private:

0 commit comments

Comments
 (0)