18 #ifndef QGSLAYOUTITEMATTRIBUTETABLE_H 19 #define QGSLAYOUTITEMATTRIBUTETABLE_H 21 #include "qgis_core.h" 58 int type()
const override;
59 QIcon
icon()
const override;
112 void setRelationId(
const QString &
id );
153 void setMaximumNumberOfFeatures(
int features );
169 void setUniqueRowsOnly(
bool uniqueOnly );
186 void setDisplayOnlyVisibleFeatures(
bool visibleOnly );
203 void setFilterToAtlasFeature(
bool filterToAtlas );
228 void setFilterFeatures(
bool filter );
248 void setFeatureFilter(
const QString &expression );
258 void setDisplayedFields(
const QStringList &fields,
bool refresh =
true );
267 QVector< QPair<int, bool> > sortAttributes()
const SIP_SKIP;
275 void setWrapString(
const QString &wrapString );
304 void disconnectCurrentMap();
314 QPointer< QgsVectorLayer > mDataDefinedVectorLayer;
327 int mMaximumNumberOfFeatures = 30;
330 bool mShowUniqueRowsOnly =
false;
333 bool mShowOnlyVisibleFeatures =
false;
336 bool mFilterToAtlasIntersection =
false;
339 bool mFilterFeatures =
false;
342 QString mFeatureFilter;
350 QList<int> fieldsToDisplay()
const;
357 void restoreFieldAliasMap(
const QMap<int, QString> &map );
363 QVariant replaceWrapChar(
const QVariant &variant )
const;
367 void removeLayer(
const QString &layerId );
373 #endif // QGSLAYOUTITEMATTRIBUTETABLE_H The class is used as a container of context for various read/write operations on other objects...
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the objects' current state.
A class to display a table in the print layout, and allow the table to span over multiple frames...
bool filterToAtlasFeature() const
Returns true if the table is set to only show features which intersect the current atlas feature...
bool writePropertiesToElement(QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const override
Stores multiframe state within an XML DOM element.
ContentSource source() const
Returns the source for attributes shown in the table body.
QgsVectorLayer * vectorLayer() const
Returns the vector layer the attribute table is currently using.
Layout graphical items for displaying a map.
virtual QIcon icon() const
Returns the item's icon.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
int maximumNumberOfFeatures() const
Returns the maximum number of features to be shown by the table.
QString featureFilter() const
Returns the current expression used to filter features for the table.
A layout table subclass that displays attributes from a vector layer.
Table shows attributes from the current atlas feature.
virtual void finalizeRestoreFromXml()
Called after all pending items have been restored from XML.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
virtual bool getTableContents(QgsLayoutTableContents &contents)=0
Fetches the contents used for the cells in the table.
bool displayOnlyVisibleFeatures() const
Returns true if the table is set to show only features visible on a corresponding map item...
virtual int type() const =0
Returns unique multiframe type id.
QgsLayoutItemMap * map() const
Returns the layout map whose extents are controlling the features shown in the table.
QString relationId() const
Returns the relation id which the table displays child features from.
ContentSource
Specifies the content source for the attribute table.
bool filterFeatures() const
Returns true if a feature filter is active on the attribute table.
Represents a vector layer which manages a vector based data sets.
QString wrapString() const
Returns the string used to wrap the contents of the table cells by.
virtual QString displayName() const
Returns the multiframe display name.
DataDefinedProperty
Data defined properties for different item types.
QVector< QgsLayoutTableRow > QgsLayoutTableContents
List of QgsLayoutTableRows, representing rows and column cell contents for a QgsLayoutTable.
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.
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...