Skip to content

Commit 7e977bc

Browse files
committedApr 28, 2014
[composer] Some api documentation improvements and fix ups
1 parent 9f84e9f commit 7e977bc

18 files changed

+238
-98
lines changed
 

‎python/core/composer/qgsatlascomposition.sip

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
* Class used to render an Atlas, iterating over geometry features.
33
* prepareForFeature() modifies the atlas map's extent to zoom on the given feature.
44
* This class is used for printing, exporting to PDF and images.
5-
* */
5+
* @note This class should not be created directly. For the atlas to function correctly
6+
* the atlasComposition() property for QgsComposition should be used to retrieve a
7+
* QgsAtlasComposition which is automatically created and attached to the composition.
8+
*/
69
class QgsAtlasComposition : QObject
710
{
811
%TypeHeaderCode
@@ -13,47 +16,101 @@ public:
1316
QgsAtlasComposition( QgsComposition* composition );
1417
~QgsAtlasComposition();
1518

16-
/** Is the atlas generation enabled ? */
19+
/**Returns whether the atlas generation is enabled
20+
* @returns true if atlas is enabled
21+
* @see setEnabled
22+
*/
1723
bool enabled() const;
18-
void setEnabled( bool e );
24+
25+
/**Sets whether the atlas is enabled
26+
* @param enabled set to true to enable to atlas
27+
* @see enabled
28+
*/
29+
void setEnabled( bool enabled );
1930

2031
/**Returns the map used by the atlas
2132
* @deprecated Use QgsComposerMap::atlasDriven() instead
2233
*/
23-
QgsComposerMap* composerMap() const;
34+
QgsComposerMap* composerMap() const /Deprecated/;
35+
2436
/**Sets the map used by the atlas
2537
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
2638
*/
27-
void setComposerMap( QgsComposerMap* map );
39+
void setComposerMap( QgsComposerMap* map ) /Deprecated/;
2840

41+
/**Returns true if the atlas is set to hide the coverage layer
42+
* @returns true if coverage layer is hidden
43+
* @see setHideCoverage
44+
*/
2945
bool hideCoverage() const;
46+
47+
/**Sets whether the coverage layer should be hidden in map items in the composition
48+
* @param hide set to true to hide the coverage layer
49+
* @see hideCoverage
50+
*/
3051
void setHideCoverage( bool hide );
3152

3253
/**Returns whether the atlas map uses a fixed scale
3354
* @deprecated Use QgsComposerMap::atlasFixedScale() instead
3455
*/
35-
bool fixedScale() const;
56+
bool fixedScale() const /Deprecated/;
3657
/**Sets whether the atlas map should use a fixed scale
3758
* @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead
3859
*/
39-
void setFixedScale( bool fixed );
60+
void setFixedScale( bool fixed ) /Deprecated/;
4061

4162
/**Returns the margin for the atlas map
4263
* @deprecated Use QgsComposerMap::atlasMargin() instead
4364
*/
44-
float margin() const;
65+
float margin() const /Deprecated/;
66+
4567
/**Sets the margin for the atlas map
4668
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
4769
*/
48-
void setMargin( float margin );
70+
void setMargin( float margin ) /Deprecated/;
4971

72+
/**Returns the filename expression used for generating output filenames for each
73+
* atlas page.
74+
* @returns filename pattern
75+
* @see setFilenamePattern
76+
* @note This property has no effect when exporting to PDF if singleFile() is true
77+
*/
5078
QString filenamePattern() const;
79+
80+
/**Sets the filename expression used for generating output filenames for each
81+
* atlas page.
82+
* @param pattern expression to use for output filenames
83+
* @see filenamePattern
84+
* @note This method has no effect when exporting to PDF if singleFile() is true
85+
*/
5186
void setFilenamePattern( const QString& pattern );
5287

88+
/**Returns the coverage layer used for the atlas features
89+
* @returns atlas coverage layer
90+
* @see setCoverageLayer
91+
*/
5392
QgsVectorLayer* coverageLayer() const;
54-
void setCoverageLayer( QgsVectorLayer* lmap );
55-
93+
94+
/**Sets the coverage layer to use for the atlas features
95+
* @param layer vector coverage layer
96+
* @see coverageLayer
97+
*/
98+
void setCoverageLayer( QgsVectorLayer* layer );
99+
100+
/**Returns whether the atlas will be exported to a single file. This is only
101+
* applicable for PDF exports.
102+
* @returns true if atlas will be exported to a single file
103+
* @see setSingleFile
104+
* @note This property is only used for PDF exports.
105+
*/
56106
bool singleFile() const;
107+
108+
/**Sets whether the atlas should be exported to a single file. This is only
109+
* applicable for PDF exports.
110+
* @param single set to true to export atlas to a single file.
111+
* @see singleFile
112+
* @note This method is only used for PDF exports.
113+
*/
57114
void setSingleFile( bool single );
58115

59116
bool sortFeatures() const;

‎python/core/composer/qgscomposerattributetable.sip

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class QgsComposerAttributeTable : QgsComposerTable
4242
*/
4343
void setVectorLayer( QgsVectorLayer* layer );
4444

45-
/*Returns the vector layer the attribute table is currently using
45+
/**Returns the vector layer the attribute table is currently using
4646
* @returns attribute table's current vector layer
4747
* @note added in 2.3
4848
* @see setVectorLayer
@@ -61,7 +61,7 @@ class QgsComposerAttributeTable : QgsComposerTable
6161
*/
6262
void setComposerMap( const QgsComposerMap* map /TransferThis/ );
6363

64-
/*Returns the composer map whose extents are controlling the features shown in the
64+
/**Returns the composer map whose extents are controlling the features shown in the
6565
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
6666
* @returns composer map controlling the attribute table
6767
* @note added in 2.3
@@ -79,7 +79,7 @@ class QgsComposerAttributeTable : QgsComposerTable
7979
*/
8080
void setMaximumNumberOfFeatures( int features );
8181

82-
/*Returns the maximum number of features to be shown by the table.
82+
/**Returns the maximum number of features to be shown by the table.
8383
* @returns maximum number of features
8484
* @note added in 2.3
8585
* @see setMaximumNumberOfFeatures
@@ -96,7 +96,7 @@ class QgsComposerAttributeTable : QgsComposerTable
9696
*/
9797
void setDisplayOnlyVisibleFeatures( bool b );
9898

99-
/*Returns true if the table is set to show only features visible on a corresponding
99+
/**Returns true if the table is set to show only features visible on a corresponding
100100
* composer map item.
101101
* @returns true if table only shows visible features
102102
* @note added in 2.3
@@ -105,7 +105,7 @@ class QgsComposerAttributeTable : QgsComposerTable
105105
*/
106106
bool displayOnlyVisibleFeatures() const;
107107

108-
/*Returns true if a feature filter is active on the attribute table
108+
/**Returns true if a feature filter is active on the attribute table
109109
* @returns bool state of the feature filter
110110
* @note added in 2.3
111111
* @see setFilterFeatures
@@ -123,7 +123,7 @@ class QgsComposerAttributeTable : QgsComposerTable
123123
*/
124124
void setFilterFeatures( bool filter );
125125

126-
/*Returns the current expression used to filter features for the table. The filter is only
126+
/**Returns the current expression used to filter features for the table. The filter is only
127127
* active if filterFeatures() is true.
128128
* @returns feature filter expression
129129
* @note added in 2.3
@@ -143,7 +143,7 @@ class QgsComposerAttributeTable : QgsComposerTable
143143
*/
144144
void setFeatureFilter( const QString& expression );
145145

146-
/*Returns the attributes fields which are shown by the table.
146+
/**Returns the attributes fields which are shown by the table.
147147
* @returns a QSet of integers refering to the attributes in the vector layer
148148
* @see setDisplayAttributes
149149
*/
@@ -158,7 +158,7 @@ class QgsComposerAttributeTable : QgsComposerTable
158158
*/
159159
void setDisplayAttributes( const QSet<int>& attr );
160160

161-
/*Returns the attribute field aliases, which control how fields are named in the table's
161+
/**Returns the attribute field aliases, which control how fields are named in the table's
162162
* header row.
163163
* @returns a QMap of integers to strings, where the string is the field's alias.
164164
* @see setFieldAliasMap

‎python/core/composer/qgscomposeritem.sip

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class QgsComposerItem : QObject, QGraphicsRectItem
383383
* @deprecated Use itemRotation()
384384
* instead
385385
*/
386-
double rotation() const;
386+
double rotation() const /Deprecated/;
387387

388388
/**Updates item, with the possibility to do custom update for subclasses*/
389389
virtual void updateItem();
@@ -471,11 +471,12 @@ class QgsComposerItem : QObject, QGraphicsRectItem
471471

472472
/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation*/
473473
bool imageSizeConsideringRotation( double& width, double& height, double rotation ) const;
474+
474475
/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation
475476
* @deprecated Use bool imageSizeConsideringRotation( double& width, double& height, double rotation )
476477
* instead
477478
*/
478-
bool imageSizeConsideringRotation( double& width, double& height ) const;
479+
bool imageSizeConsideringRotation( double& width, double& height ) const /Deprecated/;
479480

480481
/**Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by
481482
* a specified amount
@@ -487,19 +488,21 @@ class QgsComposerItem : QObject, QGraphicsRectItem
487488

488489
/**Calculates corner point after rotation and scaling*/
489490
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) const;
491+
490492
/**Calculates corner point after rotation and scaling
491493
* @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
492494
* instead
493495
*/
494-
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
496+
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
495497

496498
/**Calculates width / height of the bounding box of a rotated rectangle*/
499+
497500
void sizeChangedByRotation( double& width, double& height, double rotation );
498501
/**Calculates width / height of the bounding box of a rotated rectangle
499502
* @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation )
500503
* instead
501504
*/
502-
void sizeChangedByRotation( double& width, double& height );
505+
void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
503506

504507
/**Rotates a point / vector
505508
@param angle rotation angle in degrees, counterclockwise

‎python/core/composer/qgscomposerlegend.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class QgsComposerLegend : QgsComposerItem
3131
void setTitle( const QString& t );
3232
QString title() const;
3333

34-
/*Returns the alignment of the legend title
34+
/**Returns the alignment of the legend title
3535
* @returns Qt::AlignmentFlag for the legend title
3636
* @note added in 2.3
3737
* @see setTitleAlignment

‎python/core/composer/qgscomposermap.sip

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,12 @@ class QgsComposerMap : QgsComposerItem
309309
way the map is drawn within the item
310310
* @deprecated Use setMapRotation( double rotation ) instead
311311
*/
312-
void setRotation( double r );
312+
void setRotation( double r ) /Deprecated/;
313+
313314
/**Returns the rotation used for drawing the map within the composer item
314315
* @deprecated Use mapRotation() instead
315316
*/
316-
double rotation() const;
317+
double rotation() const /Deprecated/;
317318

318319
/**Sets rotation for the map - this does not affect the composer item shape, only the
319320
way the map is drawn within the item
@@ -374,17 +375,19 @@ class QgsComposerMap : QgsComposerItem
374375
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
375376
* instead
376377
*/
377-
bool imageSizeConsideringRotation( double& width, double& height ) const;
378+
bool imageSizeConsideringRotation( double& width, double& height ) const /Deprecated/;
379+
378380
/**Calculates corner point after rotation and scaling
379381
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
380382
* instead
381383
*/
382-
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
384+
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
385+
383386
/**Calculates width / height of the bounding box of a rotated rectangle
384387
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
385388
* instead
386389
*/
387-
void sizeChangedByRotation( double& width, double& height );
390+
void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
388391

389392
/** Returns true if the map extent is set to follow the current atlas feature */
390393
bool atlasDriven() const;

‎python/core/composer/qgscomposerpicture.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class QgsComposerPicture: QgsComposerItem
4141
/**Returns the rotation used for drawing the picture within the composer item
4242
* @deprecated Use pictureRotation() instead
4343
*/
44-
double rotation() const;
44+
double rotation() const /Deprecated/;
4545

4646
/**Returns the rotation used for drawing the picture within the item
4747
@note this function was added in version 2.1*/
@@ -58,17 +58,17 @@ class QgsComposerPicture: QgsComposerItem
5858
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
5959
* instead
6060
*/
61-
bool imageSizeConsideringRotation( double& width, double& height ) const;
61+
bool imageSizeConsideringRotation( double& width, double& height ) const /Deprecated/;
6262
/**Calculates corner point after rotation and scaling
6363
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
6464
* instead
6565
*/
66-
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
66+
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
6767
/**Calculates width / height of the bounding box of a rotated rectangle
6868
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
6969
* instead
7070
*/
71-
void sizeChangedByRotation( double& width, double& height );
71+
void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
7272

7373
public slots:
7474
/**Sets the picture rotation within the item bounds. This does not affect the item rectangle,

‎python/core/composer/qgscomposertexttable.sip

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ class QgsComposerTextTable: QgsComposerTable
99

1010
/** return correct graphics item type. Added in v1.7 */
1111
virtual int type() const;
12-
13-
void setHeaderLabels( const QStringList& l );
12+
13+
/**Sets the text to use for the header row for the table
14+
* @param labels list of strings to use for each column's header row
15+
* @see headerLabels
16+
*/
17+
void setHeaderLabels( const QStringList& labels );
18+
19+
/**Adds a row to the table
20+
* @param row list of strings to use for each cell's value in the newly added row
21+
* @note If row is shorter than the number of columns in the table than blank cells
22+
* will be inserted at the end of the row. If row contains more strings then the number
23+
* of columns in the table then these extra strings will be ignored.
24+
*/
1425
void addRow( const QStringList& row );
1526

1627
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;

‎python/core/composer/qgscomposition.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class QgsComposition : QGraphicsScene
161161
@return QgsComposerMap or 0 pointer if the composer map item does not exist*/
162162
const QgsComposerMap* getComposerMapById( int id ) const;
163163

164-
/*Returns the composer html with specified id (a string as named in the
164+
/**Returns the composer html with specified id (a string as named in the
165165
composer user interface item properties).
166166
@note Added in QGIS 2.0
167167
@param id - A QString representing the id of the item.

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ QgsAtlasComposition::~QgsAtlasComposition()
5050
{
5151
}
5252

53-
void QgsAtlasComposition::setEnabled( bool e )
53+
void QgsAtlasComposition::setEnabled( bool enabled )
5454
{
55-
mEnabled = e;
55+
mEnabled = enabled;
5656
mComposition->setAtlasMode( QgsComposition::AtlasOff );
57-
emit toggled( e );
57+
emit toggled( enabled );
5858
}
5959

6060
void QgsAtlasComposition::setCoverageLayer( QgsVectorLayer* layer )

0 commit comments

Comments
 (0)
Please sign in to comment.