Skip to content

Commit bbdf7cd

Browse files
committedMay 18, 2014
sync some sip bindings
1 parent b66ee23 commit bbdf7cd

20 files changed

+275
-179
lines changed
 

‎python/core/composer/qgscomposerattributetable.sip

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class QgsComposerAttributeTableCompare
1212
public:
1313
QgsComposerAttributeTableCompare();
1414
// bool operator()( const QgsAttributeMap& m1, const QgsAttributeMap& m2 );
15-
15+
1616
/**Sets column number to sort by
1717
* @param col column number for sorting
1818
*/
@@ -47,7 +47,7 @@ class QgsComposerAttributeTable : QgsComposerTable
4747
* @see readXML
4848
*/
4949
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
50-
50+
5151
/**Reads the properties specific to an attribute table from xml.
5252
* @param itemElem a QDomElement holding the attribute table's desired properties.
5353
* @param doc QDomDocument for the source xml.
@@ -60,13 +60,13 @@ class QgsComposerAttributeTable : QgsComposerTable
6060
* @see vectorLayer
6161
*/
6262
void setVectorLayer( QgsVectorLayer* layer );
63-
63+
6464
/**Returns the vector layer the attribute table is currently using
6565
* @returns attribute table's current vector layer
6666
* @see setVectorLayer
6767
*/
6868
QgsVectorLayer* vectorLayer() const;
69-
69+
7070
/**Resets the attribute table's columns to match the vector layer's fields
7171
* @note added in 2.3
7272
* @see setVectorLayer
@@ -83,13 +83,13 @@ class QgsComposerAttributeTable : QgsComposerTable
8383
* @see setDisplayOnlyVisibleFeatures
8484
*/
8585
void setComposerMap( const QgsComposerMap* map /TransferThis/ );
86-
86+
8787
/**Returns the composer map whose extents are controlling the features shown in the
8888
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
8989
* @returns composer map controlling the attribute table
9090
* @see setComposerMap
9191
* @see displayOnlyVisibleFeatures
92-
*/
92+
*/
9393
const QgsComposerMap* composerMap() const;
9494

9595
/**Sets the maximum number of features shown by the table. Changing this setting may result
@@ -99,11 +99,11 @@ class QgsComposerAttributeTable : QgsComposerTable
9999
* @see maximumNumberOfFeatures
100100
*/
101101
void setMaximumNumberOfFeatures( int features );
102-
102+
103103
/**Returns the maximum number of features to be shown by the table.
104104
* @returns maximum number of features
105105
* @see setMaximumNumberOfFeatures
106-
*/
106+
*/
107107
int maximumNumberOfFeatures() const;
108108

109109
/**Sets attribute table to only show features which are visible in a composer map item. Changing
@@ -114,23 +114,23 @@ class QgsComposerAttributeTable : QgsComposerTable
114114
* @see setComposerMap
115115
*/
116116
void setDisplayOnlyVisibleFeatures( bool b );
117-
117+
118118
/**Returns true if the table is set to show only features visible on a corresponding
119119
* composer map item.
120120
* @returns true if table only shows visible features
121121
* @see composerMap
122122
* @see setDisplayOnlyVisibleFeatures
123-
*/
123+
*/
124124
bool displayOnlyVisibleFeatures() const;
125-
125+
126126
/**Returns true if a feature filter is active on the attribute table
127127
* @returns bool state of the feature filter
128128
* @note added in 2.3
129129
* @see setFilterFeatures
130130
* @see featureFilter
131131
*/
132132
bool filterFeatures() const;
133-
133+
134134
/**Sets whether the feature filter is active for the attribute table. Changing
135135
* this setting forces the table to refetch features from its vector layer, and may result in
136136
* the table changing size to accommodate the new displayed feature attributes.
@@ -149,7 +149,7 @@ class QgsComposerAttributeTable : QgsComposerTable
149149
* @see filterFeatures
150150
*/
151151
QString featureFilter() const;
152-
152+
153153
/**Sets the expression used for filtering features in the table. The filter is only
154154
* active if filterFeatures() is set to true. Changing this setting forces the table
155155
* to refetch features from its vector layer, and may result in
@@ -168,15 +168,15 @@ class QgsComposerAttributeTable : QgsComposerTable
168168
* @deprecated use QgsComposerTable::columns() instead
169169
*/
170170
QSet<int> displayAttributes() const /Deprecated/;
171-
171+
172172
/**Sets the attributes to display in the table.
173173
* @param attr QSet of integer values refering to the attributes from the vector layer to show.
174174
* Set to an empty QSet to show all feature attributes.
175175
* @param refresh set to true to force the table to refetch features from its vector layer
176176
* and immediately update the display of the table. This may result in the table changing size
177177
* to accommodate the new displayed feature attributes.
178178
* @see displayAttributes
179-
*/
179+
*/
180180
void setDisplayAttributes( const QSet<int>& attr );
181181

182182
/**Returns the attribute field aliases, which control how fields are named in the table's
@@ -187,14 +187,14 @@ class QgsComposerAttributeTable : QgsComposerTable
187187
* @deprecated use QgsComposerTable::columns() instead
188188
*/
189189
QMap<int, QString> fieldAliasMap() const /Deprecated/;
190-
190+
191191
/**Sets the attribute field aliases, which control how fields are named in the table's
192192
* header row.
193193
* @param map QMap of integers to strings, where the string is the alias to use for the
194194
* corresponding field, and the integer is the field index from the vector layer
195195
* @see fieldAliasMap
196196
* @deprecated use QgsComposerTable::columns() instead
197-
*/
197+
*/
198198
void setFieldAliasMap( const QMap<int, QString>& map ) /Deprecated/;
199199

200200
/**Adapts mMaximumNumberOfFeatures depending on the rectangle height. Calling this forces
@@ -205,12 +205,34 @@ class QgsComposerAttributeTable : QgsComposerTable
205205
*/
206206
void setSceneRect( const QRectF& rectangle );
207207

208-
// @note not available in python bindings
209-
// void setSortAttributes( const QList<QPair<int, bool> > att );
208+
/**Sets the attributes to use to sort the table's features.
209+
* @param att QList integers/bool pairs, where the integer refers to the attribute index and
210+
* the bool sets the sort order for the attribute. If true the attribute is sorted ascending,
211+
* if false, the attribute is sorted in descending order. Note that features are sorted
212+
* after the maximum number of displayed features have been fetched from the vector layer's
213+
* provider.
214+
* @see sortAttributes
215+
* @deprecated use QgsComposerTable::columns() instead
216+
* @note not available in python bindings
217+
*/
218+
// void setSortAttributes( const QList<QPair<int, bool> > att ) /Deprecated/;
210219

211-
// @note not available in python bindings
220+
/**Returns the attributes used to sort the table's features.
221+
* @returns a QList of integer/bool pairs, where the integer refers to the attribute index and
222+
* the bool to the sort order for the attribute. If true the attribute is sorted ascending,
223+
* if false, the attribute is sorted in descending order.
224+
* @note not available in python bindings
225+
*/
212226
// QList<QPair<int, bool> > sortAttributes() const;
213227

228+
/**Queries the attribute table's vector layer for attributes to show in the table.
229+
* @param attributeMaps list of QgsAttributeMaps where the fetched feature attributes will be stored
230+
* @returns true if attributes were successfully fetched
231+
* @note not available in python bindings
232+
*/
233+
// bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
234+
235+
214236
signals:
215237
/**This signal is emitted if the maximum number of feature changes (interactively)*/
216238
void maximumNumberOfFeaturesChanged( int n );

‎python/core/composer/qgscomposerattributetablemodel.sip

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
55
#include <qgscomposerattributetablemodel.h>
66
%End
77

8-
public:
8+
public:
99

1010
/*! Controls whether a row/column is shifted up or down
1111
*/
@@ -17,6 +17,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
1717

1818
/**Constructor for QgsComposerAttributeTableColumnModel.
1919
* @param composerTable QgsComposerAttributeTable the model is attached to
20+
* @param parent optional parent
2021
*/
2122
QgsComposerAttributeTableColumnModel( QgsComposerAttributeTable *composerTable, QObject *parent = 0 );
2223
virtual ~QgsComposerAttributeTableColumnModel();
@@ -30,6 +31,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
3031
bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
3132
bool insertRows( int row, int count, const QModelIndex &parent = QModelIndex() );
3233
QModelIndex index( int row, int column, const QModelIndex &parent ) const;
34+
QModelIndex parent( const QModelIndex &child ) const;
3335

3436
/**Moves the specified row up or down in the model. Used for rearranging the attribute tables
3537
* columns.
@@ -87,7 +89,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
8789
* @see setColumnAsSorted
8890
*/
8991
bool moveColumnInSortRank( QgsComposerTableColumn * column, ShiftDirection direction );
90-
92+
9193
};
9294

9395
/**Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted*/
@@ -98,7 +100,8 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
98100
%End
99101

100102
public:
101-
/*! Controls whether the proxy model shows sorted or unsorted columns
103+
104+
/*! Controls whether the proxy model shows sorted or unsorted columns
102105
*/
103106
enum ColumnFilterType
104107
{
@@ -109,6 +112,7 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
109112
/**Constructor for QgsComposerTableSortColumnsProxyModel.
110113
* @param composerTable QgsComposerAttributeTable the model is attached to
111114
* @param filterType filter for columns, controls whether sorted or unsorted columns are shown
115+
* @param parent optional parent
112116
*/
113117
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent = 0 );
114118

@@ -142,15 +146,14 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
142146
/**Returns the QgsComposerTableColumn corresponding to an index from the source
143147
* QgsComposerAttributeTableColumnModel model.
144148
* @returns QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
145-
* @param index a QModelIndex
149+
* @param sourceIndex a QModelIndex
146150
* @note added in 2.3
147151
* @see columnFromRow
148152
* @see columnFromIndex
149153
*/
150154
QgsComposerTableColumn* columnFromSourceIndex( const QModelIndex& sourceIndex ) const;
151155

152156
protected:
153-
154157
bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const;
155158

156159
};

‎python/core/composer/qgscomposerpicture.sip

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ class QgsComposerPicture: QgsComposerItem
2020
ZoomResizeFrame, /*!< enlarges image to fit frame, then resizes frame to fit resultant image */
2121
FrameToImageSize /*!< sets size of frame to match original size of image without scaling */
2222
};
23-
23+
2424
/*! Format of source image
2525
*/
2626
enum Mode
2727
{
2828
SVG,
2929
RASTER,
3030
Unknown
31-
};
32-
31+
};
32+
3333
QgsComposerPicture( QgsComposition *composition /TransferThis/);
3434
~QgsComposerPicture();
3535

@@ -46,7 +46,7 @@ class QgsComposerPicture: QgsComposerItem
4646
* @see pictureFile
4747
*/
4848
void setPictureFile( const QString& path );
49-
49+
5050
/**Returns the path of the source image file. This is only used if
5151
* usePictureExpression() is false.
5252
* @returns path to the source image
@@ -84,39 +84,40 @@ class QgsComposerPicture: QgsComposerItem
8484
*/
8585
double pictureRotation() const;
8686

87-
/**Sets the map object for rotation (by id). A value of -1 disables the map rotation.
88-
* If this is set then the picture will be rotated by the same amount as the specified
89-
* map object. This is useful especially for syncing north arrows with a map item.
90-
* @param id composer map id to sync rotation with
87+
/**Sets the map object for rotation (by id). A value of -1 disables the map
88+
* rotation. If this is set then the picture will be rotated by the same
89+
* amount as the specified map object. This is useful especially for
90+
* syncing north arrows with a map item.
91+
* @param composerMapId composer map id to sync rotation with
9192
* @see setPictureRotation
9293
* @see rotationMap
93-
*/
94+
*/
9495
void setRotationMap( int composerMapId );
95-
96-
/**Returns the id of the rotation map. A value of -1 means map rotation is disabled.
97-
* If this is set then the picture is rotated by the same amount as the specified
98-
* map object.
96+
97+
/**Returns the id of the rotation map. A value of -1 means map rotation is
98+
* disabled. If this is set then the picture is rotated by the same amount
99+
* as the specified map object.
99100
* @returns id of map object
100101
* @see setRotationMap
101102
* @see useRotationMap
102-
*/
103+
*/
103104
int rotationMap() const;
104-
105+
105106
/**True if the picture rotation is matched to a map item.
106107
* @returns true if rotation map is in use
107108
* @see rotationMap
108109
* @see setRotationMap
109110
*/
110111
bool useRotationMap() const;
111-
112-
/**Returns the resize mode used for drawing the picture within the composer item's
113-
* frame.
112+
113+
/**Returns the resize mode used for drawing the picture within the composer
114+
* item's frame.
114115
* @returns resize mode of picture
115116
* @note added in 2.3
116117
* @see setResizeMode
117-
*/
118+
*/
118119
ResizeMode resizeMode() const;
119-
120+
120121
/**Sets the picture's anchor point, which controls how it is placed
121122
* within the picture item's frame.
122123
* @param anchor anchor point for picture
@@ -131,8 +132,8 @@ class QgsComposerPicture: QgsComposerItem
131132
* @note added in 2.3
132133
* @see setPictureAnchor
133134
*/
134-
ItemPositionMode pictureAnchor() const;
135-
135+
ItemPositionMode pictureAnchor() const;
136+
136137
/**Returns whether the picture item is using an expression for the image source.
137138
* @returns true if the picture is using an expression for the source, false if
138139
* it is using a single static file path for the source.
@@ -142,15 +143,15 @@ class QgsComposerPicture: QgsComposerItem
142143
* @see pictureExpression
143144
*/
144145
bool usePictureExpression() const;
145-
146+
146147
/**Returns the expression the item is using for the picture source. This is only
147148
* used if usePictureExpression() is true.
148149
* @returns expression for the picture item's image path
149150
* @note added in 2.3
150151
* @see setPictureExpression
151152
* @see usePictureExpression
152153
*/
153-
QString pictureExpression() const;
154+
QString pictureExpression() const;
154155

155156
/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation
156157
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
@@ -163,37 +164,37 @@ class QgsComposerPicture: QgsComposerItem
163164
*/
164165
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
165166
/**Calculates width / height of the bounding box of a rotated rectangle
166-
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
167-
* instead
168-
*/
167+
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
168+
* instead
169+
*/
169170
void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
170-
171+
171172
/**Returns the current picture mode (image format).
172173
* @returns picture mode
173174
* @note added in 2.3
174-
*/
175-
Mode mode() const;
175+
*/
176+
Mode mode() const;
176177

177178
public slots:
178-
/**Sets the picture rotation within the item bounds. This does not affect the item rectangle,
179-
only the way the picture is drawn within the item.
179+
/**Sets the picture rotation within the item bounds. This does not affect
180+
* the item rectangle, only the way the picture is drawn within the item.
180181
* @deprecated Use setPictureRotation( double rotation ) instead
181182
*/
182183
virtual void setRotation( double r ) /Deprecated/;
183184

184-
/**Sets the picture rotation within the item bounds. This does not affect the item's frame,
185-
* only the way the picture is drawn within the item.
185+
/**Sets the picture rotation within the item bounds. This does not affect
186+
* the item's frame, only the way the picture is drawn within the item.
186187
* @param r rotation in degrees clockwise
187188
* @see pictureRotation
188189
* @note added in 2.2
189-
*/
190+
*/
190191
virtual void setPictureRotation( double r );
191-
192+
192193
/**Sets the resize mode used for drawing the picture within the item bounds.
193194
* @param mode ResizeMode to use for image file
194195
* @note added in 2.3
195196
* @see resizeMode
196-
*/
197+
*/
197198
virtual void setResizeMode( ResizeMode mode );
198199

199200
/**Sets whether the picture should use an expression based image source path
@@ -203,7 +204,7 @@ class QgsComposerPicture: QgsComposerItem
203204
* @see usePictureExpression
204205
* @see setPictureFile
205206
* @see setPictureExpression
206-
*/
207+
*/
207208
virtual void setUsePictureExpression( bool useExpression );
208209

209210
/**Sets an expression to use for the picture source. This expression is only
@@ -212,25 +213,25 @@ class QgsComposerPicture: QgsComposerItem
212213
* @note added in 2.3
213214
* @see setUsePictureExpression
214215
* @see pictureExpression
215-
*/
216+
*/
216217
virtual void setPictureExpression( QString expression );
217218

218219
/**Recalculates the source image (if using an expression for picture's source)
219220
* and reloads and redraws the picture.
220221
* @note added in 2.3
221-
*/
222+
*/
222223
void refreshPicture();
223224

224225
/**Prepares the picture's source expression after it is altered or the compositions
225226
* atlas coverage layer changes.
226227
* @note added in 2.3
227-
*/
228+
*/
228229
void updatePictureExpression();
229230

230231
/**Forces a recalculation of the picture's frame size
231232
* @note added in 2.3
232-
*/
233-
void recalculateSize();
233+
*/
234+
void recalculateSize();
234235

235236
signals:
236237
/**Is emitted on picture rotation change*/

‎python/core/composer/qgscomposertable.sip

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class QgsComposerTable: QgsComposerItem
66
%End
77

88
public:
9-
9+
1010
/*! Controls how headers are horizontally aligned in a table
1111
*/
1212
enum HeaderHAlignment
@@ -16,7 +16,7 @@ class QgsComposerTable: QgsComposerItem
1616
HeaderCenter, /*!< align headers to center */
1717
HeaderRight /*!< align headers right */
1818
};
19-
19+
2020
QgsComposerTable( QgsComposition* composition /TransferThis/ );
2121
virtual ~QgsComposerTable();
2222

@@ -34,7 +34,7 @@ class QgsComposerTable: QgsComposerItem
3434
* @see lineTextDistance
3535
*/
3636
void setLineTextDistance( double d );
37-
37+
3838
/**Returns the margin distance between cell borders and their contents.
3939
* @returns margin for cell contents
4040
* @see setLineTextDistance
@@ -47,14 +47,14 @@ class QgsComposerTable: QgsComposerItem
4747
* @see setContentFont
4848
*/
4949
void setHeaderFont( const QFont& f );
50-
50+
5151
/**Returns the font used to draw header text in the table.
5252
* @returns font for header cells
5353
* @see setHeaderFont
5454
* @see contentFont
5555
*/
5656
QFont headerFont() const;
57-
57+
5858
/**Sets the horizontal alignment for table headers
5959
* @param alignment Horizontal alignment for table header cells
6060
* @note added in 2.3
@@ -75,7 +75,7 @@ class QgsComposerTable: QgsComposerItem
7575
* @see setHeaderFont
7676
*/
7777
void setContentFont( const QFont& f );
78-
78+
7979
/**Returns the font used to draw text in table body cells.
8080
* @returns font for table cells
8181
* @see setContentFont
@@ -90,7 +90,7 @@ class QgsComposerTable: QgsComposerItem
9090
* @see setGridColor
9191
*/
9292
void setShowGrid( bool show );
93-
93+
9494
/**Returns whether grid lines are drawn in the table
9595
* @returns true if grid lines are shown
9696
* @see setShowGrid
@@ -106,7 +106,7 @@ class QgsComposerTable: QgsComposerItem
106106
* @see setGridColor
107107
*/
108108
void setGridStrokeWidth( double w );
109-
109+
110110
/**Returns the width of grid lines in the table.
111111
* @returns grid line width
112112
* @see setGridStrokeWidth
@@ -122,29 +122,47 @@ class QgsComposerTable: QgsComposerItem
122122
* @see setGridStrokeWidth
123123
*/
124124
void setGridColor( const QColor& c );
125-
125+
126126
/**Returns the color used for grid lines in the table.
127127
* @returns grid line color
128128
* @see setGridColor
129129
* @see showGrid
130130
* @see gridStrokeWidth
131131
*/
132132
QColor gridColor() const;
133-
133+
134+
/**Returns the text used in the column headers for the table.
135+
* @returns QMap of int to QString, where the int is the column index (starting at 0),
136+
* and the string is the text to use for the column's header
137+
* @note added in 2.3
138+
* @note not available in python bindings
139+
*/
140+
// virtual QMap<int, QString> headerLabels() const;
141+
142+
//TODO - make this more generic for next API break, eg rename as getRowValues, use QStringList rather than
143+
//QgsAttributeMap
144+
145+
/**Fetches the text used for the rows of the table.
146+
* @returns true if attribute text was successfully retrieved.
147+
* @param attributeMaps QList of QgsAttributeMap to store retrieved row data in
148+
* @note not available in python bindings
149+
*/
150+
// virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED( attributeMaps ); return false; }
151+
134152
/**Returns a pointer to the list of QgsComposerTableColumns shown in the table
135153
* @returns pointer to list of columns in table
136154
* @note added in 2.3
137155
* @see setColumns
138156
*/
139157
QList<QgsComposerTableColumn*>* columns();
140-
158+
141159
/**Replaces the columns in the table with a specified list of QgsComposerTableColumns.
142160
* @param columns list of QgsComposerTableColumns to show in table
143161
* @note added in 2.3
144162
* @see columns
145163
*/
146164
void setColumns( QList<QgsComposerTableColumn*> columns );
147-
165+
148166
public slots:
149167

150168
/**Refreshes the attributes shown in the table by querying the vector layer for new data.
@@ -162,24 +180,44 @@ class QgsComposerTable: QgsComposerItem
162180
* @note added in 2.3
163181
* @see refreshAttributes
164182
*/
165-
virtual void adjustFrameToSize();
183+
virtual void adjustFrameToSize();
166184

167185
protected:
168186
/**Retrieves feature attributes*/
169187
// virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
188+
/**Calculates the maximum width of text shown in columns.
189+
* @param maxWidthMap QMap of int to double in which to store the maximum widths. The int will be filled
190+
* with the column number and the double with the maximum width of text present in the column.
191+
* @param attributeMaps list of attribute values for each row shown in the table
192+
* @note not available in python bindings
193+
* @see adaptItemFrame
194+
*/
195+
// virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps ) const;
196+
197+
/**Adapts the size of the item frame to match the table's content.
198+
* @param maxWidthMap QMap of int to double, where the int contains the column number and the double is the
199+
* maximum width of text present in the column.
200+
* @param attributeMaps list of attribute values for each row shown in the table
201+
* @note not available in python bindings
202+
* @see calculateMaxColumnWidths
203+
*/
204+
// void adaptItemFrame( const QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps );
170205

171-
/**Calculate the maximum width values of the vector attributes*/
172-
// virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap, const QList< QMap<int, QVariant> >& attributeMaps ) const;
173-
/**Adapts the size of the item frame to match the content*/
174-
// void adaptItemFrame( const QMap<int, double>& maxWidthMap, const QList< QMap<int, QVariant> >& attributeMaps );
175-
176206
/**Draws the horizontal grid lines for the table.
177207
* @param p destination painter for grid lines
178208
* @param nAttributes number of attribute rows shown in table
179209
* @see drawVerticalGridLines
180-
*/
210+
*/
181211
void drawHorizontalGridLines( QPainter* p, int nAttributes );
182-
212+
213+
/**Draws the vertical grid lines for the table.
214+
* @param p destination painter for grid lines
215+
* @param maxWidthMap QMap of int to double, where the int contains the column number and the double is the
216+
* maximum width of text present in the column.
217+
* @note not available in python bindings
218+
* @see drawVerticalGridLines
219+
* @see calculateMaxColumnWidths
220+
*/
183221
// void drawVerticalGridLines( QPainter* p, const QMap<int, double>& maxWidthMap );
184222

185223
/**Writes common table properties to xml for storage.
@@ -189,7 +227,7 @@ class QgsComposerTable: QgsComposerItem
189227
* @see writeXML
190228
*/
191229
bool tableWriteXML( QDomElement& itemElem, QDomDocument& doc ) const;
192-
230+
193231
/**Reads the table's common properties from xml.
194232
* @param itemElem a QDomElement holding the table's desired properties.
195233
* @param doc QDomDocument for the source xml.

‎python/core/composer/qgscomposertablecolumn.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class QgsComposerTableColumn: QObject
77
#include <qgscomposertablecolumn.h>
88
%End
99
public:
10-
10+
1111
QgsComposerTableColumn();
1212
virtual ~QgsComposerTableColumn();
1313

‎python/core/composer/qgscomposertexttable.sip

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ class QgsComposerTextTable: QgsComposerTable
1010

1111
/** return correct graphics item type. Added in v1.7 */
1212
virtual int type() const;
13-
13+
1414
/**Sets the text to use for the header row for the table
1515
* @param labels list of strings to use for each column's header row
1616
* @see headerLabels
1717
*/
1818
void setHeaderLabels( const QStringList& labels );
19-
19+
2020
/**Adds a row to the table
2121
* @param row list of strings to use for each cell's value in the newly added row
2222
* @note If row is shorter than the number of columns in the table than blank cells
2323
* will be inserted at the end of the row. If row contains more strings then the number
2424
* of columns in the table then these extra strings will be ignored.
25-
*/
25+
*/
2626
void addRow( const QStringList& row );
2727

2828
/**Writes properties specific to text tables
@@ -31,12 +31,18 @@ class QgsComposerTextTable: QgsComposerTable
3131
* @see readXML
3232
*/
3333
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
34-
34+
3535
/**Reads the properties specific to a text table from xml.
3636
* @param itemElem a QDomElement holding the text table's desired properties.
3737
* @param doc QDomDocument for the source xml.
3838
* @see writeXML
3939
*/
4040
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
4141

42+
/**Queries the text table for text to show in the cells.
43+
* @param attributeMaps list of QgsAttributeMaps where the cell text will be stored
44+
* @returns true if attribute values were successfully set from table's text
45+
* @note not available in python bindings
46+
*/
47+
// bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
4248
};

‎python/core/qgsmaplayer.sip

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class QgsMapLayer : QObject
204204
*/
205205
bool writeLayerXML( QDomElement& layerElement, QDomDocument& document );
206206

207-
/** Returns the layer as a layer definition document
207+
/** Returns the given layer as a layer definition document
208208
Layer definitions store the data source as well as styling and custom properties.
209209

210210
Layer definitions can be used to load a layer and styling all from a single file.
@@ -353,6 +353,12 @@ class QgsMapLayer : QObject
353353
/** Return pointer to layer's undo stack */
354354
QUndoStack *undoStack();
355355

356+
/* Layer legendUrl information */
357+
void setLegendUrl( const QString& legendUrl );
358+
const QString& legendUrl() const;
359+
void setLegendUrlFormat( const QString& legendUrlFormat );
360+
const QString& legendUrlFormat() const;
361+
356362
/** @deprecated since 2.4 - returns NULL */
357363
QImage *cacheImage() /Deprecated/;
358364
/** @deprecated since 2.4 - caches listen to repaintRequested() signal to invalidate the cached image */
@@ -403,8 +409,8 @@ class QgsMapLayer : QObject
403409
*/
404410
void layerCrsChanged();
405411

406-
/** This signal should be connected with the slot QgsMapCanvas::refresh()
407-
* \todo to be removed - GUI dependency
412+
/** By emitting this signal the layer tells that either appearance or content have been changed
413+
* and any view showing the rendered layer should refresh itself.
408414
*/
409415
void repaintRequested();
410416

@@ -419,7 +425,7 @@ class QgsMapLayer : QObject
419425
void dataChanged();
420426

421427
/** Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode() */
422-
void blendModeChanged( const QPainter::CompositionMode blendMode );
428+
void blendModeChanged( const QPainter::CompositionMode &blendMode );
423429

424430
protected:
425431
/** Set the extent */

‎python/core/raster/qgsrasterdataprovider.sip

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* QgsVectorDataProvider, and does not yet make
66
* sense for Raster layers.
77
*/
8-
98
class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
109
{
1110
%TypeHeaderCode
@@ -15,7 +14,6 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
1514
%End
1615

1716
public:
18-
1917
QgsRasterDataProvider();
2018

2119
QgsRasterDataProvider( const QString & uri );
@@ -27,39 +25,37 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
2725
/* It makes no sense to set input on provider */
2826
bool setInput( QgsRasterInterface* input );
2927

30-
// TODO: Document this better.
3128
/** \brief Renders the layer as an image
32-
*/
29+
\note When render caching (/qgis/enable_render_caching) is on the wms
30+
provider doesn't wait for the reply of the getmap request or all
31+
tiles replies and can return incomplete images.
32+
Temporarily disable render caching if you require the complete
33+
wms image in the first call.
34+
*/
3335
virtual QImage* draw( const QgsRectangle & viewExtent, int pixelWidth, int pixelHeight ) = 0;
3436

35-
// TODO: Get the supported formats by this provider
36-
37-
// TODO: Get the file masks supported by this provider, suitable for feeding into the file open dialog box
38-
37+
/** Get the extent of the data source.
38+
* @return QgsRectangle containing the extent of the layer */
3939
virtual QgsRectangle extent() = 0;
4040

4141
/** Returns data type for the band specified by number */
4242
virtual QGis::DataType dataType( int bandNo ) const = 0;
4343

4444
/** Returns source data type for the band specified by number,
45-
* source data type may be shorter than dataType
46-
*/
45+
* source data type may be shorter than dataType */
4746
virtual QGis::DataType srcDataType( int bandNo ) const = 0;
4847

4948
/** Returns data type for the band specified by number */
5049
virtual int colorInterpretation( int theBandNo ) const;
5150

5251
QString colorName( int colorInterpretation ) const;
53-
54-
/** Reload data (data could change) */
5552
virtual bool reload();
5653

5754
virtual QString colorInterpretationName( int theBandNo ) const;
5855

5956
/** Read band scale for raster value
6057
* @@note added in 2.3 */
6158
virtual double bandScale( int bandNo ) const;
62-
6359
/** Read band offset for raster value
6460
* @@note added in 2.3 */
6561
virtual double bandOffset( int bandNo ) const;
@@ -94,10 +90,14 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
9490

9591
virtual QList<QgsColorRampShader::ColorRampItem> colorTable( int bandNo ) const;
9692

97-
// Defined in parent
98-
/** \brief Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS */
93+
/** \brief Returns the sublayers of this layer - useful for providers that manage
94+
* their own layers, such as WMS */
9995
virtual QStringList subLayers() const;
10096

97+
/** \brief Returns the legend rendered as pixmap
98+
* useful for that layer that need to get legend layer remotly as WMS */
99+
virtual QImage getLegendGraphic( double scale = 0, bool forceRefresh = false );
100+
101101
/** \brief Create pyramid overviews */
102102
virtual QString buildPyramids( const QList<QgsRasterPyramid> & thePyramidList,
103103
const QString & theResamplingMethod = "NEAREST",
@@ -122,10 +122,31 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
122122
*/
123123
virtual QString metadata() = 0;
124124

125+
/** \brief Identify raster value(s) found on the point position. The context
126+
* parameters theExtent, theWidth and theHeight are important to identify
127+
* on the same zoom level as a displayed map and to do effective
128+
* caching (WCS). If context params are not specified the highest
129+
* resolution is used. capabilities() may be used to test if format
130+
* is supported by provider. Values are set to 'no data' or empty string
131+
* if point is outside data source extent.
132+
*
133+
* \note The arbitraryness of the returned document is enforced by WMS standards
134+
* up to at least v1.3.0
135+
* @param thePoint coordinates in data source CRS
136+
* @param theFormat result format
137+
* @param theExtent context extent
138+
* @param theWidth context width
139+
* @param theHeight context height
140+
* @return QgsRaster::IdentifyFormatValue: map of values for each band, keys are band numbers
141+
* (from 1).
142+
* QgsRaster::IdentifyFormatFeature: map of QgsRasterFeatureList for each sublayer
143+
* (WMS) - TODO: it is not consistent with QgsRaster::IdentifyFormatValue.
144+
* QgsRaster::IdentifyFormatHtml: map of HTML strings for each sublayer (WMS).
145+
* Empty if failed or there are no results (TODO: better error reporting).
146+
*/
147+
//virtual QMap<int, QVariant> identify( const QgsPoint & thePoint, QgsRaster::IdentifyFormat theFormat, const QgsRectangle &theExtent = QgsRectangle(), int theWidth = 0, int theHeight = 0 );
125148
virtual QgsRasterIdentifyResult identify( const QgsPoint & thePoint, QgsRaster::IdentifyFormat theFormat, const QgsRectangle &theExtent = QgsRectangle(), int theWidth = 0, int theHeight = 0 );
126149

127-
//QMap<QString, QString> identify( const QgsPoint & thePoint, const QgsRectangle &theExtent = QgsRectangle(), int theWidth = 0, int theHeight = 0 );
128-
129150
/**
130151
* \brief Returns the caption error text for the last error in this provider
131152
*
@@ -173,15 +194,14 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
173194
// TODO: add data type (may be defferent from band type)
174195
virtual bool write( void* data, int band, int width, int height, int xOffset, int yOffset );
175196

176-
/** Creates a new dataset with mDataSourceURI
177-
@return true in case of success*/
197+
/** Creates a new dataset with mDataSourceURI */
178198
static QgsRasterDataProvider* create( const QString &providerKey,
179-
const QString &uri,
180-
const QString& format, int nBands,
181-
QGis::DataType type,
182-
int width, int height, double* geoTransform,
183-
const QgsCoordinateReferenceSystem& crs,
184-
QStringList createOptions = QStringList() /*e.v. color table*/ );
199+
const QString &uri,
200+
const QString& format, int nBands,
201+
QGis::DataType type,
202+
int width, int height, double* geoTransform,
203+
const QgsCoordinateReferenceSystem& crs,
204+
QStringList createOptions = QStringList() );
185205

186206
/** Set no data value on created dataset
187207
* @param bandNo band number
@@ -192,20 +212,26 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
192212
/** Remove dataset*/
193213
virtual bool remove();
194214

195-
/** Returns a list of pyramid resampling method names for given provider */
196-
static QList<QPair<QString,QString> > pyramidResamplingMethods( QString providerKey );
215+
/** Returns a list of pyramid resampling method name and label pairs
216+
* for given provider */
217+
static QList<QPair<QString, QString> > pyramidResamplingMethods( QString providerKey );
197218

198219
/** Validates creation options for a specific dataset and destination format.
199220
* @note used by GDAL provider only
200221
* @note see also validateCreationOptionsFormat() in gdal provider for validating options based on format only */
201-
virtual QString validateCreationOptions( const QStringList& createOptions, QString format );
222+
virtual QString validateCreationOptions( const QStringList& createOptions, QString format );
202223

203224
/** Validates pyramid creation options for a specific dataset and destination format
204225
* @note used by GDAL provider only */
205226
virtual QString validatePyramidsConfigOptions( QgsRaster::RasterPyramidsFormat pyramidsFormat,
206227
const QStringList & theConfigOptions, const QString & fileFormat );
207228

208-
signals:
229+
static QString identifyFormatName( QgsRaster::IdentifyFormat format );
230+
static QgsRaster::IdentifyFormat identifyFormatFromName( QString formatName );
231+
static QString identifyFormatLabel( QgsRaster::IdentifyFormat format );
232+
static Capability identifyFormatToCapability( QgsRaster::IdentifyFormat format );
233+
234+
signals:
209235
/** Emit a signal to notify of the progress event.
210236
* Emitted theProgress is in percents (0.0-100.0) */
211237
void progress( int theType, double theProgress, QString theMessage );

‎python/gui/gui.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
%Include qgsoptionsdialogbase.sip
9191
%Include qgssvgannotationitem.sip
9292
%Include qgsextentgroupbox.sip
93+
%Include qgsprevieweffect.sip
9394

9495
%Include attributetable/qgsattributetabledelegate.sip
9596
%Include attributetable/qgsattributetablefiltermodel.sip

‎python/gui/qgsfieldexpressionwidget.sip

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ class QgsFieldExpressionWidget : QWidget
1313

1414
//! define the title used in the expression dialog
1515
void setExpressionDialogTitle( QString title );
16-
16+
17+
//! return the title used for the expression dialog
18+
const QString expressionDialogTitle();
19+
1720
//! setFilters allows fitering according to the type of field
1821
void setFilters( QgsFieldProxyModel::Filters filters );
1922

2023
//! currently used filter on list of fields
2124
QgsFieldProxyModel::Filters filters();
2225

23-
//! return the title used for the expression dialog
24-
const QString expressionDialogTitle();
25-
2626
//! set the geometry calculator used in the expression dialog
2727
void setGeomCalculator( const QgsDistanceArea &da );
28-
28+
2929
/**
3030
* @brief currentField returns the currently selected field or expression if allowed
3131
* @param isExpression determines if the string returned is the name of a field or an expression
@@ -35,7 +35,7 @@ class QgsFieldExpressionWidget : QWidget
3535

3636
//! Returns the currently used layer
3737
QgsVectorLayer* layer();
38-
38+
3939
signals:
4040
//! the signal is emitted when the currently selected field changes
4141
void fieldChanged( QString fieldName );
@@ -51,5 +51,5 @@ class QgsFieldExpressionWidget : QWidget
5151
void setLayer( QgsMapLayer* layer );
5252

5353
//! sets the current field or expression in the widget
54-
void setField( QString fieldName );
54+
void setField( const QString &fieldName );
5555
};

‎python/gui/qgsfieldmodel.sip

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class QgsFieldModel : QAbstractItemModel
1212
%End
1313

1414
public:
15-
enum FieldRoles {
16-
/* SIP does not accept any arithmetic" */
17-
FieldNameRole = 33, /* return field name if index corresponds to a field */
18-
FieldIndexRole = 34, /* return field index if index corresponds to a field */
19-
ExpressionRole = 35, /* return field name or expression */
20-
IsExpressionRole = 36, /* return if index corresponds to an expression */
21-
ExpressionValidityRole = 37, /* return if expression is valid or not */
22-
FieldTypeRole = 38 /* return the field type (if a field, return QVariant if expression) */
15+
enum FieldRoles
16+
{
17+
FieldNameRole, /* return field name if index corresponds to a field */
18+
FieldIndexRole, /* return field index if index corresponds to a field */
19+
ExpressionRole, /* return field name or expression */
20+
IsExpressionRole, /* return if index corresponds to an expression */
21+
ExpressionValidityRole, /* return if expression is valid or not */
22+
FieldTypeRole /* return the field type (if a field, return QVariant if expression) */
2323
};
2424

2525
/**
@@ -28,7 +28,7 @@ class QgsFieldModel : QAbstractItemModel
2828
explicit QgsFieldModel( QObject *parent /TransferThis/ = 0 );
2929

3030
//! return the index corresponding to a given fieldName
31-
QModelIndex indexFromName( QString fieldName );
31+
QModelIndex indexFromName( const QString &fieldName );
3232

3333
//! returns the currently used layer
3434
void setAllowExpression( bool allowExpression );
@@ -38,7 +38,7 @@ class QgsFieldModel : QAbstractItemModel
3838
* @brief setExpression sets a single expression to be added after the fields at the end of the model
3939
* @return the model index of the newly added expression
4040
*/
41-
QModelIndex setExpression( QString expression );
41+
QModelIndex setExpression( const QString &expression );
4242

4343
//! remove expressions from the model
4444
void removeExpression();
@@ -60,5 +60,4 @@ class QgsFieldModel : QAbstractItemModel
6060
int rowCount( const QModelIndex &parent = QModelIndex() ) const;
6161
int columnCount( const QModelIndex &parent ) const;
6262
QVariant data( const QModelIndex &index, int role ) const;
63-
6463
};

‎python/gui/qgsfieldproxymodel.sip

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ class QgsFieldProxyModel : QSortFilterProxyModel
1212
public:
1313
enum Filter
1414
{
15-
String = 1,
16-
Int = 2,
17-
LongLong = 4,
18-
Double = 8,
19-
Numeric = 14,
20-
Date = 16,
21-
All = 31
15+
String,
16+
Int,
17+
LongLong,
18+
Double,
19+
Numeric,
20+
Date,
21+
All
2222
};
2323
typedef QFlags<QgsFieldProxyModel::Filter> Filters;
2424

@@ -37,7 +37,7 @@ class QgsFieldProxyModel : QSortFilterProxyModel
3737
* @note added in 2.3
3838
*/
3939
QgsFieldProxyModel* setFilters( Filters filters );
40-
const Filters& filters() const ;
40+
const Filters& filters() const;
4141

4242
// QSortFilterProxyModel interface
4343
public:

‎python/gui/qgsgraphicseffect.sip renamed to ‎python/gui/qgsprevieweffect.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
* A graphics effect which can be applied to a widget to simulate various printing and
33
* color blindness modes.
44
*/
5+
56
class QgsPreviewEffect : QGraphicsEffect
67
{
78
%TypeHeaderCode
8-
#include "qgsgraphicseffect.h"
9+
#include "qgsprevieweffect.h"
910
%End
1011

1112
public:
@@ -26,7 +27,6 @@ class QgsPreviewEffect : QGraphicsEffect
2627
* @see mode
2728
*/
2829
void setMode( PreviewMode mode );
29-
3030
/**Returns the mode used for the preview effect.
3131
* @returns PreviewMode currently used by the effect
3232
* @note added in 2.3

‎scripts/sipdiff

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22

33
for file in $*; do
4-
file=$1
5-
64
d=${file#*/}
75
d=${d%/*}
86
f=${file##*/}

‎src/core/composer/qgscomposertable.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
162162
* and the string is the text to use for the column's header
163163
* @note added in 2.3
164164
* @note not available in python bindings
165-
*/
165+
*/
166166
virtual QMap<int, QString> headerLabels() const;
167167

168168
//TODO - make this more generic for next API break, eg rename as getRowValues, use QStringList rather than
@@ -172,7 +172,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
172172
* @returns true if attribute text was successfully retrieved.
173173
* @param attributeMaps QList of QgsAttributeMap to store retrieved row data in
174174
* @note not available in python bindings
175-
*/
175+
*/
176176
virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps ) { Q_UNUSED( attributeMaps ); return false; }
177177

178178
/**Returns a pointer to the list of QgsComposerTableColumns shown in the table
@@ -232,7 +232,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
232232
* @param attributeMaps list of attribute values for each row shown in the table
233233
* @note not available in python bindings
234234
* @see adaptItemFrame
235-
*/
235+
*/
236236
virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps ) const;
237237

238238
/**Adapts the size of the item frame to match the table's content.
@@ -241,14 +241,14 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
241241
* @param attributeMaps list of attribute values for each row shown in the table
242242
* @note not available in python bindings
243243
* @see calculateMaxColumnWidths
244-
*/
244+
*/
245245
void adaptItemFrame( const QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeMaps );
246246

247247
/**Draws the horizontal grid lines for the table.
248248
* @param p destination painter for grid lines
249249
* @param nAttributes number of attribute rows shown in table
250250
* @see drawVerticalGridLines
251-
*/
251+
*/
252252
void drawHorizontalGridLines( QPainter* p, int nAttributes );
253253

254254
/**Draws the vertical grid lines for the table.
@@ -258,7 +258,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
258258
* @note not available in python bindings
259259
* @see drawVerticalGridLines
260260
* @see calculateMaxColumnWidths
261-
*/
261+
*/
262262
void drawVerticalGridLines( QPainter* p, const QMap<int, double>& maxWidthMap );
263263

264264
/**Writes common table properties to xml for storage.

‎src/core/raster/qgsrasterdataprovider.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
240240
virtual QString metadata() = 0;
241241

242242
/** \brief Identify raster value(s) found on the point position. The context
243-
* parameters theExtent, theWidth and theHeigh are important to identify
243+
* parameters theExtent, theWidth and theHeight are important to identify
244244
* on the same zoom level as a displayed map and to do effective
245245
* caching (WCS). If context params are not specified the highest
246246
* resolution is used. capabilities() may be used to test if format
@@ -295,11 +295,11 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
295295

296296
/**Returns the dpi of the output device.
297297
@note: this method was added in version 1.2*/
298-
int dpi() const {return mDpi;}
298+
int dpi() const { return mDpi; }
299299

300300
/**Sets the output device resolution.
301301
@note: this method was added in version 1.2*/
302-
void setDpi( int dpi ) {mDpi = dpi;}
302+
void setDpi( int dpi ) { mDpi = dpi; }
303303

304304
/** Time stamp of data source in the moment when data/metadata were loaded by provider */
305305
virtual QDateTime timestamp() const { return mTimestamp; }
@@ -335,10 +335,6 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
335335
*/
336336
virtual bool setNoDataValue( int bandNo, double noDataValue ) { Q_UNUSED( bandNo ); Q_UNUSED( noDataValue ); return false; }
337337

338-
/** Returns the formats supported by create() */
339-
// TODO: this should be static and call C functions in provider library
340-
//static QStringList createFormats();
341-
342338
/** Remove dataset*/
343339
virtual bool remove() { return false; }
344340

‎src/gui/qgsfieldexpressionwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void QgsFieldExpressionWidget::setLayer( QgsVectorLayer *layer )
116116
mFieldProxyModel->sourceFieldModel()->setLayer( layer );
117117
}
118118

119-
void QgsFieldExpressionWidget::setField( const QString fieldName )
119+
void QgsFieldExpressionWidget::setField( const QString &fieldName )
120120
{
121121
if ( fieldName.isEmpty() )
122122
return;

‎src/gui/qgsfieldexpressionwidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
8989
void setLayer( QgsMapLayer* layer );
9090

9191
//! sets the current field or expression in the widget
92-
void setField( const QString fieldName );
92+
void setField( const QString &fieldName );
9393

9494
protected slots:
9595
//! open the expression dialog to edit the current or add a new expression

‎src/gui/qgsfieldmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ QgsFieldModel::QgsFieldModel( QObject *parent )
2828
{
2929
}
3030

31-
QModelIndex QgsFieldModel::indexFromName( const QString fieldName )
31+
QModelIndex QgsFieldModel::indexFromName( const QString &fieldName )
3232
{
3333
int r = mFields.indexFromName( fieldName );
3434
QModelIndex idx = index( r, 0 );
@@ -104,7 +104,7 @@ void QgsFieldModel::setAllowExpression( bool allowExpression )
104104
}
105105
}
106106

107-
QModelIndex QgsFieldModel::setExpression( const QString expression )
107+
QModelIndex QgsFieldModel::setExpression( const QString &expression )
108108
{
109109
if ( !mAllowExpression )
110110
return QModelIndex();

‎src/gui/qgsfieldmodel.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GUI_EXPORT QgsFieldModel : public QAbstractItemModel
3232
{
3333
Q_OBJECT
3434
public:
35-
enum FieldRoles
35+
enum FieldRoles
3636
{
3737
FieldNameRole = Qt::UserRole + 1, /* return field name if index corresponds to a field */
3838
FieldIndexRole = Qt::UserRole + 2, /* return field index if index corresponds to a field */
@@ -48,23 +48,23 @@ class GUI_EXPORT QgsFieldModel : public QAbstractItemModel
4848
explicit QgsFieldModel( QObject *parent = 0 );
4949

5050
//! return the index corresponding to a given fieldName
51-
QModelIndex indexFromName( const QString fieldName );
51+
QModelIndex indexFromName( const QString &fieldName );
5252

5353
//! returns the currently used layer
5454
void setAllowExpression( bool allowExpression );
55-
bool allowExpression() {return mAllowExpression;}
55+
bool allowExpression() { return mAllowExpression; }
5656

5757
/**
5858
* @brief setExpression sets a single expression to be added after the fields at the end of the model
5959
* @return the model index of the newly added expression
6060
*/
61-
QModelIndex setExpression( const QString expression );
61+
QModelIndex setExpression( const QString &expression );
6262

6363
//! remove expressions from the model
6464
void removeExpression();
6565

6666
//! returns the currently used layer
67-
QgsVectorLayer* layer() {return mLayer;}
67+
QgsVectorLayer* layer() { return mLayer; }
6868

6969
public slots:
7070
//! set the layer of whch fields are displayed

0 commit comments

Comments
 (0)
Please sign in to comment.