Skip to content

Commit 08962ea

Browse files
author
wonder
committed
Documentation of attribute table headers - patch from Vita Cizek.
git-svn-id: http://svn.osgeo.org/qgis/trunk@11113 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f1167f0 commit 08962ea

File tree

7 files changed

+291
-6
lines changed

7 files changed

+291
-6
lines changed

src/app/attributetable/qgsattributetabledelegate.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class QgsAttributeTableDelegate : public QItemDelegate
2727
{
2828
Q_OBJECT;
2929
public:
30-
/** Constructor */
30+
/** Constructor
31+
* @param parent parent object
32+
*/
3133
QgsAttributeTableDelegate( QObject* parent = NULL ) :
3234
QItemDelegate( parent ) {};
3335
/** Used to create an editor for when the user tries to

src/app/attributetable/qgsattributetabledialog.h

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,42 +45,124 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
4545
Q_OBJECT
4646

4747
public:
48+
/**
49+
* Constructor
50+
* @param theLayer layer pointer
51+
* @param parent parent object
52+
* @param flags window flags
53+
*/
4854
QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
4955
~QgsAttributeTableDialog();
5056

5157
public slots:
58+
/**
59+
* Toggles editing mode
60+
*/
5261
void editingToggled();
5362

5463
private slots:
64+
/**
65+
* submits the data
66+
*/
5567
void submit();
68+
/**
69+
* Reverts the changes
70+
*/
5671
void revert();
72+
/**
73+
* Launches search
74+
*/
5775
void search();
76+
/**
77+
* Launches advanced search
78+
*/
5879
void on_mAdvancedSearchButton_clicked();
80+
/**
81+
* Updates the selection
82+
*/
5983
void updateSelection();
84+
/**
85+
* Reads the selection from the layer
86+
*/
6087
void updateSelectionFromLayer();
88+
/**
89+
* Updates selection of a row
90+
*/
6191
void updateRowSelection( int index );
92+
/**
93+
* Updates selection of specifed rows
94+
* @param first first row
95+
* @param last last row
96+
* @param startNewSelection if true, then new selection is started
97+
*/
6298
void updateRowSelection( int first, int last, bool startNewSelection );
6399

100+
/**
101+
* Toggle showing of selected line only
102+
* @param theFlag toggle on if true
103+
*/
64104
void on_cbxShowSelectedOnly_toggled( bool theFlag );
105+
/**
106+
* Copies selected rows to the clipboard
107+
*/
65108
void on_mCopySelectedRowsButton_clicked();
66109

110+
/**
111+
* Toggles editing mode
112+
*/
67113
void on_mToggleEditingButton_toggled();
114+
/**
115+
* Inverts selection
116+
*/
68117
void on_mInvertSelectionButton_clicked();
118+
/**
119+
* Clears selection
120+
*/
69121
void on_mRemoveSelectionButton_clicked();
122+
/**
123+
* Zooms to selected features
124+
*/
70125
void on_mZoomMapToSelectedRowsButton_clicked();
126+
/**
127+
* Moves selected lines to the top
128+
*/
71129
void on_mSelectedToTopButton_clicked();
130+
/**
131+
* Shows advanced actions
132+
*/
72133
void showAdvanced();
134+
/**
135+
* Starts editing mode
136+
*/
73137
void startEditing();
74138

75139
signals:
76-
void editingToggled( QgsMapLayer * );
140+
/**
141+
* Informs that editing mode ha been toggled
142+
* @param layer layer that has been toggled
143+
*/
144+
void editingToggled( QgsMapLayer *layer );
77145

78146
protected:
147+
/**
148+
* Handle closing of the window
149+
* @param event unused
150+
*/
79151
void closeEvent( QCloseEvent* event );
80152

81153
private:
154+
/**
155+
* Initialize column box
156+
*/
82157
void columnBoxInit();
158+
/**
159+
* Returns id of a column
160+
*/
83161
int columnBoxColumnId();
162+
/**
163+
* Performs the search
164+
* @param searchString search query string
165+
*/
84166
void doSearch( QString searchString );
85167

86168
QIcon getThemeIcon( const QString theName );

src/app/attributetable/qgsattributetablefiltermodel.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,26 @@
2626
class QgsAttributeTableFilterModel: public QSortFilterProxyModel
2727
{
2828
public:
29+
bool mHideUnselected;
30+
/**
31+
* Constructor
32+
* @param theLayer initializing layer pointer
33+
*/
2934
QgsAttributeTableFilterModel( QgsVectorLayer* theLayer );
35+
/**
36+
* Sorts model by the column
37+
* @param column column to sort by
38+
* @param order sorting order
39+
*/
40+
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
3041
//QModelIndex mapToSource ( const QModelIndex & filterIndex ) const;
3142
//QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
32-
bool mHideUnselected;
33-
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
3443
protected:
44+
/**
45+
* Returns true if the source row will be accepted
46+
* @param sourceRow row from the source model
47+
* @param sourceParent parent index in the source model
48+
*/
3549
bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
3650
private:
3751
QgsVectorLayer* mLayer;

src/app/attributetable/qgsattributetableidcolumnpair.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ class QgsAttributeTableIdColumnPair
2525
int id;
2626
QVariant columnItem;
2727

28+
/**
29+
* Returns true if this id-column pair is less the the tested one
30+
* @param b the tested id-column pair
31+
*/
2832
bool operator<( const QgsAttributeTableIdColumnPair &b ) const;
2933
};
3034

src/app/attributetable/qgsattributetablememorymodel.h

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,70 @@ class QgsAttributeTableMemoryModel: public QgsAttributeTableModel
3232
Q_OBJECT;
3333

3434
public:
35-
QgsAttributeTableMemoryModel( QgsVectorLayer *theLayer );//, QObject *parent = 0);
35+
/**
36+
* Constructor
37+
* @param theLayer layer pointer
38+
*/
39+
QgsAttributeTableMemoryModel( QgsVectorLayer *theLayer );
3640

3741
protected slots:
42+
/**
43+
* Launched when a feature has been deleted
44+
* @param fid feature id
45+
*/
3846
virtual void featureDeleted( int fid );
47+
/**
48+
* Launched when a feature has been deleted
49+
* @param fid feature id
50+
*/
3951
virtual void featureAdded( int fid );
52+
/**
53+
* Launched when layer has been deleted
54+
*/
4055
virtual void layerDeleted();
4156

4257
private slots:
58+
/**
59+
* Launched when attribute has been added
60+
* @param idx attribute index
61+
*/
4362
//virtual void attributeAdded (int idx);
63+
/**
64+
* Launched when attribute has been deleted
65+
* @param idx attribute index
66+
*/
4467
//virtual void attributeDeleted (int idx);
45-
virtual void attributeValueChanged( int fid, int idx, const QVariant &value );
68+
/**
69+
* Launched when layer has been modified
70+
* Rebuilds the model
71+
* @param onlyGeometry true if only geometry has changed
72+
*/
4673
//virtual void layerModified(bool onlyGeometry);
74+
/**
75+
* Launched when attribute value has been changed
76+
* @param fid feature id
77+
* @param idx attribute index
78+
* @param value new value
79+
*/
80+
virtual void attributeValueChanged( int fid, int idx, const QVariant &value );
4781

4882
private:
83+
/**
84+
* Returns data on the given index
85+
* @param index model index
86+
* @param role data role
87+
*/
4988
virtual QVariant data( const QModelIndex &index, int role ) const;
89+
/**
90+
* Updates data on given index
91+
* @param index model index
92+
* @param value new data value
93+
* @param role data role
94+
*/
5095
virtual bool setData( const QModelIndex &index, const QVariant &value, int role );
96+
/**
97+
* Loads the layer into the model
98+
*/
5199
virtual void loadLayer();
52100

53101
QMap<int, QgsFeature> mFeatureMap;

0 commit comments

Comments
 (0)