/
qgsidentifyresults.h
122 lines (93 loc) · 3.78 KB
/
qgsidentifyresults.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/***************************************************************************
qgsidentifyresults.h - description
------------------
begin : Fri Oct 25 2002
copyright : (C) 2002 by Gary E.Sherman
email : sherman at mrcc dot com
Romans 3:23=>Romans 6:23=>Romans 5:8=>Romans 10:9,10=>Romans 12
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id$ */
#ifndef QGSIDENTIFYRESULTS_H
#define QGSIDENTIFYRESULTS_H
#include "ui_qgsidentifyresultsbase.h"
#include "qgsattributeaction.h"
#include <QWidget>
#include <vector>
#include <map>
class QCloseEvent;
class QTreeWidgetItem;
class QAction;
class QMenu;
class QgsMapLayer;
class QgsVectorLayer;
class QgsRubberBand;
class QgsMapCanvas;
/**
*@author Gary E.Sherman
*/
class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
{
Q_OBJECT
public:
//! Constructor - takes it own copy of the QgsAttributeAction so
// that it is independent of whoever created it.
QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent = 0, Qt::WFlags f = 0 );
~QgsIdentifyResults();
/** Add add feature */
void addFeature( QgsMapLayer *layer, int fid,
QString displayField, QString displayValue,
const QMap< QString, QString > &attributes,
const QMap< QString, QString > &derivedAttributes );
/** Remove results */
void clear();
/** map tool was deactivated */
void deactivate();
/** map tool was activated */
void activate();
void closeEvent( QCloseEvent *e );
signals:
void selectedFeatureChanged( QgsVectorLayer *, int featureId );
public slots:
void show();
void close();
void contextMenuEvent( QContextMenuEvent* );
void popupItemSelected( QAction* menuAction );
void layerDestroyed();
void featureDeleted( int fid );
//! Context help
void on_buttonHelp_clicked();
/* Called when an item is expanded so that we can ensure that the
column width if expanded to show it */
void itemExpanded( QTreeWidgetItem * );
//! sends signal if current feature id has changed
void handleCurrentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
private:
QMenu *mActionPopup;
QgsVectorLayer *mRubberBandLayer;
int mRubberBandFid;
QgsRubberBand *mRubberBand;
QgsMapCanvas *mCanvas;
static const int context_id = 689216579;
QgsVectorLayer *vectorLayer( QTreeWidgetItem *item );
QTreeWidgetItem *featureItem( QTreeWidgetItem *item );
QTreeWidgetItem *layerItem( QObject *layer );
QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, std::vector< std::pair<QString, QString> > &attributes );
void clearRubberBand();
void setColumnText( int column, const QString & label );
void expandColumnsToFit();
void saveWindowLocation();
void restorePosition();
void highlightFeature( QTreeWidgetItem *item );
void zoomToFeature( QTreeWidgetItem *item );
void editFeature( QTreeWidgetItem *item );
void doAction( QTreeWidgetItem *item, int action );
};
#endif