Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Emit signal when showing / hiding composer
  • Loading branch information
mhugent committed Jun 30, 2011
1 parent 127f7c0 commit 4d051b8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/gui/qgscomposerview.sip
Expand Up @@ -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* );
};
13 changes: 13 additions & 0 deletions src/gui/qgscomposerview.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );
Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgscomposerview.h
Expand Up @@ -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)*/
Expand Down Expand Up @@ -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

0 comments on commit 4d051b8

Please sign in to comment.