Skip to content

Commit

Permalink
Recalculate content if one of the frames changes size
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 25, 2012
1 parent c01edd4 commit 0ed3d47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/core/composer/qgscomposermultiframe.cpp
Expand Up @@ -37,3 +37,9 @@ void QgsComposerMultiFrame::recalculateFrameSizes()
item->setContentSection( QRectF( 0, 0, item->rect().width(), item->rect().height() ) );
}
}

void QgsComposerMultiFrame::addFrame( QgsComposerFrame* frame )
{
mFrameItems.push_back( frame );
QObject::connect( frame, SIGNAL( sizeChanged() ), this, SLOT( recalculateFrameSizes() ) );
}
3 changes: 2 additions & 1 deletion src/core/composer/qgscomposermultiframe.h
Expand Up @@ -41,12 +41,13 @@ class QgsComposerMultiFrame: public QObject
virtual QSizeF totalSize() const = 0;
virtual void render( QPainter* p, const QRectF& renderExtent ) = 0;

void addFrame( QgsComposerFrame* frame ) { mFrameItems.push_back( frame ); }
void addFrame( QgsComposerFrame* frame );

protected:
QgsComposition* mComposition;
QList<QgsComposerFrame*> mFrameItems;

protected slots:
void recalculateFrameSizes();

private:
Expand Down

0 comments on commit 0ed3d47

Please sign in to comment.