QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSLAYOUTITEMATTRIBUTETABLE_H
19 #define QGSLAYOUTITEMATTRIBUTETABLE_H
21 #include "qgis_core.h"
57 int type()
const override;
58 QIcon
icon()
const override;
70 void setSource( ContentSource source );
111 void setRelationId(
const QString &
id );
152 void setMaximumNumberOfFeatures(
int features );
168 void setUniqueRowsOnly(
bool uniqueOnly );
185 void setDisplayOnlyVisibleFeatures(
bool visibleOnly );
202 void setFilterToAtlasFeature(
bool filterToAtlas );
227 void setFilterFeatures(
bool filter );
247 void setFeatureFilter(
const QString &expression );
257 void setDisplayedFields(
const QStringList &fields,
bool refresh =
true );
265 void setWrapString(
const QString &wrapString );
297 bool useConditionalStyling()
const;
306 void setUseConditionalStyling(
bool enabled );
315 void disconnectCurrentMap();
320 ContentSource mSource = LayerAttributes;
325 QPointer< QgsVectorLayer > mDataDefinedVectorLayer;
338 int mMaximumNumberOfFeatures = 30;
341 bool mShowUniqueRowsOnly =
false;
344 bool mShowOnlyVisibleFeatures =
false;
347 bool mFilterToAtlasIntersection =
false;
350 bool mFilterFeatures =
false;
353 QString mFeatureFilter;
357 bool mUseConditionalStyling =
false;
359 QList< QList< QgsConditionalStyle > > mConditionalStyles;
360 QList< QgsFeature > mFeatures;
369 , feature( feature ) {}
379 QList<int> fieldsToDisplay()
const;
386 void restoreFieldAliasMap(
const QMap<int, QString> &map );
392 QVariant replaceWrapChar(
const QVariant &variant )
const;
396 void removeLayer(
const QString &layerId );
402 #endif // QGSLAYOUTITEMATTRIBUTETABLE_H
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QVector< QgsLayoutTableRow > QgsLayoutTableContents
List of QgsLayoutTableRows, representing rows and column cell contents for a QgsLayoutTable.
The class is used as a container of context for various read/write operations on other objects.
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::AllProperties)
Refreshes a data defined property for the multi frame by reevaluating the property's value and redraw...
QString featureFilter() const
Returns the current expression used to filter features for the table.
virtual void finalizeRestoreFromXml()
Called after all pending items have been restored from XML.
QString relationId() const
Returns the relation id which the table displays child features from.
bool writePropertiesToElement(QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const override
Stores multiframe state within an XML DOM element.
virtual QIcon icon() const
Returns the item's icon.
Conditional styling for a rule.
int maximumNumberOfFeatures() const
Returns the maximum number of features to be shown by the table.
bool uniqueRowsOnly() const
Returns true if the table is set to show only unique rows.
bool readPropertiesFromElement(const QDomElement &itemElem, const QDomDocument &doc, const QgsReadWriteContext &context) override
Sets multiframe state from a DOM element.
@ AllProperties
All properties for item.
virtual int type() const =0
Returns unique multiframe type id.
virtual QgsExpressionContextScope * scopeForCell(int row, int column) const
Creates a new QgsExpressionContextScope for the cell at row, column.
virtual bool getTableContents(QgsLayoutTableContents &contents)=0
Fetches the contents used for the cells in the table.
ContentSource
Specifies the content source for the attribute table.
A layout table subclass that displays attributes from a vector layer.
A class to display a table in the print layout, and allow the table to span over multiple frames.
QString wrapString() const
Returns the string used to wrap the contents of the table cells by.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Layout graphical items for displaying a map.
bool displayOnlyVisibleFeatures() const
Returns true if the table is set to show only features visible on a corresponding map item.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Represents a vector layer which manages a vector based data sets.
bool filterToAtlasFeature() const
Returns true if the table is set to only show features which intersect the current atlas feature.
@ AtlasFeature
Table shows attributes from the current atlas feature.
bool filterFeatures() const
Returns true if a feature filter is active on the attribute table.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual QgsConditionalStyle conditionalCellStyle(int row, int column) const
Returns the conditional style to use for the cell at row, column.
virtual QString displayName() const
Returns the multiframe display name.
ContentSource source() const
Returns the source for attributes shown in the table body.
QgsLayoutItemMap * map() const
Returns the layout map whose extents are controlling the features shown in the table.
QgsVectorLayer * vectorLayer() const
Returns the vector layer the attribute table is currently using.
DataDefinedProperty
Data defined properties for different item types.