1
/***************************************************************************
2
qgsidentifyresults.h - description
4
begin : Fri Oct 25 2002
5
copyright : (C) 2002 by Gary E.Sherman
6
email : sherman at mrcc dot com
7
Romans 3:23=>Romans 6:23=>Romans 5:8=>Romans 10:9,10=>Romans 12
8
***************************************************************************/
10
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
***************************************************************************/
19
#ifndef QGSIDENTIFYRESULTS_H
20
#define QGSIDENTIFYRESULTS_H
22
#include "ui_qgsidentifyresultsbase.h"
23
#include "qgsattributeaction.h"
24
#include "qgscontexthelp.h"
30
class QTreeWidgetItem;
41
*@author Gary E.Sherman
44
class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
50
//! Constructor - takes it own copy of the QgsAttributeAction so
51
// that it is independent of whoever created it.
52
QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent = 0, Qt::WFlags f = 0 );
54
~QgsIdentifyResults();
56
/** Add add feature */
57
void addFeature( QgsMapLayer *layer, int fid,
58
QString displayField, QString displayValue,
59
const QMap< QString, QString > &attributes,
60
const QMap< QString, QString > &derivedAttributes );
62
/** map tool was deactivated */
65
/** map tool was activated */
68
void closeEvent( QCloseEvent *e );
71
void selectedFeatureChanged( QgsVectorLayer *, int featureId );
80
void contextMenuEvent( QContextMenuEvent* );
82
void layerDestroyed();
83
void editingToggled();
84
void featureDeleted( int fid );
88
void copyAttributeValue();
89
void copyFeatureAttributes();
91
void highlightLayer();
92
void clearRubberbands();
96
/* Called when an item is expanded so that we can ensure that the
97
column width if expanded to show it */
98
void itemExpanded( QTreeWidgetItem * );
100
//! sends signal if current feature id has changed
101
void handleCurrentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
103
/* Item in tree was clicked */
104
void itemClicked( QTreeWidgetItem *lvi, int column );
106
QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QList< QPair<QString, QString> > &attributes, int ¤tIdx );
108
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
112
QMap<QTreeWidgetItem *, QgsRubberBand * > mRubberBands;
113
QgsMapCanvas *mCanvas;
115
QgsVectorLayer *vectorLayer( QTreeWidgetItem *item );
116
QTreeWidgetItem *featureItem( QTreeWidgetItem *item );
117
QTreeWidgetItem *layerItem( QTreeWidgetItem *item );
118
QTreeWidgetItem *layerItem( QObject *layer );
120
void highlightLayer( QTreeWidgetItem *object );
121
void disconnectLayer( QObject *object );
123
void setColumnText( int column, const QString & label );
124
void expandColumnsToFit();
125
void saveWindowLocation();
126
void restorePosition();
128
void highlightFeature( QTreeWidgetItem *item );
130
void doAction( QTreeWidgetItem *item, int action );
135
class QgsFeatureAction : public QAction
140
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem ) :
141
QAction( name, results ), mResults( results ), mLayer( vl ), mAction( action ), mFeatItem( featItem )
148
QgsIdentifyResults *mResults;
149
QgsVectorLayer *mLayer;
151
QTreeWidgetItem *mFeatItem;