Skip to content
Permalink
Browse files
georeferencer: fix closeEvent handling for dock widget.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13561 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mmassing committed May 24, 2010
1 parent 5a8575f commit 90827ffae7393eae0ee21dab8ce2f4e34fd8d6ab
Showing with 26 additions and 15 deletions.
  1. +17 −15 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  2. +9 −0 src/plugins/georeferencer/qgsgeorefplugingui.h
@@ -62,20 +62,22 @@

#include "qgsgeorefplugingui.h"

class QgsGeorefDockWidget : public QDockWidget

QgsGeorefDockWidget::QgsGeorefDockWidget( const QString & title, QWidget * parent, Qt::WindowFlags flags )
: QDockWidget( title, parent, flags )
{
public:
QgsGeorefDockWidget( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
: QDockWidget( title, parent, flags )
{
setObjectName( "GeorefDockWidget" ); // set object name so the position can be saved
}
setObjectName( "GeorefDockWidget" ); // set object name so the position can be saved
}

virtual void closeEvent( QCloseEvent * ev )
{
deleteLater();
}
};
void QgsGeorefDockWidget::closeEvent( QCloseEvent * ev )
{
if (widget() && !widget()->close())
{
ev->ignore();
return;
}
deleteLater();
}

QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget* parent, Qt::WFlags fl )
: QMainWindow( parent, fl )
@@ -130,7 +132,6 @@ void QgsGeorefPluginGui::dockThisWindow( bool dock )
{
mDock = new QgsGeorefDockWidget( tr( "Georeferencer" ), mIface->mainWindow() );
mDock->setWidget( this );
connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
mIface->addDockWidget( Qt::BottomDockWidgetArea, mDock );
}
}
@@ -151,6 +152,7 @@ QgsGeorefPluginGui::~QgsGeorefPluginGui()
delete mToolAddPoint;
delete mToolDeletePoint;
delete mToolMovePoint;

}

// ----------------------------- protected --------------------------------- //
@@ -929,8 +931,8 @@ void QgsGeorefPluginGui::createDockWidgets()
dockWidgetGCPpoints->setWidget( mGCPListWidget );

connect( mGCPListWidget, SIGNAL( jumpToGCP( uint ) ), this, SLOT( jumpToGCP( uint ) ) );
connect( mGCPListWidget, SIGNAL( replaceDataPoint( QgsGeorefDataPoint*, int ) ),
this, SLOT( replaceDataPoint( QgsGeorefDataPoint*, int ) ) );
/*connect( mGCPListWidget, SIGNAL( replaceDataPoint( QgsGeorefDataPoint*, int ) ),
this, SLOT( replaceDataPoint( QgsGeorefDataPoint*, int ) ) );*/
connect( mGCPListWidget, SIGNAL( deleteDataPoint( int ) ),
this, SLOT( deleteDataPoint( int ) ) );
connect( mGCPListWidget, SIGNAL( pointEnabled( QgsGeorefDataPoint*, int ) ), this, SLOT( updateGeorefTransform() ) );
@@ -225,4 +225,13 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas

QDockWidget* mDock;
};

class QgsGeorefDockWidget : public QDockWidget
{
Q_OBJECT
public:
QgsGeorefDockWidget( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 );
virtual void closeEvent( QCloseEvent * ev );
};

#endif

0 comments on commit 90827ff

Please sign in to comment.