Skip to content
Permalink
Browse files

Emit signal when showing / hiding composer

  • Loading branch information
mhugent committed Jun 30, 2011
1 parent 127f7c0 commit 4d051b8b32dc4fc85f5921013a559335e7593a9f
Showing with 25 additions and 0 deletions.
  1. +5 −0 python/gui/qgscomposerview.sip
  2. +13 −0 src/gui/qgscomposerview.cpp
  3. +7 −0 src/gui/qgscomposerview.h
@@ -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* );
};
@@ -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 );
@@ -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

0 comments on commit 4d051b8

Please sign in to comment.
You can’t perform that action at this time.