75  return tr( 
"<Attribute table frame>" );
 
 
   80  if ( layer == mVectorLayer.
get() )
 
 
  118  QgsRelation relation = 
mLayout->project()->relationManager()->relation( mRelationId );
 
 
  140void QgsLayoutItemAttributeTable::atlasLayerChanged( 
QgsVectorLayer *layer )
 
  149  if ( mCurrentAtlasLayer )
 
  155  const bool mustRebuildColumns = 
static_cast< bool >( mCurrentAtlasLayer ) || 
mColumns.empty();
 
  156  mCurrentAtlasLayer = layer;
 
  158  if ( mustRebuildColumns )
 
  186  for ( 
const auto &field : sourceFields )
 
  188    QString currentAlias = 
source->attributeDisplayName( idx );
 
 
  197void QgsLayoutItemAttributeTable::disconnectCurrentMap()
 
  206  disconnect( mMap, &QObject::destroyed, 
this, &QgsLayoutItemAttributeTable::disconnectCurrentMap );
 
  212  return mUseConditionalStyling;
 
 
  234  disconnectCurrentMap();
 
 
  249  if ( features == mMaximumNumberOfFeatures )
 
  254  mMaximumNumberOfFeatures = features;
 
 
  261  if ( uniqueOnly == mShowUniqueRowsOnly )
 
  266  mShowUniqueRowsOnly = uniqueOnly;
 
 
  273  if ( visibleOnly == mShowOnlyVisibleFeatures )
 
  278  mShowOnlyVisibleFeatures = visibleOnly;
 
 
  285  if ( filterToAtlas == mFilterToAtlasIntersection )
 
  290  mFilterToAtlasIntersection = filterToAtlas;
 
 
  297  if ( filter == mFilterFeatures )
 
  302  mFilterFeatures = filter;
 
 
  309  if ( expression == mFeatureFilter )
 
  314  mFeatureFilter = expression;
 
 
  332  if ( !fields.isEmpty() )
 
  334    for ( 
const QString &field : fields )
 
  341      QString currentAlias = 
source->attributeDisplayName( attrIdx );
 
  352    for ( 
const QgsField &field : layerFields )
 
  354      QString currentAlias = 
source->attributeDisplayName( idx );
 
 
  369void QgsLayoutItemAttributeTable::restoreFieldAliasMap( 
const QMap<int, QString> &map )
 
  377  for ( 
int i = 0; i < 
mColumns.count(); i++ )
 
  379    int attrIdx = 
source->fields().lookupField( 
mColumns[i].attribute() );
 
  380    if ( 
map.contains( attrIdx ) )
 
  386      mColumns[i].setHeading( 
source->attributeDisplayName( attrIdx ) );
 
  412  std::unique_ptr<QgsExpression> filterExpression;
 
  413  bool activeFilter = 
false;
 
  414  if ( mFilterFeatures && !mFeatureFilter.isEmpty() )
 
  416    filterExpression = std::make_unique< QgsExpression >( mFeatureFilter );
 
  417    if ( !filterExpression->hasParserError() )
 
  424#ifdef HAVE_SERVER_PYTHON_PLUGINS 
  425  if ( 
mLayout->renderContext().featureFilterProvider() )
 
  427    mLayout->renderContext().featureFilterProvider()->filterFeatures( layer, req );
 
  433  std::unique_ptr< QgsGeometryEngine > visibleMapEngine;
 
  434  if ( mMap && mShowOnlyVisibleFeatures )
 
  453    visibleMapEngine->prepareGeometry();
 
  457  std::unique_ptr< QgsGeometryEngine > atlasGeometryEngine;
 
  458  if ( mFilterToAtlasIntersection )
 
  460    atlasGeometry = 
mLayout->reportContext().currentGeometry( layer->
crs() );
 
  461    if ( !atlasGeometry.
isNull() )
 
  463      if ( selectionRect.
isNull() )
 
  473      atlasGeometryEngine->prepareGeometry();
 
  479    QgsRelation relation = 
mLayout->project()->relationManager()->relation( mRelationId );
 
  484  if ( !selectionRect.
isEmpty() )
 
  498    req.
addOrderBy( column.attribute(), column.sortOrder() == Qt::AscendingOrder );
 
  505  mConditionalStyles.clear();
 
  508  QVector< QVector< Cell > > tempContents;
 
  511  while ( fit.
nextFeature( f ) && counter < mMaximumNumberOfFeatures )
 
  515    if ( activeFilter && filterExpression )
 
  517      QVariant result = filterExpression->evaluate( &context );
 
  519      if ( !result.toBool() )
 
  526    if ( visibleMapEngine )
 
  536    if ( mFilterToAtlasIntersection )
 
  549    if ( mUseConditionalStyling )
 
  560    QVector< Cell > currentRow;
 
  561#ifdef HAVE_SERVER_PYTHON_PLUGINS 
  564    currentRow.reserve( 
mColumns.count() );
 
  566    rowContents.reserve( 
mColumns.count() );
 
  576        if ( mUseConditionalStyling )
 
  580          styles.insert( 0, rowStyle );
 
  591          auto it = mLayerCache.constFind( column.attribute() );
 
  592          if ( it != mLayerCache.constEnd() )
 
  599            mLayerCache.insert( column.attribute(), cache );
 
  606        currentRow << Cell( v, style, f );
 
  612        std::unique_ptr< QgsExpression > expression = std::make_unique< QgsExpression >( column.attribute() );
 
  614        expression->prepare( &context );
 
  615        QVariant value = expression->evaluate( &context );
 
  617        currentRow << Cell( value, rowStyle, f );
 
  618        rowContents << value;
 
  622    if ( mShowUniqueRowsOnly )
 
  628    tempContents << currentRow;
 
  629    existingContents << rowContents;
 
  634  contents.reserve( tempContents.size() );
 
  635  mConditionalStyles.reserve( tempContents.size() );
 
  636  mFeatures.reserve( tempContents.size() );
 
  637  for ( 
auto it = tempContents.constBegin(); it != tempContents.constEnd(); ++it )
 
  640    QList< QgsConditionalStyle > rowStyles;
 
  641    row.reserve( it->size() );
 
  642    rowStyles.reserve( it->size() );
 
  644    for ( 
auto cellIt = it->constBegin(); cellIt != it->constEnd(); ++cellIt )
 
  646      row << cellIt->content;
 
  647      rowStyles << cellIt->style;
 
  648      if ( cellIt == it->constBegin() )
 
  649        mFeatures << cellIt->feature;
 
  652    mConditionalStyles << rowStyles;
 
 
  661  if ( row >= mConditionalStyles.size() )
 
  664  return mConditionalStyles.at( row ).at( column );
 
 
  675    const QFont styleFont = style.
font();
 
  676    if ( styleFont != QFont() )
 
  678      QFont newFont = format.
font();
 
  686      if ( !styleName.isEmpty() )
 
  687        newFont.setStyleName( styleName );
 
  689      newFont.setStrikeOut( styleFont.strikeOut() );
 
  690      newFont.setUnderline( styleFont.underline() );
 
  692      if ( styleName.isEmpty() )
 
  697        if ( styleFont.bold() )
 
  699        if ( styleFont.italic() )
 
 
  711  scope->setFeature( mFeatures.value( row ) );
 
  712  scope->setFields( scope->feature().fields() );
 
  713  return scope.release();
 
 
  731  if ( !mMap && !mMapUuid.isEmpty() && 
mLayout )
 
  733    mMap = qobject_cast< QgsLayoutItemMap *>( 
mLayout->itemByUuid( mMapUuid, 
true ) );
 
 
  750    mDataDefinedVectorLayer = 
nullptr;
 
  752    QString currentLayerIdentifier;
 
  754      currentLayerIdentifier = currentLayer->id();
 
  759      mDataDefinedVectorLayer = ddLayer;
 
 
  765QVariant QgsLayoutItemAttributeTable::replaceWrapChar( 
const QVariant &variant )
 const 
  768  if ( mWrapString.isEmpty() || !variant.toString().contains( mWrapString ) )
 
  771  QString replaced = variant.toString();
 
  772  replaced.replace( mWrapString, QLatin1String( 
"\n" ) );
 
  776#ifdef HAVE_SERVER_PYTHON_PLUGINS 
  783  if ( 
mLayout->renderContext().featureFilterProvider() )
 
  790      return allowedColumns;
 
  793    QHash<const QString, QSet<QString>> columnAttributesMap;
 
  794    QSet<QString> allowedAttributes;
 
  796    for ( 
const auto &
c : std::as_const( allowedColumns ) )
 
  798      if ( ! 
c.attribute().isEmpty() && ! columnAttributesMap.contains( 
c.attribute() ) )
 
  800        columnAttributesMap[ 
c.attribute() ] = QSet<QString>();
 
  803        for ( 
const auto &cref : constRefs )
 
  805          columnAttributesMap[ 
c.attribute() ].insert( cref->name() );
 
  806          allowedAttributes.insert( cref->name() );
 
  812    const QSet<QString> filteredAttributesSet( filteredAttributes.constBegin(), filteredAttributes.constEnd() );
 
  813    if ( filteredAttributesSet != allowedAttributes )
 
  815      const auto forbidden { allowedAttributes.subtract( filteredAttributesSet ) };
 
  816      allowedColumns.erase( std::remove_if( allowedColumns.begin(), allowedColumns.end(), [ &columnAttributesMap, &forbidden ]( 
QgsLayoutTableColumn & 
c ) -> 
bool 
  818        for ( const auto &f : std::as_const( forbidden ) )
 
  820          if ( columnAttributesMap[ c.attribute() ].contains( f ) )
 
  826      } ), allowedColumns.end() );
 
  831  return allowedColumns;
 
  840      return mLayout->reportContext().layer();
 
  843      if ( mDataDefinedVectorLayer )
 
  844        return mDataDefinedVectorLayer;
 
  846        return mVectorLayer.
get();
 
  850      QgsRelation relation = 
mLayout->project()->relationManager()->relation( mRelationId );
 
 
  857void QgsLayoutItemAttributeTable::removeLayer( 
const QString &layerId )
 
  861    if ( layerId == mVectorLayer->
id() )
 
  887  tableElem.setAttribute( QStringLiteral( 
"source" ), QString::number( 
static_cast< int >( mSource ) ) );
 
  888  tableElem.setAttribute( QStringLiteral( 
"relationId" ), mRelationId );
 
  889  tableElem.setAttribute( QStringLiteral( 
"showUniqueRowsOnly" ), mShowUniqueRowsOnly );
 
  890  tableElem.setAttribute( QStringLiteral( 
"showOnlyVisibleFeatures" ), mShowOnlyVisibleFeatures );
 
  891  tableElem.setAttribute( QStringLiteral( 
"filterToAtlasIntersection" ), mFilterToAtlasIntersection );
 
  892  tableElem.setAttribute( QStringLiteral( 
"maxFeatures" ), mMaximumNumberOfFeatures );
 
  893  tableElem.setAttribute( QStringLiteral( 
"filterFeatures" ), mFilterFeatures ? QStringLiteral( 
"true" ) : QStringLiteral( 
"false" ) );
 
  894  tableElem.setAttribute( QStringLiteral( 
"featureFilter" ), mFeatureFilter );
 
  895  tableElem.setAttribute( QStringLiteral( 
"wrapString" ), mWrapString );
 
  896  tableElem.setAttribute( QStringLiteral( 
"useConditionalStyling" ), mUseConditionalStyling );
 
  900    tableElem.setAttribute( QStringLiteral( 
"mapUuid" ), mMap->uuid() );
 
  905    tableElem.setAttribute( QStringLiteral( 
"vectorLayer" ), mVectorLayer.
layerId );
 
  906    tableElem.setAttribute( QStringLiteral( 
"vectorLayerName" ), mVectorLayer.
name );
 
  907    tableElem.setAttribute( QStringLiteral( 
"vectorLayerSource" ), mVectorLayer.
source );
 
  908    tableElem.setAttribute( QStringLiteral( 
"vectorLayerProvider" ), mVectorLayer.
provider );
 
 
  925  mRelationId = itemElem.attribute( QStringLiteral( 
"relationId" ), QString() );
 
  929    mCurrentAtlasLayer = 
mLayout->reportContext().layer();
 
  932  mShowUniqueRowsOnly = itemElem.attribute( QStringLiteral( 
"showUniqueRowsOnly" ), QStringLiteral( 
"0" ) ).toInt();
 
  933  mShowOnlyVisibleFeatures = itemElem.attribute( QStringLiteral( 
"showOnlyVisibleFeatures" ), QStringLiteral( 
"1" ) ).toInt();
 
  934  mFilterToAtlasIntersection = itemElem.attribute( QStringLiteral( 
"filterToAtlasIntersection" ), QStringLiteral( 
"0" ) ).toInt();
 
  935  mFilterFeatures = itemElem.attribute( QStringLiteral( 
"filterFeatures" ), QStringLiteral( 
"false" ) ) == QLatin1String( 
"true" );
 
  936  mFeatureFilter = itemElem.attribute( QStringLiteral( 
"featureFilter" ), QString() );
 
  937  mMaximumNumberOfFeatures = itemElem.attribute( QStringLiteral( 
"maxFeatures" ), QStringLiteral( 
"5" ) ).toInt();
 
  938  mWrapString = itemElem.attribute( QStringLiteral( 
"wrapString" ) );
 
  939  mUseConditionalStyling = itemElem.attribute( QStringLiteral( 
"useConditionalStyling" ), QStringLiteral( 
"0" ) ).toInt();
 
  942  mMapUuid = itemElem.attribute( QStringLiteral( 
"mapUuid" ) );
 
  952  QString layerId = itemElem.attribute( QStringLiteral( 
"vectorLayer" ) );
 
  953  QString layerName = itemElem.attribute( QStringLiteral( 
"vectorLayerName" ) );
 
  954  QString layerSource = itemElem.attribute( QStringLiteral( 
"vectorLayerSource" ) );
 
  955  QString layerProvider = itemElem.attribute( QStringLiteral( 
"vectorLayerProvider" ) );
 
  956  mVectorLayer = 
QgsVectorLayerRef( layerId, layerName, layerSource, layerProvider );
 
 
  980  if ( newLayer != prevLayer )
 
  992      mCurrentAtlasLayer = newLayer;
 
 
@ ExactIntersect
Use exact geometry intersection (slower) instead of bounding boxes.
 
@ NoFlags
No flags are set.
 
@ Reverse
Reverse/inverse transform (from destination to source)
 
QString valueAsString(int key, const QgsExpressionContext &context, const QString &defaultString=QString(), bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a string.
 
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
 
static QgsFieldFormatterRegistry * fieldFormatterRegistry()
Gets the registry of available field formatters.
 
The QgsConditionalLayerStyles class holds conditional style information for a layer.
 
QgsConditionalStyles rowStyles() const
Returns a list of row styles associated with the layer.
 
QList< QgsConditionalStyle > fieldStyles(const QString &fieldName) const
Returns the conditional styles set for the field with matching fieldName.
 
Conditional styling for a rule.
 
static QgsConditionalStyle compressStyles(const QList< QgsConditionalStyle > &styles)
Compress a list of styles into a single style.
 
static QList< QgsConditionalStyle > matchingConditionalStyles(const QList< QgsConditionalStyle > &styles, const QVariant &value, QgsExpressionContext &context)
Find and return the matching styles for the value and feature.
 
QFont font() const
The font for the style.
 
bool isValid() const
isValid Check if this rule is valid.
 
Custom exception class for Coordinate Reference System related exceptions.
 
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
 
Single scope for storing variables and functions for use within a QgsExpressionContext.
 
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
 
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
 
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
 
QgsExpressionContextScope * lastScope()
Returns the last scope added to the context.
 
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
 
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
 
void setFields(const QgsFields &fields)
Convenience function for setting a fields for the context.
 
An expression node which takes it value from a feature's field.
 
Class for parsing and evaluation of expressions (formerly called "search strings").
 
QList< const T * > findNodes() const
Returns a list of all nodes of the given class which are used in this expression.
 
virtual QStringList layerAttributes(const QgsVectorLayer *layer, const QStringList &attributes) const =0
Returns the list of visible attribute names from a list of attributes names for the given layer.
 
Wrapper for iterator of features from vector data provider or vector layer.
 
bool nextFeature(QgsFeature &f)
Fetch next feature and stores in f, returns true on success.
 
This class wraps a request for features to a vector layer (or directly its vector data provider).
 
QgsFeatureRequest & setFlags(Qgis::FeatureRequestFlags flags)
Sets flags that affect how features will be fetched.
 
QgsFeatureRequest & addOrderBy(const QString &expression, bool ascending=true)
Adds a new OrderByClause, appending it as the least important one.
 
QgsFeatureRequest & setFilterExpression(const QString &expression)
Set the filter expression.
 
QgsFeatureRequest & setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used to evaluate filter expressions.
 
QgsFeatureRequest & setFilterFid(QgsFeatureId fid)
Sets the feature ID that should be fetched.
 
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
 
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
 
bool hasGeometry() const
Returns true if the feature has an associated geometry.
 
Encapsulate a field in an attribute table or data source.
 
QgsEditorWidgetSetup editorWidgetSetup() const
Gets the editor widget setup for the field.
 
Container of fields for a vector layer.
 
QgsField at(int i) const
Returns the field at particular index (must be in range 0..N-1).
 
Q_INVOKABLE int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
 
static QString resolveFontStyleName(const QFont &font)
Attempts to resolve the style name corresponding to the specified font object.
 
static void setFontFamily(QFont &font, const QString &family)
Sets the family for a font object.
 
A geometry is the spatial representation of a feature.
 
static QgsGeometry fromQPolygonF(const QPolygonF &polygon)
Construct geometry from a QPolygonF.
 
Qgis::GeometryOperationResult transform(const QgsCoordinateTransform &ct, Qgis::TransformDirection direction=Qgis::TransformDirection::Forward, bool transformZ=false)
Transforms this geometry as described by the coordinate transform ct.
 
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
 
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
 
static QgsGeometryEngine * createGeometryEngine(const QgsAbstractGeometry *geometry, double precision=0.0)
Creates and returns a new geometry engine representing the specified geometry using precision on a gr...
 
A layout table subclass that displays attributes from a vector layer.
 
void resetColumns()
Resets the attribute table's columns to match the vector layer's fields.
 
QString wrapString() const
Returns the string used to wrap the contents of the table cells by.
 
bool readPropertiesFromElement(const QDomElement &itemElem, const QDomDocument &doc, const QgsReadWriteContext &context) override
Sets multiframe state from a DOM element.
 
ContentSource
Specifies the content source for the attribute table.
 
@ AtlasFeature
Table shows attributes from the current atlas feature.
 
@ RelationChildren
Table shows attributes from related child features.
 
@ LayerAttributes
Table shows attributes from features in a vector layer.
 
QgsVectorLayer * sourceLayer() const
Returns the source layer for the table, considering the table source mode.
 
void setDisplayedFields(const QStringList &fields, bool refresh=true)
Sets the attributes to display in the table.
 
void setUseConditionalStyling(bool enabled)
Sets whether the attribute table will be rendered using the conditional styling properties of the lin...
 
void setRelationId(const QString &id)
Sets the relation id from which to display child features.
 
void setMaximumNumberOfFeatures(int features)
Sets the maximum number of features shown by the table.
 
void setDisplayOnlyVisibleFeatures(bool visibleOnly)
Sets the attribute table to only show features which are visible in a map item.
 
void setFeatureFilter(const QString &expression)
Sets the expression used for filtering features in the table.
 
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
 
void finalizeRestoreFromXml() override
Called after all pending items have been restored from XML.
 
bool useConditionalStyling() const
Returns true if the attribute table will be rendered using the conditional styling properties of the ...
 
ContentSource source() const
Returns the source for attributes shown in the table body.
 
int type() const override
Returns unique multiframe type id.
 
QgsConditionalStyle conditionalCellStyle(int row, int column) const override
Returns the conditional style to use for the cell at row, column.
 
QgsExpressionContextScope * scopeForCell(int row, int column) const override
Creates a new QgsExpressionContextScope for the cell at row, column.
 
void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::DataDefinedProperty::AllProperties) override
Refreshes a data defined property for the multi frame by reevaluating the property's value and redraw...
 
void setFilterFeatures(bool filter)
Sets whether the feature filter is active for the attribute table.
 
QgsLayoutItemMap * map() const
Returns the layout map whose extents are controlling the features shown in the table.
 
void setUniqueRowsOnly(bool uniqueOnly)
Sets attribute table to only show unique rows.
 
QString relationId() const
Returns the relation id which the table displays child features from.
 
void setWrapString(const QString &wrapString)
Sets a string to wrap the contents of the table cells by.
 
QIcon icon() const override
Returns the item's icon.
 
void setMap(QgsLayoutItemMap *map)
Sets a layout map to use to limit the extent of features shown in the attribute table.
 
void setFilterToAtlasFeature(bool filterToAtlas)
Sets attribute table to only show features which intersect the current atlas feature.
 
QString displayName() const override
Returns the multiframe display name.
 
bool writePropertiesToElement(QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const override
Stores multiframe state within an XML DOM element.
 
bool getTableContents(QgsLayoutTableContents &contents) override
Queries the attribute table's vector layer for attributes to show in the table.
 
QgsLayoutItemAttributeTable(QgsLayout *layout)
Constructor for QgsLayoutItemAttributeTable, attached to the specified layout.
 
QgsTextFormat textFormatForCell(int row, int column) const override
Returns the text format to use for the cell at the specified row and column.
 
static QgsLayoutItemAttributeTable * create(QgsLayout *layout)
Returns a new QgsLayoutItemAttributeTable for the specified parent layout.
 
void setVectorLayer(QgsVectorLayer *layer)
Sets the vector layer from which to display feature attributes.
 
void setSource(ContentSource source)
Sets the source for attributes to show in table body.
 
Layout graphical items for displaying a map.
 
void extentChanged()
Emitted when the map's extent changes.
 
void mapRotationChanged(double newRotation)
Emitted when the map's rotation changes.
 
@ LayoutAttributeTable
Attribute table.
 
virtual void finalizeRestoreFromXml()
Called after all pending items have been restored from XML.
 
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::DataDefinedProperty::AllProperties)
Refreshes a data defined property for the multi frame by reevaluating the property's value and redraw...
 
QgsPropertyCollection mDataDefinedProperties
 
const QgsLayout * layout() const
Returns the layout the object is attached to.
 
void changed()
Emitted when the object's properties change.
 
QPointer< QgsLayout > mLayout
 
DataDefinedProperty
Data defined properties for different item types.
 
@ AttributeTableSourceLayer
Attribute table source layer.
 
@ AllProperties
All properties for item.
 
QgsFeatureFilterProvider * featureFilterProvider() const
Returns the possibly NULL feature filter provider.
 
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
 
Stores properties of a column for a QgsLayoutTable.
 
void setAttribute(const QString &attribute)
Sets the attribute name or expression used for the column's values.
 
void setHeading(const QString &heading)
Sets the heading for a column, which is the value displayed in the column's header cell.
 
A class to display a table in the print layout, and allow the table to span over multiple frames.
 
virtual void refreshAttributes()
Refreshes the contents shown in the table by querying for new data.
 
void recalculateTableSize()
Recalculates and updates the size of the table and all table frames.
 
virtual QgsExpressionContextScope * scopeForCell(int row, int column) const
Creates a new QgsExpressionContextScope for the cell at row, column.
 
bool contentsContainsRow(const QgsLayoutTableContents &contents, const QgsLayoutTableRow &row) const
Checks whether a table contents contains a given row.
 
QgsLayoutTableColumns mColumns
Columns to show in table.
 
QgsTextFormat mContentTextFormat
 
bool writePropertiesToElement(QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context) const override
Stores multiframe state within an XML DOM element.
 
QgsLayoutTableSortColumns mSortColumns
Columns to sort the table.
 
bool readPropertiesFromElement(const QDomElement &itemElem, const QDomDocument &doc, const QgsReadWriteContext &context) override
Sets multiframe state from a DOM element.
 
QgsLayoutTableContents & contents()
Returns the current contents of the table.
 
static QgsMapLayer * mapLayerFromString(const QString &string, QgsProject *project)
Resolves a string into a map layer from a given project.
 
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
 
QgsLayoutRenderContext & renderContext()
Returns a reference to the layout's render context, which stores information relating to the current ...
 
QgsCoordinateReferenceSystem crs
 
void layerModified()
Emitted when modifications has been done on layer.
 
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
 
void layerWillBeRemoved(const QString &layerId)
Emitted when a layer is about to be removed from the registry.
 
The class is used as a container of context for various read/write operations on other objects.
 
A rectangle specified with double values.
 
bool isNull() const
Test if the rectangle is null (holding no spatial information).
 
bool isEmpty() const
Returns true if the rectangle has no area.
 
QgsRectangle intersect(const QgsRectangle &rect) const
Returns the intersection with the given rectangle.
 
QgsVectorLayer * referencingLayer
 
QgsFeatureRequest getRelatedFeaturesRequest(const QgsFeature &feature) const
Creates a request to return all the features on the referencing (child) layer which have a foreign ke...
 
Container for all settings relating to text rendering.
 
void setFont(const QFont &font)
Sets the font used for rendering text.
 
void setForcedItalic(bool forced)
Sets whether the format is set to force an italic style.
 
void setForcedBold(bool forced)
Sets whether the format is set to force a bold style.
 
QFont font() const
Returns the font used for rendering text.
 
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.
 
Represents a vector layer which manages a vector based data sets.
 
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
 
QgsConditionalLayerStyles * conditionalStyles() const
Returns the conditional styles that are set for this layer.
 
QVector< QgsLayoutTableColumn > QgsLayoutTableColumns
List of column definitions for a QgsLayoutTable.
 
QVector< QgsLayoutTableRow > QgsLayoutTableContents
List of QgsLayoutTableRows, representing rows and column cell contents for a QgsLayoutTable.
 
QVector< QVariant > QgsLayoutTableRow
List of QVariants, representing a the contents of a single row in a QgsLayoutTable.
 
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
 
_LayerRef< QgsVectorLayer > QgsVectorLayerRef
 
Single variable definition for use within a QgsExpressionContextScope.
 
TYPE * resolveWeakly(const QgsProject *project, MatchType matchType=MatchType::All)
Resolves the map layer by attempting to find a matching layer in a project using a weak match.
 
QString source
Weak reference to layer public source.
 
QString name
Weak reference to layer name.
 
TYPE * get() const
Returns a pointer to the layer, or nullptr if the reference has not yet been matched to a layer.
 
QString provider
Weak reference to layer provider.
 
void setLayer(TYPE *l)
Sets the reference to point to a specified layer.
 
QString layerId
Original layer ID.