[composer] Some api documentation improvements and fix ups

This commit is contained in:
Nyall Dawson 2014-04-28 19:11:11 +10:00
parent 9f84e9fd98
commit 7e977bcfd3
18 changed files with 237 additions and 97 deletions

View File

@ -2,7 +2,10 @@
* Class used to render an Atlas, iterating over geometry features. * Class used to render an Atlas, iterating over geometry features.
* prepareForFeature() modifies the atlas map's extent to zoom on the given feature. * prepareForFeature() modifies the atlas map's extent to zoom on the given feature.
* This class is used for printing, exporting to PDF and images. * This class is used for printing, exporting to PDF and images.
* */ * @note This class should not be created directly. For the atlas to function correctly
* the atlasComposition() property for QgsComposition should be used to retrieve a
* QgsAtlasComposition which is automatically created and attached to the composition.
*/
class QgsAtlasComposition : QObject class QgsAtlasComposition : QObject
{ {
%TypeHeaderCode %TypeHeaderCode
@ -13,47 +16,101 @@ public:
QgsAtlasComposition( QgsComposition* composition ); QgsAtlasComposition( QgsComposition* composition );
~QgsAtlasComposition(); ~QgsAtlasComposition();
/** Is the atlas generation enabled ? */ /**Returns whether the atlas generation is enabled
* @returns true if atlas is enabled
* @see setEnabled
*/
bool enabled() const; bool enabled() const;
void setEnabled( bool e );
/**Sets whether the atlas is enabled
* @param enabled set to true to enable to atlas
* @see enabled
*/
void setEnabled( bool enabled );
/**Returns the map used by the atlas /**Returns the map used by the atlas
* @deprecated Use QgsComposerMap::atlasDriven() instead * @deprecated Use QgsComposerMap::atlasDriven() instead
*/ */
QgsComposerMap* composerMap() const; QgsComposerMap* composerMap() const /Deprecated/;
/**Sets the map used by the atlas /**Sets the map used by the atlas
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead * @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
*/ */
void setComposerMap( QgsComposerMap* map ); void setComposerMap( QgsComposerMap* map ) /Deprecated/;
/**Returns true if the atlas is set to hide the coverage layer
* @returns true if coverage layer is hidden
* @see setHideCoverage
*/
bool hideCoverage() const; bool hideCoverage() const;
/**Sets whether the coverage layer should be hidden in map items in the composition
* @param hide set to true to hide the coverage layer
* @see hideCoverage
*/
void setHideCoverage( bool hide ); void setHideCoverage( bool hide );
/**Returns whether the atlas map uses a fixed scale /**Returns whether the atlas map uses a fixed scale
* @deprecated Use QgsComposerMap::atlasFixedScale() instead * @deprecated Use QgsComposerMap::atlasFixedScale() instead
*/ */
bool fixedScale() const; bool fixedScale() const /Deprecated/;
/**Sets whether the atlas map should use a fixed scale /**Sets whether the atlas map should use a fixed scale
* @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead * @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead
*/ */
void setFixedScale( bool fixed ); void setFixedScale( bool fixed ) /Deprecated/;
/**Returns the margin for the atlas map /**Returns the margin for the atlas map
* @deprecated Use QgsComposerMap::atlasMargin() instead * @deprecated Use QgsComposerMap::atlasMargin() instead
*/ */
float margin() const; float margin() const /Deprecated/;
/**Sets the margin for the atlas map /**Sets the margin for the atlas map
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead * @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
*/ */
void setMargin( float margin ); void setMargin( float margin ) /Deprecated/;
/**Returns the filename expression used for generating output filenames for each
* atlas page.
* @returns filename pattern
* @see setFilenamePattern
* @note This property has no effect when exporting to PDF if singleFile() is true
*/
QString filenamePattern() const; QString filenamePattern() const;
/**Sets the filename expression used for generating output filenames for each
* atlas page.
* @param pattern expression to use for output filenames
* @see filenamePattern
* @note This method has no effect when exporting to PDF if singleFile() is true
*/
void setFilenamePattern( const QString& pattern ); void setFilenamePattern( const QString& pattern );
/**Returns the coverage layer used for the atlas features
* @returns atlas coverage layer
* @see setCoverageLayer
*/
QgsVectorLayer* coverageLayer() const; QgsVectorLayer* coverageLayer() const;
void setCoverageLayer( QgsVectorLayer* lmap );
/**Sets the coverage layer to use for the atlas features
* @param layer vector coverage layer
* @see coverageLayer
*/
void setCoverageLayer( QgsVectorLayer* layer );
/**Returns whether the atlas will be exported to a single file. This is only
* applicable for PDF exports.
* @returns true if atlas will be exported to a single file
* @see setSingleFile
* @note This property is only used for PDF exports.
*/
bool singleFile() const; bool singleFile() const;
/**Sets whether the atlas should be exported to a single file. This is only
* applicable for PDF exports.
* @param single set to true to export atlas to a single file.
* @see singleFile
* @note This method is only used for PDF exports.
*/
void setSingleFile( bool single ); void setSingleFile( bool single );
bool sortFeatures() const; bool sortFeatures() const;

View File

@ -42,7 +42,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setVectorLayer( QgsVectorLayer* layer ); void setVectorLayer( QgsVectorLayer* layer );
/*Returns the vector layer the attribute table is currently using /**Returns the vector layer the attribute table is currently using
* @returns attribute table's current vector layer * @returns attribute table's current vector layer
* @note added in 2.3 * @note added in 2.3
* @see setVectorLayer * @see setVectorLayer
@ -61,7 +61,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setComposerMap( const QgsComposerMap* map /TransferThis/ ); void setComposerMap( const QgsComposerMap* map /TransferThis/ );
/*Returns the composer map whose extents are controlling the features shown in the /**Returns the composer map whose extents are controlling the features shown in the
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true. * table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
* @returns composer map controlling the attribute table * @returns composer map controlling the attribute table
* @note added in 2.3 * @note added in 2.3
@ -79,7 +79,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setMaximumNumberOfFeatures( int features ); void setMaximumNumberOfFeatures( int features );
/*Returns the maximum number of features to be shown by the table. /**Returns the maximum number of features to be shown by the table.
* @returns maximum number of features * @returns maximum number of features
* @note added in 2.3 * @note added in 2.3
* @see setMaximumNumberOfFeatures * @see setMaximumNumberOfFeatures
@ -96,7 +96,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setDisplayOnlyVisibleFeatures( bool b ); void setDisplayOnlyVisibleFeatures( bool b );
/*Returns true if the table is set to show only features visible on a corresponding /**Returns true if the table is set to show only features visible on a corresponding
* composer map item. * composer map item.
* @returns true if table only shows visible features * @returns true if table only shows visible features
* @note added in 2.3 * @note added in 2.3
@ -105,7 +105,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
bool displayOnlyVisibleFeatures() const; bool displayOnlyVisibleFeatures() const;
/*Returns true if a feature filter is active on the attribute table /**Returns true if a feature filter is active on the attribute table
* @returns bool state of the feature filter * @returns bool state of the feature filter
* @note added in 2.3 * @note added in 2.3
* @see setFilterFeatures * @see setFilterFeatures
@ -123,7 +123,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setFilterFeatures( bool filter ); void setFilterFeatures( bool filter );
/*Returns the current expression used to filter features for the table. The filter is only /**Returns the current expression used to filter features for the table. The filter is only
* active if filterFeatures() is true. * active if filterFeatures() is true.
* @returns feature filter expression * @returns feature filter expression
* @note added in 2.3 * @note added in 2.3
@ -143,7 +143,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setFeatureFilter( const QString& expression ); void setFeatureFilter( const QString& expression );
/*Returns the attributes fields which are shown by the table. /**Returns the attributes fields which are shown by the table.
* @returns a QSet of integers refering to the attributes in the vector layer * @returns a QSet of integers refering to the attributes in the vector layer
* @see setDisplayAttributes * @see setDisplayAttributes
*/ */
@ -158,7 +158,7 @@ class QgsComposerAttributeTable : QgsComposerTable
*/ */
void setDisplayAttributes( const QSet<int>& attr ); void setDisplayAttributes( const QSet<int>& attr );
/*Returns the attribute field aliases, which control how fields are named in the table's /**Returns the attribute field aliases, which control how fields are named in the table's
* header row. * header row.
* @returns a QMap of integers to strings, where the string is the field's alias. * @returns a QMap of integers to strings, where the string is the field's alias.
* @see setFieldAliasMap * @see setFieldAliasMap

View File

@ -383,7 +383,7 @@ class QgsComposerItem : QObject, QGraphicsRectItem
* @deprecated Use itemRotation() * @deprecated Use itemRotation()
* instead * instead
*/ */
double rotation() const; double rotation() const /Deprecated/;
/**Updates item, with the possibility to do custom update for subclasses*/ /**Updates item, with the possibility to do custom update for subclasses*/
virtual void updateItem(); virtual void updateItem();
@ -471,11 +471,12 @@ class QgsComposerItem : QObject, QGraphicsRectItem
/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation*/ /**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation*/
bool imageSizeConsideringRotation( double& width, double& height, double rotation ) const; bool imageSizeConsideringRotation( double& width, double& height, double rotation ) const;
/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation /**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation
* @deprecated Use bool imageSizeConsideringRotation( double& width, double& height, double rotation ) * @deprecated Use bool imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
bool imageSizeConsideringRotation( double& width, double& height ) const; bool imageSizeConsideringRotation( double& width, double& height ) const /Deprecated/;
/**Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by /**Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by
* a specified amount * a specified amount
@ -487,19 +488,21 @@ class QgsComposerItem : QObject, QGraphicsRectItem
/**Calculates corner point after rotation and scaling*/ /**Calculates corner point after rotation and scaling*/
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) const; bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) const;
/**Calculates corner point after rotation and scaling /**Calculates corner point after rotation and scaling
* @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) * @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead * instead
*/ */
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const; bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
/**Calculates width / height of the bounding box of a rotated rectangle*/ /**Calculates width / height of the bounding box of a rotated rectangle*/
void sizeChangedByRotation( double& width, double& height, double rotation ); void sizeChangedByRotation( double& width, double& height, double rotation );
/**Calculates width / height of the bounding box of a rotated rectangle /**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation ) * @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
void sizeChangedByRotation( double& width, double& height ); void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
/**Rotates a point / vector /**Rotates a point / vector
@param angle rotation angle in degrees, counterclockwise @param angle rotation angle in degrees, counterclockwise

View File

@ -31,7 +31,7 @@ class QgsComposerLegend : QgsComposerItem
void setTitle( const QString& t ); void setTitle( const QString& t );
QString title() const; QString title() const;
/*Returns the alignment of the legend title /**Returns the alignment of the legend title
* @returns Qt::AlignmentFlag for the legend title * @returns Qt::AlignmentFlag for the legend title
* @note added in 2.3 * @note added in 2.3
* @see setTitleAlignment * @see setTitleAlignment

View File

@ -309,11 +309,12 @@ class QgsComposerMap : QgsComposerItem
way the map is drawn within the item way the map is drawn within the item
* @deprecated Use setMapRotation( double rotation ) instead * @deprecated Use setMapRotation( double rotation ) instead
*/ */
void setRotation( double r ); void setRotation( double r ) /Deprecated/;
/**Returns the rotation used for drawing the map within the composer item /**Returns the rotation used for drawing the map within the composer item
* @deprecated Use mapRotation() instead * @deprecated Use mapRotation() instead
*/ */
double rotation() const; double rotation() const /Deprecated/;
/**Sets rotation for the map - this does not affect the composer item shape, only the /**Sets rotation for the map - this does not affect the composer item shape, only the
way the map is drawn within the item way the map is drawn within the item
@ -374,17 +375,19 @@ class QgsComposerMap : QgsComposerItem
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation ) * @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
bool imageSizeConsideringRotation( double& width, double& height ) const; bool imageSizeConsideringRotation( double& width, double& height ) const /Deprecated/;
/**Calculates corner point after rotation and scaling /**Calculates corner point after rotation and scaling
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) * @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead * instead
*/ */
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const; bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
/**Calculates width / height of the bounding box of a rotated rectangle /**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation ) * @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
void sizeChangedByRotation( double& width, double& height ); void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
/** Returns true if the map extent is set to follow the current atlas feature */ /** Returns true if the map extent is set to follow the current atlas feature */
bool atlasDriven() const; bool atlasDriven() const;

View File

@ -41,7 +41,7 @@ class QgsComposerPicture: QgsComposerItem
/**Returns the rotation used for drawing the picture within the composer item /**Returns the rotation used for drawing the picture within the composer item
* @deprecated Use pictureRotation() instead * @deprecated Use pictureRotation() instead
*/ */
double rotation() const; double rotation() const /Deprecated/;
/**Returns the rotation used for drawing the picture within the item /**Returns the rotation used for drawing the picture within the item
@note this function was added in version 2.1*/ @note this function was added in version 2.1*/
@ -58,17 +58,17 @@ class QgsComposerPicture: QgsComposerItem
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation ) * @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
bool imageSizeConsideringRotation( double& width, double& height ) const; bool imageSizeConsideringRotation( double& width, double& height ) const /Deprecated/;
/**Calculates corner point after rotation and scaling /**Calculates corner point after rotation and scaling
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) * @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead * instead
*/ */
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const; bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const /Deprecated/;
/**Calculates width / height of the bounding box of a rotated rectangle /**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation ) * @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
void sizeChangedByRotation( double& width, double& height ); void sizeChangedByRotation( double& width, double& height ) /Deprecated/;
public slots: public slots:
/**Sets the picture rotation within the item bounds. This does not affect the item rectangle, /**Sets the picture rotation within the item bounds. This does not affect the item rectangle,

View File

@ -10,7 +10,18 @@ class QgsComposerTextTable: QgsComposerTable
/** return correct graphics item type. Added in v1.7 */ /** return correct graphics item type. Added in v1.7 */
virtual int type() const; virtual int type() const;
void setHeaderLabels( const QStringList& l ); /**Sets the text to use for the header row for the table
* @param labels list of strings to use for each column's header row
* @see headerLabels
*/
void setHeaderLabels( const QStringList& labels );
/**Adds a row to the table
* @param row list of strings to use for each cell's value in the newly added row
* @note If row is shorter than the number of columns in the table than blank cells
* will be inserted at the end of the row. If row contains more strings then the number
* of columns in the table then these extra strings will be ignored.
*/
void addRow( const QStringList& row ); void addRow( const QStringList& row );
bool writeXML( QDomElement& elem, QDomDocument & doc ) const; bool writeXML( QDomElement& elem, QDomDocument & doc ) const;

View File

@ -161,7 +161,7 @@ class QgsComposition : QGraphicsScene
@return QgsComposerMap or 0 pointer if the composer map item does not exist*/ @return QgsComposerMap or 0 pointer if the composer map item does not exist*/
const QgsComposerMap* getComposerMapById( int id ) const; const QgsComposerMap* getComposerMapById( int id ) const;
/*Returns the composer html with specified id (a string as named in the /**Returns the composer html with specified id (a string as named in the
composer user interface item properties). composer user interface item properties).
@note Added in QGIS 2.0 @note Added in QGIS 2.0
@param id - A QString representing the id of the item. @param id - A QString representing the id of the item.

View File

@ -50,11 +50,11 @@ QgsAtlasComposition::~QgsAtlasComposition()
{ {
} }
void QgsAtlasComposition::setEnabled( bool e ) void QgsAtlasComposition::setEnabled( bool enabled )
{ {
mEnabled = e; mEnabled = enabled;
mComposition->setAtlasMode( QgsComposition::AtlasOff ); mComposition->setAtlasMode( QgsComposition::AtlasOff );
emit toggled( e ); emit toggled( enabled );
} }
void QgsAtlasComposition::setCoverageLayer( QgsVectorLayer* layer ) void QgsAtlasComposition::setCoverageLayer( QgsVectorLayer* layer )

View File

@ -33,7 +33,10 @@ class QgsExpression;
* Class used to render an Atlas, iterating over geometry features. * Class used to render an Atlas, iterating over geometry features.
* prepareForFeature() modifies the atlas map's extent to zoom on the given feature. * prepareForFeature() modifies the atlas map's extent to zoom on the given feature.
* This class is used for printing, exporting to PDF and images. * This class is used for printing, exporting to PDF and images.
* */ * @note This class should not be created directly. For the atlas to function correctly
* the atlasComposition() property for QgsComposition should be used to retrieve a
* QgsAtlasComposition which is automatically created and attached to the composition.
*/
class CORE_EXPORT QgsAtlasComposition : public QObject class CORE_EXPORT QgsAtlasComposition : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -41,47 +44,102 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
QgsAtlasComposition( QgsComposition* composition ); QgsAtlasComposition( QgsComposition* composition );
~QgsAtlasComposition(); ~QgsAtlasComposition();
/** Is the atlas generation enabled ? */ /**Returns whether the atlas generation is enabled
* @returns true if atlas is enabled
* @see setEnabled
*/
bool enabled() const { return mEnabled; } bool enabled() const { return mEnabled; }
void setEnabled( bool e );
/**Sets whether the atlas is enabled
* @param enabled set to true to enable to atlas
* @see enabled
*/
void setEnabled( bool enabled );
/**Returns the map used by the atlas /**Returns the map used by the atlas
* @deprecated Use QgsComposerMap::atlasDriven() instead * @deprecated Use QgsComposerMap::atlasDriven() instead
*/ */
QgsComposerMap* composerMap() const; Q_DECL_DEPRECATED QgsComposerMap* composerMap() const;
/**Sets the map used by the atlas /**Sets the map used by the atlas
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead * @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
*/ */
void setComposerMap( QgsComposerMap* map ); Q_DECL_DEPRECATED void setComposerMap( QgsComposerMap* map );
/**Returns true if the atlas is set to hide the coverage layer
* @returns true if coverage layer is hidden
* @see setHideCoverage
*/
bool hideCoverage() const { return mHideCoverage; } bool hideCoverage() const { return mHideCoverage; }
/**Sets whether the coverage layer should be hidden in map items in the composition
* @param hide set to true to hide the coverage layer
* @see hideCoverage
*/
void setHideCoverage( bool hide ); void setHideCoverage( bool hide );
/**Returns whether the atlas map uses a fixed scale /**Returns whether the atlas map uses a fixed scale
* @deprecated Use QgsComposerMap::atlasFixedScale() instead * @deprecated Use QgsComposerMap::atlasFixedScale() instead
*/ */
bool fixedScale() const; Q_DECL_DEPRECATED bool fixedScale() const;
/**Sets whether the atlas map should use a fixed scale /**Sets whether the atlas map should use a fixed scale
* @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead * @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead
*/ */
void setFixedScale( bool fixed ); Q_DECL_DEPRECATED void setFixedScale( bool fixed );
/**Returns the margin for the atlas map /**Returns the margin for the atlas map
* @deprecated Use QgsComposerMap::atlasMargin() instead * @deprecated Use QgsComposerMap::atlasMargin() instead
*/ */
float margin() const; Q_DECL_DEPRECATED float margin() const;
/**Sets the margin for the atlas map /**Sets the margin for the atlas map
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead * @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
*/ */
void setMargin( float margin ); Q_DECL_DEPRECATED void setMargin( float margin );
/**Returns the filename expression used for generating output filenames for each
* atlas page.
* @returns filename pattern
* @see setFilenamePattern
* @note This property has no effect when exporting to PDF if singleFile() is true
*/
QString filenamePattern() const { return mFilenamePattern; } QString filenamePattern() const { return mFilenamePattern; }
/**Sets the filename expression used for generating output filenames for each
* atlas page.
* @param pattern expression to use for output filenames
* @see filenamePattern
* @note This method has no effect when exporting to PDF if singleFile() is true
*/
void setFilenamePattern( const QString& pattern ); void setFilenamePattern( const QString& pattern );
/**Returns the coverage layer used for the atlas features
* @returns atlas coverage layer
* @see setCoverageLayer
*/
QgsVectorLayer* coverageLayer() const { return mCoverageLayer; } QgsVectorLayer* coverageLayer() const { return mCoverageLayer; }
void setCoverageLayer( QgsVectorLayer* lmap );
/**Sets the coverage layer to use for the atlas features
* @param layer vector coverage layer
* @see coverageLayer
*/
void setCoverageLayer( QgsVectorLayer* layer );
/**Returns whether the atlas will be exported to a single file. This is only
* applicable for PDF exports.
* @returns true if atlas will be exported to a single file
* @see setSingleFile
* @note This property is only used for PDF exports.
*/
bool singleFile() const { return mSingleFile; } bool singleFile() const { return mSingleFile; }
/**Sets whether the atlas should be exported to a single file. This is only
* applicable for PDF exports.
* @param single set to true to export atlas to a single file.
* @see singleFile
* @note This method is only used for PDF exports.
*/
void setSingleFile( bool single ) { mSingleFile = single; } void setSingleFile( bool single ) { mSingleFile = single; }
bool sortFeatures() const { return mSortFeatures; } bool sortFeatures() const { return mSortFeatures; }

View File

@ -59,7 +59,8 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
* @see vectorLayer * @see vectorLayer
*/ */
void setVectorLayer( QgsVectorLayer* layer ); void setVectorLayer( QgsVectorLayer* layer );
/*Returns the vector layer the attribute table is currently using
/**Returns the vector layer the attribute table is currently using
* @returns attribute table's current vector layer * @returns attribute table's current vector layer
* @note added in 2.3 * @note added in 2.3
* @see setVectorLayer * @see setVectorLayer
@ -77,7 +78,8 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
* @see setDisplayOnlyVisibleFeatures * @see setDisplayOnlyVisibleFeatures
*/ */
void setComposerMap( const QgsComposerMap* map ); void setComposerMap( const QgsComposerMap* map );
/*Returns the composer map whose extents are controlling the features shown in the
/**Returns the composer map whose extents are controlling the features shown in the
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true. * table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
* @returns composer map controlling the attribute table * @returns composer map controlling the attribute table
* @note added in 2.3 * @note added in 2.3
@ -94,7 +96,8 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
* @see maximumNumberOfFeatures * @see maximumNumberOfFeatures
*/ */
void setMaximumNumberOfFeatures( int features ); void setMaximumNumberOfFeatures( int features );
/*Returns the maximum number of features to be shown by the table.
/**Returns the maximum number of features to be shown by the table.
* @returns maximum number of features * @returns maximum number of features
* @note added in 2.3 * @note added in 2.3
* @see setMaximumNumberOfFeatures * @see setMaximumNumberOfFeatures
@ -110,7 +113,8 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
* @see setComposerMap * @see setComposerMap
*/ */
void setDisplayOnlyVisibleFeatures( bool visibleOnly ); void setDisplayOnlyVisibleFeatures( bool visibleOnly );
/*Returns true if the table is set to show only features visible on a corresponding
/**Returns true if the table is set to show only features visible on a corresponding
* composer map item. * composer map item.
* @returns true if table only shows visible features * @returns true if table only shows visible features
* @note added in 2.3 * @note added in 2.3
@ -119,13 +123,14 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
*/ */
bool displayOnlyVisibleFeatures() const { return mShowOnlyVisibleFeatures; } bool displayOnlyVisibleFeatures() const { return mShowOnlyVisibleFeatures; }
/*Returns true if a feature filter is active on the attribute table /**Returns true if a feature filter is active on the attribute table
* @returns bool state of the feature filter * @returns bool state of the feature filter
* @note added in 2.3 * @note added in 2.3
* @see setFilterFeatures * @see setFilterFeatures
* @see featureFilter * @see featureFilter
*/ */
bool filterFeatures() const { return mFilterFeatures; } bool filterFeatures() const { return mFilterFeatures; }
/**Sets whether the feature filter is active for the attribute table. Changing /**Sets whether the feature filter is active for the attribute table. Changing
* this setting forces the table to refetch features from its vector layer, and may result in * this setting forces the table to refetch features from its vector layer, and may result in
* the table changing size to accomodate the new displayed feature attributes. * the table changing size to accomodate the new displayed feature attributes.
@ -136,7 +141,7 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
*/ */
void setFilterFeatures( bool filter ); void setFilterFeatures( bool filter );
/*Returns the current expression used to filter features for the table. The filter is only /**Returns the current expression used to filter features for the table. The filter is only
* active if filterFeatures() is true. * active if filterFeatures() is true.
* @returns feature filter expression * @returns feature filter expression
* @note added in 2.3 * @note added in 2.3
@ -144,6 +149,7 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
* @see filterFeatures * @see filterFeatures
*/ */
QString featureFilter() const { return mFeatureFilter; } QString featureFilter() const { return mFeatureFilter; }
/**Sets the expression used for filtering features in the table. The filter is only /**Sets the expression used for filtering features in the table. The filter is only
* active if filterFeatures() is set to true. Changing this setting forces the table * active if filterFeatures() is set to true. Changing this setting forces the table
* to refetch features from its vector layer, and may result in * to refetch features from its vector layer, and may result in
@ -155,11 +161,12 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
*/ */
void setFeatureFilter( const QString& expression ); void setFeatureFilter( const QString& expression );
/*Returns the attributes fields which are shown by the table. /**Returns the attributes fields which are shown by the table.
* @returns a QSet of integers refering to the attributes in the vector layer * @returns a QSet of integers refering to the attributes in the vector layer
* @see setDisplayAttributes * @see setDisplayAttributes
*/ */
QSet<int> displayAttributes() const { return mDisplayAttributes; } QSet<int> displayAttributes() const { return mDisplayAttributes; }
/**Sets the attributes to display in the table. /**Sets the attributes to display in the table.
* @param attr QSet of integer values refering to the attributes from the vector layer to show * @param attr QSet of integer values refering to the attributes from the vector layer to show
* @param refresh set to true to force the table to refetch features from its vector layer * @param refresh set to true to force the table to refetch features from its vector layer
@ -169,7 +176,7 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
*/ */
void setDisplayAttributes( const QSet<int>& attr, bool refresh = true ); void setDisplayAttributes( const QSet<int>& attr, bool refresh = true );
/*Returns the attribute field aliases, which control how fields are named in the table's /**Returns the attribute field aliases, which control how fields are named in the table's
* header row. * header row.
* @returns a QMap of integers to strings, where the string is the field's alias. * @returns a QMap of integers to strings, where the string is the field's alias.
* @see setFieldAliasMap * @see setFieldAliasMap
@ -209,7 +216,7 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
*/ */
void setSortAttributes( const QList<QPair<int, bool> > att, bool refresh = true ); void setSortAttributes( const QList<QPair<int, bool> > att, bool refresh = true );
/*Returns the attributes used to sort the table's features. /**Returns the attributes used to sort the table's features.
* @returns a QList of integer/bool pairs, where the integer refers to the attribute index and * @returns a QList of integer/bool pairs, where the integer refers to the attribute index and
* the bool to the sort order for the attribute. If true the attribute is sorted ascending, * the bool to the sort order for the attribute. If true the attribute is sorted ascending,
* if false, the attribute is sorted in descending order. * if false, the attribute is sorted in descending order.
@ -233,9 +240,9 @@ class CORE_EXPORT QgsComposerAttributeTable: public QgsComposerTable
/**Shows only the features that are visible in the associated composer map (true by default)*/ /**Shows only the features that are visible in the associated composer map (true by default)*/
bool mShowOnlyVisibleFeatures; bool mShowOnlyVisibleFeatures;
// feature filtering /**True if feature filtering enabled*/
bool mFilterFeatures; bool mFilterFeatures;
// feature expression filter /**Feature filter expression*/
QString mFeatureFilter; QString mFeatureFilter;
/**List of attribute indices to display (or all attributes if list is empty)*/ /**List of attribute indices to display (or all attributes if list is empty)*/

View File

@ -343,7 +343,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
* @deprecated Use itemRotation() * @deprecated Use itemRotation()
* instead * instead
*/ */
double rotation() const {return mItemRotation;} Q_DECL_DEPRECATED double rotation() const {return mItemRotation;}
/**Updates item, with the possibility to do custom update for subclasses*/ /**Updates item, with the possibility to do custom update for subclasses*/
virtual void updateItem() { QGraphicsRectItem::update(); } virtual void updateItem() { QGraphicsRectItem::update(); }
@ -477,7 +477,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
* @deprecated Use bool imageSizeConsideringRotation( double& width, double& height, double rotation ) * @deprecated Use bool imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
bool imageSizeConsideringRotation( double& width, double& height ) const; Q_DECL_DEPRECATED bool imageSizeConsideringRotation( double& width, double& height ) const;
/**Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by /**Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by
* a specified amount * a specified amount
@ -493,7 +493,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
* @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) * @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead * instead
*/ */
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const; Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
/**Calculates width / height of the bounding box of a rotated rectangle*/ /**Calculates width / height of the bounding box of a rotated rectangle*/
void sizeChangedByRotation( double& width, double& height, double rotation ); void sizeChangedByRotation( double& width, double& height, double rotation );
@ -501,7 +501,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
* @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation ) * @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
void sizeChangedByRotation( double& width, double& height ); Q_DECL_DEPRECATED void sizeChangedByRotation( double& width, double& height );
/**Rotates a point / vector /**Rotates a point / vector
@param angle rotation angle in degrees, counterclockwise @param angle rotation angle in degrees, counterclockwise

View File

@ -58,7 +58,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
void setTitle( const QString& t ) {mTitle = t;} void setTitle( const QString& t ) {mTitle = t;}
QString title() const {return mTitle;} QString title() const {return mTitle;}
/*Returns the alignment of the legend title /**Returns the alignment of the legend title
* @returns Qt::AlignmentFlag for the legend title * @returns Qt::AlignmentFlag for the legend title
* @note added in 2.3 * @note added in 2.3
* @see setTitleAlignment * @see setTitleAlignment

View File

@ -347,11 +347,12 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
way the map is drawn within the item way the map is drawn within the item
* @deprecated Use setMapRotation( double rotation ) instead * @deprecated Use setMapRotation( double rotation ) instead
*/ */
void setRotation( double r ); Q_DECL_DEPRECATED void setRotation( double r );
/**Returns the rotation used for drawing the map within the composer item /**Returns the rotation used for drawing the map within the composer item
* @deprecated Use mapRotation() instead * @deprecated Use mapRotation() instead
*/ */
double rotation() const { return mMapRotation;}; Q_DECL_DEPRECATED double rotation() const { return mMapRotation;};
/**Sets rotation for the map - this does not affect the composer item shape, only the /**Sets rotation for the map - this does not affect the composer item shape, only the
way the map is drawn within the item way the map is drawn within the item
@ -412,17 +413,17 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation ) * @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
bool imageSizeConsideringRotation( double& width, double& height ) const; Q_DECL_DEPRECATED bool imageSizeConsideringRotation( double& width, double& height ) const;
/**Calculates corner point after rotation and scaling /**Calculates corner point after rotation and scaling
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) * @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead * instead
*/ */
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const; Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
/**Calculates width / height of the bounding box of a rotated rectangle /**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation ) * @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
void sizeChangedByRotation( double& width, double& height ); Q_DECL_DEPRECATED void sizeChangedByRotation( double& width, double& height );
/** Returns true if the map extent is set to follow the current atlas feature */ /** Returns true if the map extent is set to follow the current atlas feature */
bool atlasDriven() const { return mAtlasDriven; } bool atlasDriven() const { return mAtlasDriven; }

View File

@ -63,7 +63,7 @@ class CORE_EXPORT QgsComposerPicture: public QgsComposerItem
/**Returns the rotation used for drawing the picture within the composer item /**Returns the rotation used for drawing the picture within the composer item
* @deprecated Use pictureRotation() instead * @deprecated Use pictureRotation() instead
*/ */
double rotation() const { return mPictureRotation;}; Q_DECL_DEPRECATED double rotation() const { return mPictureRotation;};
/**Returns the rotation used for drawing the picture within the item /**Returns the rotation used for drawing the picture within the item
@note this function was added in version 2.1*/ @note this function was added in version 2.1*/
@ -80,17 +80,17 @@ class CORE_EXPORT QgsComposerPicture: public QgsComposerItem
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation ) * @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
bool imageSizeConsideringRotation( double& width, double& height ) const; Q_DECL_DEPRECATED bool imageSizeConsideringRotation( double& width, double& height ) const;
/**Calculates corner point after rotation and scaling /**Calculates corner point after rotation and scaling
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) * @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead * instead
*/ */
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const; Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
/**Calculates width / height of the bounding box of a rotated rectangle /**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation ) * @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
* instead * instead
*/ */
void sizeChangedByRotation( double& width, double& height ); Q_DECL_DEPRECATED void sizeChangedByRotation( double& width, double& height );
public slots: public slots:
/**Sets the picture rotation within the item bounds. This does not affect the item rectangle, /**Sets the picture rotation within the item bounds. This does not affect the item rectangle,

View File

@ -61,7 +61,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
void setGridColor( const QColor& c ) { mGridColor = c; } void setGridColor( const QColor& c ) { mGridColor = c; }
QColor gridColor() const { return mGridColor; } QColor gridColor() const { return mGridColor; }
/*Returns the text used in the column headers for the table. /**Returns the text used in the column headers for the table.
* @returns QMap of int to QString, where the int is the column index (starting at 0), * @returns QMap of int to QString, where the int is the column index (starting at 0),
* and the string is the text to use for the column's header * and the string is the text to use for the column's header
* @note added in 2.3 * @note added in 2.3
@ -72,7 +72,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
//TODO - make this more generic for next API break, eg rename as getRowValues, use QStringList rather than //TODO - make this more generic for next API break, eg rename as getRowValues, use QStringList rather than
//QgsAttributeMap //QgsAttributeMap
/*Fetches the text used for the rows of the table. /**Fetches the text used for the rows of the table.
* @returns true if attribute text was successfully retrieved. * @returns true if attribute text was successfully retrieved.
* @param attributeMaps QList of QgsAttributeMap to store retrieved row data in * @param attributeMaps QList of QgsAttributeMap to store retrieved row data in
* @note not available in python bindings * @note not available in python bindings

View File

@ -30,13 +30,13 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
/** return correct graphics item type. Added in v1.7 */ /** return correct graphics item type. Added in v1.7 */
virtual int type() const { return ComposerTextTable; } virtual int type() const { return ComposerTextTable; }
/*Sets the text to use for the header row for the table /**Sets the text to use for the header row for the table
* @param labels list of strings to use for each column's header row * @param labels list of strings to use for each column's header row
* @see headerLabels * @see headerLabels
*/ */
void setHeaderLabels( const QStringList& labels ) { mHeaderLabels = labels; } void setHeaderLabels( const QStringList& labels ) { mHeaderLabels = labels; }
/*Adds a row to the table /**Adds a row to the table
* @param row list of strings to use for each cell's value in the newly added row * @param row list of strings to use for each cell's value in the newly added row
* @note If row is shorter than the number of columns in the table than blank cells * @note If row is shorter than the number of columns in the table than blank cells
* will be inserted at the end of the row. If row contains more strings then the number * will be inserted at the end of the row. If row contains more strings then the number

View File

@ -217,7 +217,7 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
@return QgsComposerMap or 0 pointer if the composer map item does not exist*/ @return QgsComposerMap or 0 pointer if the composer map item does not exist*/
const QgsComposerMap* getComposerMapById( int id ) const; const QgsComposerMap* getComposerMapById( int id ) const;
/*Returns the composer html with specified id (a string as named in the /**Returns the composer html with specified id (a string as named in the
composer user interface item properties). composer user interface item properties).
@note Added in QGIS 2.0 @note Added in QGIS 2.0
@param id - A QString representing the id of the item. @param id - A QString representing the id of the item.