mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-10 00:05:25 -04:00
Run clang-tidy modernize-use-override to remove all the redundant virtual keywords from overridden methods, and add some missing overrides. Another benefit is that this has also added the overrides on destructors, which will cause a build failure if a base class is missing a virtual destructor.
410 lines
11 KiB
Plaintext
410 lines
11 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/composer/qgscomposerattributetablev2.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsComposerAttributeTableCompareV2
|
|
{
|
|
%Docstring
|
|
Helper class for sorting tables, takes into account sorting column and ascending / descending
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgscomposerattributetablev2.h"
|
|
%End
|
|
public:
|
|
|
|
QgsComposerAttributeTableCompareV2();
|
|
%Docstring
|
|
Constructor for QgsComposerAttributeTableCompareV2.
|
|
%End
|
|
bool operator()( const QgsComposerTableRow &m1, const QgsComposerTableRow &m2 );
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
%End
|
|
|
|
void setSortColumn( int col );
|
|
%Docstring
|
|
Sets column number to sort by
|
|
:param col: column number for sorting
|
|
%End
|
|
|
|
void setAscending( bool asc );
|
|
%Docstring
|
|
Sets sort order for column sorting
|
|
:param asc: set to true to sort in ascending order, false to sort in descending order
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
class QgsComposerAttributeTableV2: QgsComposerTableV2
|
|
{
|
|
%Docstring
|
|
A table that displays attributes from a vector layer
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgscomposerattributetablev2.h"
|
|
%End
|
|
public:
|
|
|
|
enum ContentSource
|
|
{
|
|
LayerAttributes,
|
|
AtlasFeature,
|
|
RelationChildren
|
|
};
|
|
|
|
QgsComposerAttributeTableV2( QgsComposition *composition /TransferThis/, bool createUndoCommands );
|
|
|
|
virtual QString displayName() const;
|
|
|
|
|
|
virtual bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const;
|
|
|
|
%Docstring
|
|
Writes properties specific to attribute tables
|
|
:param elem: an existing QDomElement in which to store the attribute table's properties.
|
|
:param doc: QDomDocument for the destination xml.
|
|
:param ignoreFrames: ignore frames
|
|
|
|
:rtype: bool
|
|
|
|
.. seealso:: :py:func:`readXml`
|
|
%End
|
|
|
|
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false );
|
|
|
|
%Docstring
|
|
Reads the properties specific to an attribute table from xml.
|
|
:param itemElem: a QDomElement holding the attribute table's desired properties.
|
|
:param doc: QDomDocument for the source xml.
|
|
:param ignoreFrames: ignore frames
|
|
|
|
:rtype: bool
|
|
|
|
.. seealso:: :py:func:`writeXml`
|
|
%End
|
|
|
|
virtual void addFrame( QgsComposerFrame *frame /Transfer/, bool recalcFrameSizes = true );
|
|
|
|
|
|
void setSource( const ContentSource source );
|
|
%Docstring
|
|
Sets the source for attributes to show in table body.
|
|
:param source: content source
|
|
|
|
.. seealso:: :py:func:`source`
|
|
%End
|
|
|
|
ContentSource source() const;
|
|
%Docstring
|
|
Returns the source for attributes shown in the table body.
|
|
|
|
:return: content source
|
|
:rtype: ContentSource
|
|
|
|
|
|
.. seealso:: :py:func:`setSource`
|
|
%End
|
|
|
|
QgsVectorLayer *sourceLayer();
|
|
%Docstring
|
|
Returns the source layer for the table, considering the table source mode. For example,
|
|
if the table is set to atlas feature mode, then the source layer will be the
|
|
atlas coverage layer. If the table is set to layer attributes mode, then
|
|
the source layer will be the user specified vector layer.
|
|
|
|
:return: actual source layer
|
|
:rtype: QgsVectorLayer
|
|
|
|
%End
|
|
|
|
void setVectorLayer( QgsVectorLayer *layer );
|
|
%Docstring
|
|
Sets the vector layer from which to display feature attributes
|
|
:param layer: Vector layer for attribute table
|
|
|
|
.. seealso:: :py:func:`vectorLayer`
|
|
%End
|
|
|
|
QgsVectorLayer *vectorLayer() const;
|
|
%Docstring
|
|
Returns the vector layer the attribute table is currently using
|
|
|
|
:return: attribute table's current vector layer
|
|
:rtype: QgsVectorLayer
|
|
|
|
|
|
.. seealso:: :py:func:`setVectorLayer`
|
|
%End
|
|
|
|
void setRelationId( const QString &relationId );
|
|
%Docstring
|
|
Sets the relation id from which to display child features
|
|
:param relationId: id for relation to display child features from
|
|
|
|
.. seealso:: :py:func:`relationId`
|
|
|
|
.. seealso:: :py:func:`setSource`
|
|
|
|
.. note::
|
|
|
|
only used if table source is set to RelationChildren
|
|
%End
|
|
|
|
QString relationId() const;
|
|
%Docstring
|
|
Returns the relation id which the table displays child features from
|
|
|
|
:return: relation id
|
|
:rtype: str
|
|
|
|
|
|
.. seealso:: :py:func:`setRelationId`
|
|
|
|
.. seealso:: :py:func:`source`
|
|
|
|
.. note::
|
|
|
|
only used if table source is set to RelationChildren
|
|
%End
|
|
|
|
void resetColumns();
|
|
%Docstring
|
|
Resets the attribute table's columns to match the vector layer's fields
|
|
|
|
.. seealso:: :py:func:`setVectorLayer`
|
|
%End
|
|
|
|
void setComposerMap( const QgsComposerMap *map );
|
|
%Docstring
|
|
Sets the composer map to use to limit the extent of features shown in the
|
|
attribute table. This setting only has an effect if setDisplayOnlyVisibleFeatures is
|
|
set to true. Changing the composer map forces the table to refetch features from its
|
|
vector layer, and may result in the table changing size to accommodate the new displayed
|
|
feature attributes.
|
|
:param map: QgsComposerMap which drives the extents of the table's features
|
|
|
|
.. seealso:: :py:func:`composerMap`
|
|
|
|
.. seealso:: :py:func:`setDisplayOnlyVisibleFeatures`
|
|
%End
|
|
|
|
const QgsComposerMap *composerMap() const;
|
|
%Docstring
|
|
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.
|
|
|
|
:return: composer map controlling the attribute table
|
|
:rtype: QgsComposerMap
|
|
|
|
|
|
.. seealso:: :py:func:`setComposerMap`
|
|
|
|
.. seealso:: :py:func:`displayOnlyVisibleFeatures`
|
|
%End
|
|
|
|
void setMaximumNumberOfFeatures( const int features );
|
|
%Docstring
|
|
Sets the maximum number of features shown by the table. Changing this setting may result
|
|
in the attribute table changing its size to accommodate the new number of rows, and requires
|
|
the table to refetch features from its vector layer.
|
|
:param features: maximum number of features to show in the table
|
|
|
|
.. seealso:: :py:func:`maximumNumberOfFeatures`
|
|
%End
|
|
|
|
int maximumNumberOfFeatures() const;
|
|
%Docstring
|
|
Returns the maximum number of features to be shown by the table.
|
|
|
|
:return: maximum number of features
|
|
:rtype: int
|
|
|
|
|
|
.. seealso:: :py:func:`setMaximumNumberOfFeatures`
|
|
%End
|
|
|
|
void setUniqueRowsOnly( const bool uniqueOnly );
|
|
%Docstring
|
|
Sets attribute table to only show unique rows.
|
|
:param uniqueOnly: set to true to show only unique rows. Duplicate rows
|
|
will be stripped from the table.
|
|
|
|
.. seealso:: :py:func:`uniqueRowsOnly`
|
|
%End
|
|
|
|
bool uniqueRowsOnly() const;
|
|
%Docstring
|
|
Returns true if the table is set to show only unique rows.
|
|
|
|
:return: true if table only shows unique rows and is stripping out
|
|
:rtype: bool
|
|
|
|
duplicate rows.
|
|
|
|
.. seealso:: :py:func:`setUniqueRowsOnly`
|
|
%End
|
|
|
|
void setDisplayOnlyVisibleFeatures( const bool visibleOnly );
|
|
%Docstring
|
|
Sets attribute table to only show features which are visible in a composer map item. Changing
|
|
this setting forces the table to refetch features from its vector layer, and may result in
|
|
the table changing size to accommodate the new displayed feature attributes.
|
|
:param visibleOnly: set to true to show only visible features
|
|
|
|
.. seealso:: :py:func:`displayOnlyVisibleFeatures`
|
|
|
|
.. seealso:: :py:func:`setComposerMap`
|
|
%End
|
|
|
|
bool displayOnlyVisibleFeatures() const;
|
|
%Docstring
|
|
Returns true if the table is set to show only features visible on a corresponding
|
|
composer map item.
|
|
|
|
:return: true if table only shows visible features
|
|
:rtype: bool
|
|
|
|
|
|
.. seealso:: :py:func:`composerMap`
|
|
|
|
.. seealso:: :py:func:`setDisplayOnlyVisibleFeatures`
|
|
%End
|
|
|
|
void setFilterToAtlasFeature( const bool filterToAtlas );
|
|
%Docstring
|
|
Sets attribute table to only show features which intersect the current atlas
|
|
feature.
|
|
:param filterToAtlas: set to true to show only features which intersect
|
|
the atlas feature
|
|
|
|
.. seealso:: :py:func:`filterToAtlasFeature`
|
|
%End
|
|
|
|
bool filterToAtlasFeature() const;
|
|
%Docstring
|
|
Returns true if the table is set to only show features which intersect the current atlas
|
|
feature.
|
|
|
|
:return: true if table only shows features which intersect the atlas feature
|
|
:rtype: bool
|
|
|
|
|
|
.. seealso:: :py:func:`setFilterToAtlasFeature`
|
|
%End
|
|
|
|
bool filterFeatures() const;
|
|
%Docstring
|
|
Returns true if a feature filter is active on the attribute table
|
|
|
|
:return: bool state of the feature filter
|
|
:rtype: bool
|
|
|
|
|
|
.. seealso:: :py:func:`setFilterFeatures`
|
|
|
|
.. seealso:: :py:func:`featureFilter`
|
|
%End
|
|
|
|
void setFilterFeatures( const bool filter );
|
|
%Docstring
|
|
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
|
|
the table changing size to accommodate the new displayed feature attributes.
|
|
:param filter: Set to true to enable the feature filter
|
|
|
|
.. seealso:: :py:func:`filterFeatures`
|
|
|
|
.. seealso:: :py:func:`setFeatureFilter`
|
|
%End
|
|
|
|
QString featureFilter() const;
|
|
%Docstring
|
|
Returns the current expression used to filter features for the table. The filter is only
|
|
active if filterFeatures() is true.
|
|
|
|
:return: feature filter expression
|
|
:rtype: str
|
|
|
|
|
|
.. seealso:: :py:func:`setFeatureFilter`
|
|
|
|
.. seealso:: :py:func:`filterFeatures`
|
|
%End
|
|
|
|
void setFeatureFilter( const QString &expression );
|
|
%Docstring
|
|
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
|
|
to refetch features from its vector layer, and may result in
|
|
the table changing size to accommodate the new displayed feature attributes.
|
|
:param expression: filter to use for selecting which features to display in the table
|
|
|
|
.. seealso:: :py:func:`featureFilter`
|
|
|
|
.. seealso:: :py:func:`setFilterFeatures`
|
|
%End
|
|
|
|
void setDisplayedFields( const QStringList &fields, bool refresh = true );
|
|
%Docstring
|
|
Sets the attributes to display in the table.
|
|
:param fields: list of fields names from the vector layer to show.
|
|
Set to an empty list to show all feature attributes.
|
|
:param refresh: set to true to force the table to refetch features from its vector layer
|
|
and immediately update the display of the table. This may result in the table changing size
|
|
to accommodate the new displayed feature attributes.
|
|
|
|
.. versionadded:: 2.16
|
|
%End
|
|
|
|
|
|
void setWrapString( const QString &wrapString );
|
|
%Docstring
|
|
Sets a string to wrap the contents of the table cells by. Occurrences of this string will
|
|
be replaced by a line break.
|
|
:param wrapString: string to replace with line break
|
|
|
|
.. versionadded:: 2.12
|
|
|
|
.. seealso:: :py:func:`wrapString`
|
|
%End
|
|
|
|
QString wrapString() const;
|
|
%Docstring
|
|
Returns the string used to wrap the contents of the table cells by. Occurrences of this string will
|
|
be replaced by a line break.
|
|
|
|
:return: string which will be replaced with line break
|
|
:rtype: str
|
|
|
|
|
|
.. versionadded:: 2.12
|
|
|
|
.. seealso:: :py:func:`setWrapString`
|
|
%End
|
|
|
|
|
|
virtual QgsExpressionContext createExpressionContext() const;
|
|
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/composer/qgscomposerattributetablev2.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|