Skip to content
Permalink
Browse files
Fix for ticket #198. The identify results dialog is now deleted when
closed by the user (it was previously just hidden).


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5646 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 29, 2006
1 parent 3d1b5c2 commit 4bb9ba49e7d1e38dbc447d03056b5d51804ee058
Showing with 26 additions and 5 deletions.
  1. +1 −1 src/gui/qgsidentifyresults.cpp
  2. +15 −3 src/gui/qgsmaptoolidentify.cpp
  3. +10 −1 src/gui/qgsmaptoolidentify.h
@@ -57,7 +57,7 @@ QgsIdentifyResults::~QgsIdentifyResults()
void QgsIdentifyResults::close()
{
saveWindowLocation();
hide();
done(0);
}
// Save the current window size/position before closing
// from window menu or X in titlebar
@@ -31,7 +31,6 @@
#include <QMessageBox>
#include <QCursor>
#include <QPixmap>
#include <QObject>


QgsMapToolIdentify::QgsMapToolIdentify(QgsMapCanvas* canvas)
@@ -48,7 +47,7 @@ QgsMapToolIdentify::~QgsMapToolIdentify()
{
if (mResults)
{
delete mResults;
mResults->done(0);
}

if (mViewer)
@@ -129,6 +128,10 @@ void QgsMapToolIdentify::identifyRasterLayer(QgsRasterLayer* layer, const QgsPoi
{
QgsAttributeAction aa;
mResults = new QgsIdentifyResults(aa, mCanvas->window());
mResults->setAttribute(Qt::WA_DeleteOnClose);
// Be informed when the dialog box is closed so that we can stop using it.
connect(mResults, SIGNAL(accepted()), this, SLOT(resultsDialogGone()));
connect(mResults, SIGNAL(rejected()), this, SLOT(resultsDialogGone()));
mResults->restorePosition();
}
else
@@ -225,7 +228,10 @@ void QgsMapToolIdentify::identifyVectorLayer(QgsVectorLayer* layer, const QgsPoi
if(!mResults)
{
mResults = new QgsIdentifyResults(actions, mCanvas->window());

mResults->setAttribute(Qt::WA_DeleteOnClose);
// Be informed when the dialog box is closed so that we can stop using it.
connect(mResults, SIGNAL(accepted()), this, SLOT(resultsDialogGone()));
connect(mResults, SIGNAL(rejected()), this, SLOT(resultsDialogGone()));
// restore the identify window position and show it
mResults->restorePosition();
}
@@ -391,4 +397,10 @@ void QgsMapToolIdentify::showError(QgsMapLayer * mapLayer)

}

void QgsMapToolIdentify::resultsDialogGone()
{
std::cerr << "Dialog closed\n";
mResults = 0;
}

// ENDS
@@ -20,6 +20,8 @@
#include "qgsmaptool.h"
#include "qgspoint.h"

#include <QObject>

class QgsIdentifyResults;
class QgsMessageViewer;
class QgsMapLayer;
@@ -34,8 +36,10 @@ class QgsVectorLayer;
- for vector layers shows feature attributes within search radius
(allows to edit values when vector layer is in editing mode)
*/
class QgsMapToolIdentify : public QgsMapTool
class QgsMapToolIdentify : public QObject, public QgsMapTool
{
Q_OBJECT;

public:
QgsMapToolIdentify(QgsMapCanvas* canvas);

@@ -87,6 +91,11 @@ class QgsMapToolIdentify : public QgsMapTool
//! Pointer to the identify results dialog for WMS XML files
QgsMessageViewer * mViewer;

private slots:
// Let us know when the QgsIdentifyResults dialog box has been closed
void resultsDialogGone();


};

#endif

0 comments on commit 4bb9ba4

Please sign in to comment.