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
***************************************************************************/
18
/* $Id: qgsidentifyresults.h 6090 2006-11-16 02:27:32Z gsherman $ */
19
#ifndef QGSIDENTIFYRESULTS_H
20
#define QGSIDENTIFYRESULTS_H
22
#include "ui_qgsidentifyresultsbase.h"
23
#include "qgsattributeaction.h"
29
class QTreeWidgetItem;
34
*@author Gary E.Sherman
37
class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
42
//! Constructor - takes it own copy of the QgsAttributeAction so
43
// that it is independent of whoever created it.
44
QgsIdentifyResults(const QgsAttributeAction& actions, QWidget *parent = 0, Qt::WFlags f = 0);
46
~QgsIdentifyResults();
48
/** Add an attribute to the feature display node */
49
void addAttribute(QTreeWidgetItem *parent, QString field, QString value);
51
/** Add an attribute */
52
void addAttribute(QString field, QString value);
54
/** Add a derived attribute (e.g. Length, Area) to the feature display node */
55
void addDerivedAttribute(QTreeWidgetItem *parent, QString field, QString value);
57
/** Add an action to the feature display node */
58
void addAction(QTreeWidgetItem *parent, int id, QString field, QString value);
60
/** Add a feature node to the feature display */
61
QTreeWidgetItem * addNode(QString label);
62
/** Set the title for the identify results dialog */
63
void setTitle(QString title);
64
/** Set header column */
65
void setColumnText ( int column, const QString & label );
66
void saveWindowLocation();
67
void restorePosition();
68
void closeEvent(QCloseEvent *e);
69
void showAllAttributes();
71
/** Resize all of the columns to fit the data in them */
72
void expandColumnsToFit();
77
/** Set "No features ... " */
78
void setMessage( QString shortMsg, QString longMsg );
81
void setActions ( const QgsAttributeAction& actions );
91
void contextMenuEvent(QContextMenuEvent*);
92
void popupItemSelected(QAction* menuAction);
94
/* Item in tree was clicked */
95
void clicked ( QTreeWidgetItem *lvi );
98
void on_buttonHelp_clicked();
100
/* Called when an item is expanded so that we can ensure that the
101
column width if expanded to show it */
102
void itemExpanded(QTreeWidgetItem*);
106
QgsAttributeAction mActions;
109
std::vector<std::pair<QString, QString> > mValues;
110
static const int context_id = 689216579;
113
Keeps track of what derived-attribute (e.g. Length, Area)
114
root nodes have been generated for each feature in this widget.
116
First item: Feature root node
117
Second item: Derived-attribute root node for that feature
119
std::map<QTreeWidgetItem *, QTreeWidgetItem *> mDerivedAttributeRootNodes;