Skip to content
Permalink
Browse files

QgsDockWidget add openedStateChanged and openedStateChanged signals

  • Loading branch information
m-kuhn committed Jun 14, 2016
1 parent 4b7fc98 commit bbbc9d0abfe5bd69342e646a762d17685ef34c69
Showing with 42 additions and 12 deletions.
  1. +18 −4 python/gui/qgsdockwidget.sip
  2. +6 −4 src/gui/qgsdockwidget.cpp
  3. +18 −4 src/gui/qgsdockwidget.h
@@ -54,16 +54,30 @@ class QgsDockWidget : QDockWidget

signals:

/** Emitted when dock widget is closed.
* @see closedStateChanged()
* @see opened()
*/
void closed();

/** Emitted when dock widget is closed (or opened).
* @param wasClosed will be true if dock widget was closed, or false if dock widget was opened
* @see opened()
* @see closed()
* @see openedStateChanged()
*/
void closed( bool wasClosed );
void closedStateChanged( bool wasClosed );

/** Emitted when dock widget is opened.
* @see openedStateChanged()
* @see closed()
*/
void opened();

/** Emitted when dock widget is opened (or closed).
* @param wasOpened will be true if dock widget was opened, or false if dock widget was closed
* @see closed()
* @see closedStateChanged()
* @see opened()
*/
void opened( bool wasOpened );
void openedStateChanged( bool wasOpened );

};
@@ -59,15 +59,17 @@ bool QgsDockWidget::isUserVisible() const

void QgsDockWidget::closeEvent( QCloseEvent* e )
{
emit closed( true );
emit opened( false );
emit closed();
emit closedStateChanged( true );
emit openedStateChanged( false );
QDockWidget::closeEvent( e );
}

void QgsDockWidget::showEvent( QShowEvent* e )
{
emit closed( false );
emit opened( true );
emit opened();
emit closedStateChanged( false );
emit openedStateChanged( true );
QDockWidget::showEvent( e );
}

@@ -73,17 +73,31 @@ class GUI_EXPORT QgsDockWidget : public QDockWidget

signals:

/** Emitted when dock widget is closed.
* @see closedStateChanged()
* @see opened()
*/
void closed();

/** Emitted when dock widget is closed (or opened).
* @param wasClosed will be true if dock widget was closed, or false if dock widget was opened
* @see opened()
* @see closed()
* @see openedStateChanged()
*/
void closed( bool wasClosed );
void closedStateChanged( bool wasClosed );

/** Emitted when dock widget is opened.
* @see openedStateChanged()
* @see closed()
*/
void opened();

/** Emitted when dock widget is opened (or closed).
* @param wasOpened will be true if dock widget was opened, or false if dock widget was closed
* @see closed()
* @see closedStateChanged()
* @see opened()
*/
void opened( bool wasOpened );
void openedStateChanged( bool wasOpened );

private slots:

0 comments on commit bbbc9d0

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