Emit signal when showing / hiding composer

This commit is contained in:
Marco Hugentobler 2011-06-30 16:30:50 +02:00
parent 127f7c0dd8
commit 4d051b8b32
3 changed files with 25 additions and 0 deletions

View File

@ -107,4 +107,9 @@ class QgsComposerView: QGraphicsView
/**Current action (e.g. adding composer map) has been finished. The purpose of this signal is that
QgsComposer may set the selection tool again*/
void actionFinished();
/**Emitted before composerview is shown*/
void composerViewShow( QgsComposerView* );
/**Emitted before composerview is hidden*/
void composerViewHide( QgsComposerView* );
};

View File

@ -29,6 +29,7 @@
#include "qgscomposerscalebar.h"
#include "qgscomposershape.h"
#include "qgscomposerattributetable.h"
#include "qgslogger.h"
QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WFlags f )
: QGraphicsView( parent )
@ -499,6 +500,18 @@ void QgsComposerView::paintEvent( QPaintEvent* event )
}
}
void QgsComposerView::hideEvent( QHideEvent* e )
{
emit( composerViewShow( this ) );
e->ignore();
}
void QgsComposerView::showEvent( QShowEvent* e )
{
emit( composerViewHide( this ) );
e->ignore();
}
void QgsComposerView::setComposition( QgsComposition* c )
{
setScene( c );

View File

@ -117,6 +117,8 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
void paintEvent( QPaintEvent* event );
void hideEvent( QHideEvent* e );
void showEvent( QShowEvent* e );
private:
/**Status of shift key (used for multiple selection)*/
@ -167,6 +169,11 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
/**Current action (e.g. adding composer map) has been finished. The purpose of this signal is that
QgsComposer may set the selection tool again*/
void actionFinished();
/**Emitted before composerview is shown*/
void composerViewShow( QgsComposerView* );
/**Emitted before composerview is hidden*/
void composerViewHide( QgsComposerView* );
};
#endif