40   connect( mRefreshPushButton, &QPushButton::clicked, 
this, &QgsLayoutAttributeTableWidget::mRefreshPushButton_clicked );
 
   41   connect( mAttributesPushButton, &QPushButton::clicked, 
this, &QgsLayoutAttributeTableWidget::mAttributesPushButton_clicked );
 
   42   connect( mMaximumRowsSpinBox, 
static_cast < void ( QSpinBox::* )( 
int ) 
> ( &QSpinBox::valueChanged ), 
this, &QgsLayoutAttributeTableWidget::mMaximumRowsSpinBox_valueChanged );
 
   43   connect( mMarginSpinBox, 
static_cast < void ( QDoubleSpinBox::* )( 
double ) 
> ( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutAttributeTableWidget::mMarginSpinBox_valueChanged );
 
   44   connect( mGridStrokeWidthSpinBox, 
static_cast < void ( QDoubleSpinBox::* )( 
double ) 
> ( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutAttributeTableWidget::mGridStrokeWidthSpinBox_valueChanged );
 
   46   connect( mBackgroundColorButton, &
QgsColorButton::colorChanged, 
this, &QgsLayoutAttributeTableWidget::mBackgroundColorButton_colorChanged );
 
   47   connect( mDrawHorizontalGrid, &QCheckBox::toggled, 
this, &QgsLayoutAttributeTableWidget::mDrawHorizontalGrid_toggled );
 
   48   connect( mDrawVerticalGrid, &QCheckBox::toggled, 
this, &QgsLayoutAttributeTableWidget::mDrawVerticalGrid_toggled );
 
   49   connect( mShowGridGroupCheckBox, &QgsCollapsibleGroupBoxBasic::toggled, 
this, &QgsLayoutAttributeTableWidget::mShowGridGroupCheckBox_toggled );
 
   50   connect( mShowOnlyVisibleFeaturesCheckBox, &QCheckBox::stateChanged, 
this, &QgsLayoutAttributeTableWidget::mShowOnlyVisibleFeaturesCheckBox_stateChanged );
 
   51   connect( mFeatureFilterCheckBox, &QCheckBox::stateChanged, 
this, &QgsLayoutAttributeTableWidget::mFeatureFilterCheckBox_stateChanged );
 
   52   connect( mFeatureFilterEdit, &QLineEdit::editingFinished, 
this, &QgsLayoutAttributeTableWidget::mFeatureFilterEdit_editingFinished );
 
   53   connect( mFeatureFilterButton, &QToolButton::clicked, 
this, &QgsLayoutAttributeTableWidget::mFeatureFilterButton_clicked );
 
   54   connect( mHeaderHAlignmentComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged );
 
   55   connect( mHeaderModeComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged );
 
   56   connect( mWrapStringLineEdit, &QLineEdit::editingFinished, 
this, &QgsLayoutAttributeTableWidget::mWrapStringLineEdit_editingFinished );
 
   57   connect( mAddFramePushButton, &QPushButton::clicked, 
this, &QgsLayoutAttributeTableWidget::mAddFramePushButton_clicked );
 
   58   connect( mResizeModeComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mResizeModeComboBox_currentIndexChanged );
 
   59   connect( mSourceComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mSourceComboBox_currentIndexChanged );
 
   60   connect( mRelationsComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mRelationsComboBox_currentIndexChanged );
 
   61   connect( mEmptyModeComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mEmptyModeComboBox_currentIndexChanged );
 
   62   connect( mDrawEmptyCheckBox, &QCheckBox::toggled, 
this, &QgsLayoutAttributeTableWidget::mDrawEmptyCheckBox_toggled );
 
   63   connect( mEmptyMessageLineEdit, &QLineEdit::editingFinished, 
this, &QgsLayoutAttributeTableWidget::mEmptyMessageLineEdit_editingFinished );
 
   64   connect( mIntersectAtlasCheckBox, &QCheckBox::stateChanged, 
this, &QgsLayoutAttributeTableWidget::mIntersectAtlasCheckBox_stateChanged );
 
   65   connect( mUniqueOnlyCheckBox, &QCheckBox::stateChanged, 
this, &QgsLayoutAttributeTableWidget::mUniqueOnlyCheckBox_stateChanged );
 
   66   connect( mEmptyFrameCheckBox, &QCheckBox::toggled, 
this, &QgsLayoutAttributeTableWidget::mEmptyFrameCheckBox_toggled );
 
   67   connect( mHideEmptyBgCheckBox, &QCheckBox::toggled, 
this, &QgsLayoutAttributeTableWidget::mHideEmptyBgCheckBox_toggled );
 
   68   connect( mWrapBehaviorComboBox, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutAttributeTableWidget::mWrapBehaviorComboBox_currentIndexChanged );
 
   69   connect( mAdvancedCustomizationButton, &QPushButton::clicked, 
this, &QgsLayoutAttributeTableWidget::mAdvancedCustomizationButton_clicked );
 
   70   connect( mUseConditionalStylingCheckBox, &QCheckBox::stateChanged, 
this, &QgsLayoutAttributeTableWidget::useConditionalStylingChanged );
 
   76   mContentFontToolButton->registerExpressionContextGenerator( 
this );
 
   77   mHeaderFontToolButton->registerExpressionContextGenerator( 
this );
 
   79   blockAllSignals( 
true );
 
  102   toggleAtlasSpecificControls( 
static_cast< bool >( 
coverageLayer() ) );
 
  110   mComposerMapComboBox->setCurrentLayout( mTable->layout() );
 
  114   mGridColorButton->setColorDialogTitle( tr( 
"Select Grid Color" ) );
 
  115   mGridColorButton->setAllowOpacity( 
true );
 
  116   mGridColorButton->setContext( QStringLiteral( 
"composer" ) );
 
  117   mGridColorButton->setDefaultColor( Qt::black );
 
  118   mBackgroundColorButton->setColorDialogTitle( tr( 
"Select Background Color" ) );
 
  119   mBackgroundColorButton->setAllowOpacity( 
true );
 
  120   mBackgroundColorButton->setContext( QStringLiteral( 
"composer" ) );
 
  121   mBackgroundColorButton->setShowNoColor( 
true );
 
  122   mBackgroundColorButton->setNoColorString( tr( 
"No Background" ) );
 
  132              this, &QgsLayoutAttributeTableWidget::atlasToggled );
 
  140     mLayerSourceDDBtn->registerExpressionContextGenerator( mTable );
 
  150     mainLayout->addWidget( mItemPropertiesWidget );
 
  153   connect( mHeaderFontToolButton, &
QgsFontButton::changed, 
this, &QgsLayoutAttributeTableWidget::headerFontChanged );
 
  154   connect( mContentFontToolButton, &
QgsFontButton::changed, 
this, &QgsLayoutAttributeTableWidget::contentFontChanged );
 
  159   mIntersectAtlasCheckBox->setText( tr( 
"Show only features intersecting %1 feature" ).arg( 
string ) );
 
  161   if ( atlasFeatureIndex != -1 )
 
  163     mSourceComboBox->setItemText( atlasFeatureIndex,  tr( 
"Current %1 Feature" ).arg( 
string ) );
 
  169   if ( mItemPropertiesWidget )
 
  179     context = mFrame->createExpressionContext();
 
  181     context = mTable->createExpressionContext();
 
  183   std::unique_ptr< QgsExpressionContextScope > cellScope = std::make_unique< QgsExpressionContextScope >();
 
  184   cellScope->setVariable( QStringLiteral( 
"row_number" ), 1, 
true );
 
  185   cellScope->setVariable( QStringLiteral( 
"column_number" ), 1, 
true );
 
  189                                      QStringLiteral( 
"column_number" )} );
 
  212   mTable = qobject_cast< QgsLayoutItemAttributeTable * >( multiFrame );
 
  214   mItemPropertiesWidget->
setItem( frame );
 
  227 void QgsLayoutAttributeTableWidget::mRefreshPushButton_clicked()
 
  234   mTable->refreshAttributes();
 
  237 void QgsLayoutAttributeTableWidget::mAttributesPushButton_clicked()
 
  245   QVector<QgsLayoutTableColumn> currentColumns = mTable->columns();
 
  246   QVector<QgsLayoutTableColumn> currentSortColumns = mTable->sortColumns();
 
  248   mTable->beginCommand( tr( 
"Change Table Attributes" ) );
 
  251   window()->setUpdatesEnabled( 
false );
 
  254   if ( d.exec() == QDialog::Accepted )
 
  256     mTable->refreshAttributes();
 
  258     window()->setUpdatesEnabled( 
true );
 
  260     mTable->endCommand();
 
  263     currentColumns.clear();
 
  264     currentSortColumns.clear();
 
  269     mTable->setColumns( currentColumns );
 
  270     mTable->setSortColumns( currentSortColumns );
 
  271     window()->setUpdatesEnabled( 
true );
 
  272     mTable->cancelCommand();
 
  276 void QgsLayoutAttributeTableWidget::composerMapChanged( 
QgsLayoutItem *item )
 
  283   mTable->beginCommand( tr( 
"Change Table Map" ) );
 
  284   mTable->setMap( qobject_cast< QgsLayoutItemMap * >( item ) );
 
  286   mTable->endCommand();
 
  289 void QgsLayoutAttributeTableWidget::mMaximumRowsSpinBox_valueChanged( 
int i )
 
  297   mTable->setMaximumNumberOfFeatures( i );
 
  299   mTable->endCommand();
 
  302 void QgsLayoutAttributeTableWidget::mMarginSpinBox_valueChanged( 
double d )
 
  310   mTable->setCellMargin( d );
 
  311   mTable->endCommand();
 
  314 void QgsLayoutAttributeTableWidget::headerFontChanged()
 
  319   mTable->beginCommand( tr( 
"Change Table Text Format" ) );
 
  320   mTable->setHeaderTextFormat( mHeaderFontToolButton->textFormat() );
 
  321   mTable->endCommand();
 
  324 void QgsLayoutAttributeTableWidget::contentFontChanged()
 
  331   mTable->beginCommand( tr( 
"Change Table Text Format" ) );
 
  332   mTable->setContentTextFormat( mContentFontToolButton->textFormat() );
 
  333   mTable->endCommand();
 
  336 void QgsLayoutAttributeTableWidget::mGridStrokeWidthSpinBox_valueChanged( 
double d )
 
  344   mTable->setGridStrokeWidth( d );
 
  345   mTable->endCommand();
 
  348 void QgsLayoutAttributeTableWidget::mGridColorButton_colorChanged( 
const QColor &newColor )
 
  356   mTable->setGridColor( newColor );
 
  357   mTable->endCommand();
 
  360 void QgsLayoutAttributeTableWidget::mDrawHorizontalGrid_toggled( 
bool state )
 
  367   mTable->beginCommand( tr( 
"Toggle Table Grid" ) );
 
  368   mTable->setHorizontalGrid( state );
 
  369   mTable->endCommand();
 
  372 void QgsLayoutAttributeTableWidget::mDrawVerticalGrid_toggled( 
bool state )
 
  379   mTable->beginCommand( tr( 
"Toggled Table Grid" ) );
 
  380   mTable->setVerticalGrid( state );
 
  381   mTable->endCommand();
 
  384 void QgsLayoutAttributeTableWidget::mShowGridGroupCheckBox_toggled( 
bool state )
 
  391   mTable->beginCommand( tr( 
"Toggle Table Grid" ) );
 
  392   mTable->setShowGrid( state );
 
  393   mTable->endCommand();
 
  396 void QgsLayoutAttributeTableWidget::mBackgroundColorButton_colorChanged( 
const QColor &newColor )
 
  404   mTable->setBackgroundColor( newColor );
 
  405   mTable->endCommand();
 
  408 void QgsLayoutAttributeTableWidget::updateGuiElements()
 
  410   if ( !mTable || !mFrame )
 
  415   blockAllSignals( 
true );
 
  417   mSourceComboBox->setCurrentIndex( mSourceComboBox->findData( mTable->source() ) );
 
  418   mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mTable->relationId() ) );
 
  421   if ( mTable->vectorLayer() )
 
  423     mLayerComboBox->setLayer( mTable->vectorLayer() );
 
  427       mShowOnlyVisibleFeaturesCheckBox->setChecked( 
false );
 
  428       mShowOnlyVisibleFeaturesCheckBox->setEnabled( 
false );
 
  429       mComposerMapComboBox->setEnabled( 
false );
 
  430       mComposerMapLabel->setEnabled( 
false );
 
  431       mIntersectAtlasCheckBox->setEnabled( 
false );
 
  435       mShowOnlyVisibleFeaturesCheckBox->setEnabled( 
true );
 
  436       mComposerMapComboBox->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  437       mComposerMapLabel->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  442   mComposerMapComboBox->setItem( mTable->map() );
 
  443   mMaximumRowsSpinBox->setValue( mTable->maximumNumberOfFeatures() );
 
  444   mMarginSpinBox->setValue( mTable->cellMargin() );
 
  445   mGridStrokeWidthSpinBox->setValue( mTable->gridStrokeWidth() );
 
  446   mGridColorButton->setColor( mTable->gridColor() );
 
  447   mDrawHorizontalGrid->setChecked( mTable->horizontalGrid() );
 
  448   mDrawVerticalGrid->setChecked( mTable->verticalGrid() );
 
  449   if ( mTable->showGrid() )
 
  451     mShowGridGroupCheckBox->setChecked( 
true );
 
  455     mShowGridGroupCheckBox->setChecked( 
false );
 
  457   mBackgroundColorButton->setColor( mTable->backgroundColor() );
 
  459   mHeaderFontToolButton->setTextFormat( mTable->headerTextFormat() );
 
  460   mContentFontToolButton->setTextFormat( mTable->contentTextFormat() );
 
  462   if ( mTable->displayOnlyVisibleFeatures() && mShowOnlyVisibleFeaturesCheckBox->isEnabled() )
 
  464     mShowOnlyVisibleFeaturesCheckBox->setCheckState( Qt::Checked );
 
  465     mComposerMapComboBox->setEnabled( 
true );
 
  466     mComposerMapLabel->setEnabled( 
true );
 
  470     mShowOnlyVisibleFeaturesCheckBox->setCheckState( Qt::Unchecked );
 
  471     mComposerMapComboBox->setEnabled( 
false );
 
  472     mComposerMapLabel->setEnabled( 
false );
 
  475   mUniqueOnlyCheckBox->setChecked( mTable->uniqueRowsOnly() );
 
  476   mIntersectAtlasCheckBox->setChecked( mTable->filterToAtlasFeature() );
 
  477   mFeatureFilterEdit->setText( mTable->featureFilter() );
 
  478   mFeatureFilterCheckBox->setCheckState( mTable->filterFeatures() ? Qt::Checked : Qt::Unchecked );
 
  479   mFeatureFilterEdit->setEnabled( mTable->filterFeatures() );
 
  480   mFeatureFilterButton->setEnabled( mTable->filterFeatures() );
 
  481   mUseConditionalStylingCheckBox->setChecked( mTable->useConditionalStyling() );
 
  483   mHeaderHAlignmentComboBox->setCurrentIndex( mHeaderHAlignmentComboBox->findData( mTable->headerHAlignment() ) );
 
  484   mHeaderModeComboBox->setCurrentIndex( mHeaderModeComboBox->findData( mTable->headerMode() ) );
 
  486   mEmptyModeComboBox->setCurrentIndex( mEmptyModeComboBox->findData( mTable->emptyTableBehavior() ) );
 
  487   mEmptyMessageLineEdit->setText( mTable->emptyTableMessage() );
 
  490   mDrawEmptyCheckBox->setChecked( mTable->showEmptyRows() );
 
  491   mWrapStringLineEdit->setText( mTable->wrapString() );
 
  492   mWrapBehaviorComboBox->setCurrentIndex( mWrapBehaviorComboBox->findData( mTable->wrapBehavior() ) );
 
  494   mResizeModeComboBox->setCurrentIndex( mResizeModeComboBox->findData( mTable->resizeMode() ) );
 
  497   mEmptyFrameCheckBox->setChecked( mFrame->hidePageIfEmpty() );
 
  498   mHideEmptyBgCheckBox->setChecked( mFrame->hideBackgroundIfEmpty() );
 
  502   toggleSourceControls();
 
  504   blockAllSignals( 
false );
 
  507 void QgsLayoutAttributeTableWidget::atlasToggled()
 
  514   toggleAtlasSpecificControls( atlasEnabled );
 
  519   whileBlocking( mSourceComboBox )->setCurrentIndex( mSourceComboBox->findData( mTable->source() ) );
 
  521   if ( !atlasEnabled && mTable->filterToAtlasFeature() )
 
  523     mTable->setFilterToAtlasFeature( 
false );
 
  527 void QgsLayoutAttributeTableWidget::updateRelationsCombo()
 
  529   mRelationsComboBox->blockSignals( 
true );
 
  530   mRelationsComboBox->clear();
 
  538       mRelationsComboBox->addItem( relation.name(), relation.id() );
 
  542       mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mTable->relationId() ) );
 
  546   mRelationsComboBox->blockSignals( 
false );
 
  549 void QgsLayoutAttributeTableWidget::toggleAtlasSpecificControls( 
const bool atlasEnabled )
 
  559     mRelationsComboBox->blockSignals( 
true );
 
  560     mRelationsComboBox->setEnabled( 
false );
 
  561     mRelationsComboBox->clear();
 
  562     mRelationsComboBox->blockSignals( 
false );
 
  563     mIntersectAtlasCheckBox->setEnabled( 
false );
 
  579     updateRelationsCombo();
 
  580     mRelationsComboBox->setEnabled( 
true );
 
  581     mIntersectAtlasCheckBox->setEnabled( mTable->layout()->reportContext().layer() && mTable->layout()->reportContext().layer()->geometryType() != 
QgsWkbTypes::NullGeometry );
 
  585 void QgsLayoutAttributeTableWidget::blockAllSignals( 
bool b )
 
  587   mSourceComboBox->blockSignals( b );
 
  588   mLayerComboBox->blockSignals( b );
 
  589   mComposerMapComboBox->blockSignals( b );
 
  590   mMaximumRowsSpinBox->blockSignals( b );
 
  591   mMarginSpinBox->blockSignals( b );
 
  592   mGridColorButton->blockSignals( b );
 
  593   mGridStrokeWidthSpinBox->blockSignals( b );
 
  594   mBackgroundColorButton->blockSignals( b );
 
  595   mDrawHorizontalGrid->blockSignals( b );
 
  596   mDrawVerticalGrid->blockSignals( b );
 
  597   mShowGridGroupCheckBox->blockSignals( b );
 
  598   mShowOnlyVisibleFeaturesCheckBox->blockSignals( b );
 
  599   mUniqueOnlyCheckBox->blockSignals( b );
 
  600   mIntersectAtlasCheckBox->blockSignals( b );
 
  601   mFeatureFilterEdit->blockSignals( b );
 
  602   mFeatureFilterCheckBox->blockSignals( b );
 
  603   mHeaderHAlignmentComboBox->blockSignals( b );
 
  604   mHeaderModeComboBox->blockSignals( b );
 
  605   mResizeModeComboBox->blockSignals( b );
 
  606   mRelationsComboBox->blockSignals( b );
 
  607   mEmptyModeComboBox->blockSignals( b );
 
  608   mEmptyMessageLineEdit->blockSignals( b );
 
  609   mEmptyFrameCheckBox->blockSignals( b );
 
  610   mHideEmptyBgCheckBox->blockSignals( b );
 
  611   mDrawEmptyCheckBox->blockSignals( b );
 
  612   mWrapStringLineEdit->blockSignals( b );
 
  613   mWrapBehaviorComboBox->blockSignals( b );
 
  614   mContentFontToolButton->blockSignals( b );
 
  615   mHeaderFontToolButton->blockSignals( b );
 
  618 void QgsLayoutAttributeTableWidget::setMaximumNumberOfFeatures( 
int n )
 
  623 void QgsLayoutAttributeTableWidget::mShowOnlyVisibleFeaturesCheckBox_stateChanged( 
int state )
 
  630   mTable->beginCommand( tr( 
"Toggle Visible Features Only" ) );
 
  631   bool showOnlyVisibleFeatures = ( state == Qt::Checked );
 
  632   mTable->setDisplayOnlyVisibleFeatures( showOnlyVisibleFeatures );
 
  634   mTable->endCommand();
 
  637   mComposerMapComboBox->setEnabled( state == Qt::Checked );
 
  638   mComposerMapLabel->setEnabled( state == Qt::Checked );
 
  641 void QgsLayoutAttributeTableWidget::mUniqueOnlyCheckBox_stateChanged( 
int state )
 
  648   mTable->beginCommand( tr( 
"Toggle Table Filter Duplicates" ) );
 
  649   mTable->setUniqueRowsOnly( state == Qt::Checked );
 
  651   mTable->endCommand();
 
  654 void QgsLayoutAttributeTableWidget::mEmptyFrameCheckBox_toggled( 
bool checked )
 
  661   mFrame->beginCommand( tr( 
"Toggle Empty Frame Mode" ) );
 
  662   mFrame->setHidePageIfEmpty( checked );
 
  663   mFrame->endCommand();
 
  666 void QgsLayoutAttributeTableWidget::mHideEmptyBgCheckBox_toggled( 
bool checked )
 
  673   mFrame->beginCommand( tr( 
"Toggle Background Display" ) );
 
  674   mFrame->setHideBackgroundIfEmpty( checked );
 
  675   mFrame->endCommand();
 
  678 void QgsLayoutAttributeTableWidget::mIntersectAtlasCheckBox_stateChanged( 
int state )
 
  685   mTable->beginCommand( tr( 
"Toggle Table Atlas Filter" ) );
 
  686   bool filterToAtlas = ( state == Qt::Checked );
 
  687   mTable->setFilterToAtlasFeature( filterToAtlas );
 
  689   mTable->endCommand();
 
  692 void QgsLayoutAttributeTableWidget::mFeatureFilterCheckBox_stateChanged( 
int state )
 
  699   if ( state == Qt::Checked )
 
  701     mFeatureFilterEdit->setEnabled( 
true );
 
  702     mFeatureFilterButton->setEnabled( 
true );
 
  706     mFeatureFilterEdit->setEnabled( 
false );
 
  707     mFeatureFilterButton->setEnabled( 
false );
 
  710   mTable->beginCommand( tr( 
"Toggle Table Feature Filter" ) );
 
  711   mTable->setFilterFeatures( state == Qt::Checked );
 
  713   mTable->endCommand();
 
  716 void QgsLayoutAttributeTableWidget::mFeatureFilterEdit_editingFinished()
 
  723   mTable->beginCommand( tr( 
"Change Table Feature Filter" ) );
 
  724   mTable->setFeatureFilter( mFeatureFilterEdit->text() );
 
  726   mTable->endCommand();
 
  729 void QgsLayoutAttributeTableWidget::mFeatureFilterButton_clicked()
 
  737   QgsExpressionBuilderDialog exprDlg( mTable->sourceLayer(), mFeatureFilterEdit->text(), 
this, QStringLiteral( 
"generic" ), context );
 
  738   exprDlg.setWindowTitle( tr( 
"Expression Based Filter" ) );
 
  739   if ( exprDlg.exec() == QDialog::Accepted )
 
  741     QString expression = exprDlg.expressionText();
 
  742     if ( !expression.isEmpty() )
 
  744       mFeatureFilterEdit->setText( expression );
 
  745       mTable->beginCommand( tr( 
"Change Table Feature Filter" ) );
 
  746       mTable->setFeatureFilter( mFeatureFilterEdit->text() );
 
  748       mTable->endCommand();
 
  753 void QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged( 
int )
 
  760   mTable->beginCommand( tr( 
"Change Table Alignment" ) );
 
  762   mTable->endCommand();
 
  765 void QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged( 
int )
 
  772   mTable->beginCommand( tr( 
"Change Table Header Mode" ) );
 
  774   mTable->endCommand();
 
  777 void QgsLayoutAttributeTableWidget::mWrapStringLineEdit_editingFinished()
 
  784   mTable->beginCommand( tr( 
"Change Table Wrap String" ) );
 
  785   mTable->setWrapString( mWrapStringLineEdit->text() );
 
  786   mTable->endCommand();
 
  789 void QgsLayoutAttributeTableWidget::changeLayer( 
QgsMapLayer *layer )
 
  802   mTable->beginCommand( tr( 
"Change Table Layer" ) );
 
  803   mTable->setVectorLayer( vl );
 
  805   mTable->endCommand();
 
  810     mShowOnlyVisibleFeaturesCheckBox->setChecked( 
false );
 
  811     mShowOnlyVisibleFeaturesCheckBox->setEnabled( 
false );
 
  812     mComposerMapComboBox->setEnabled( 
false );
 
  813     mComposerMapLabel->setEnabled( 
false );
 
  814     mIntersectAtlasCheckBox->setEnabled( 
false );
 
  818     mShowOnlyVisibleFeaturesCheckBox->setEnabled( 
true );
 
  819     mComposerMapComboBox->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  820     mComposerMapLabel->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  825 void QgsLayoutAttributeTableWidget::mAddFramePushButton_clicked()
 
  827   if ( !mTable || !mFrame )
 
  833   QPointF pos = mFrame->pos();
 
  835   pos.ry() += mFrame->rect().height() + 10;
 
  837   QgsLayoutFrame *newFrame = mTable->createNewFrame( mFrame, pos, mFrame->rect().size() );
 
  838   mTable->recalculateFrameSizes();
 
  841   if ( 
QgsLayout *layout = mTable->layout() )
 
  843     layout->setSelectedItem( newFrame );
 
  847 void QgsLayoutAttributeTableWidget::mResizeModeComboBox_currentIndexChanged( 
int index )
 
  854   mTable->beginCommand( tr( 
"Change Resize Mode" ) );
 
  856   mTable->endCommand();
 
  861 void QgsLayoutAttributeTableWidget::mSourceComboBox_currentIndexChanged( 
int index )
 
  868   mTable->beginCommand( tr( 
"Change Table Source" ) );
 
  870   mTable->endCommand();
 
  872   toggleSourceControls();
 
  875 void QgsLayoutAttributeTableWidget::mRelationsComboBox_currentIndexChanged( 
int index )
 
  882   mTable->beginCommand( tr( 
"Change Table Source Relation" ) );
 
  883   mTable->setRelationId( mRelationsComboBox->itemData( index ).toString() );
 
  884   mTable->endCommand();
 
  887 void QgsLayoutAttributeTableWidget::mEmptyModeComboBox_currentIndexChanged( 
int index )
 
  894   mTable->beginCommand( tr( 
"Change Empty Table Behavior" ) );
 
  896   mTable->endCommand();
 
  901 void QgsLayoutAttributeTableWidget::mWrapBehaviorComboBox_currentIndexChanged( 
int index )
 
  908   mTable->beginCommand( tr( 
"Change Table Wrap Mode" ) );
 
  910   mTable->endCommand();
 
  913 void QgsLayoutAttributeTableWidget::mAdvancedCustomizationButton_clicked()
 
  924 void QgsLayoutAttributeTableWidget::useConditionalStylingChanged( 
bool checked )
 
  931   mTable->beginCommand( tr( 
"Toggle Table Conditional Styling" ) );
 
  932   mTable->setUseConditionalStyling( checked );
 
  934   mTable->endCommand();
 
  937 void QgsLayoutAttributeTableWidget::mDrawEmptyCheckBox_toggled( 
bool checked )
 
  944   mTable->beginCommand( tr( 
"Change Show Empty Rows" ) );
 
  945   mTable->setShowEmptyRows( checked );
 
  946   mTable->endCommand();
 
  949 void QgsLayoutAttributeTableWidget::mEmptyMessageLineEdit_editingFinished()
 
  956   mTable->beginCommand( tr( 
"Change Empty Table Message" ) );
 
  957   mTable->setEmptyTableMessage( mEmptyMessageLineEdit->text() );
 
  958   mTable->endCommand();
 
  961 void QgsLayoutAttributeTableWidget::toggleSourceControls()
 
  963   switch ( mTable->source() )
 
  966       mLayerComboBox->setEnabled( 
true );
 
  967       mLayerComboBox->setVisible( 
true );
 
  968       mLayerSourceDDBtn->setVisible( 
true );
 
  969       mLayerLabel->setVisible( 
true );
 
  970       mRelationsComboBox->setEnabled( 
false );
 
  971       mRelationsComboBox->setVisible( 
false );
 
  972       mRelationLabel->setVisible( 
false );
 
  973       mMaximumRowsSpinBox->setEnabled( 
true );
 
  974       mMaxNumFeaturesLabel->setEnabled( 
true );
 
  975       mShowOnlyVisibleFeaturesCheckBox->setEnabled( mTable->vectorLayer() && mTable->vectorLayer()->geometryType() != 
QgsWkbTypes::NullGeometry );
 
  976       mShowOnlyVisibleFeaturesCheckBox->setChecked( mTable->vectorLayer() && mTable->vectorLayer()->geometryType() != 
QgsWkbTypes::NullGeometry && mTable->displayOnlyVisibleFeatures() );
 
  977       mComposerMapComboBox->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  978       mComposerMapLabel->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  979       mIntersectAtlasCheckBox->setEnabled( mTable->vectorLayer() && mTable->vectorLayer()->geometryType() != 
QgsWkbTypes::NullGeometry 
  983       mLayerComboBox->setEnabled( 
false );
 
  984       mLayerComboBox->setVisible( 
false );
 
  985       mLayerSourceDDBtn->setVisible( 
false );
 
  986       mLayerLabel->setVisible( 
false );
 
  987       mRelationsComboBox->setEnabled( 
false );
 
  988       mRelationsComboBox->setVisible( 
false );
 
  989       mRelationLabel->setVisible( 
false );
 
  990       mMaximumRowsSpinBox->setEnabled( 
false );
 
  991       mMaxNumFeaturesLabel->setEnabled( 
false );
 
  992       mShowOnlyVisibleFeaturesCheckBox->setEnabled( mTable->sourceLayer() && mTable->sourceLayer()->geometryType() != 
QgsWkbTypes::NullGeometry );
 
  993       mShowOnlyVisibleFeaturesCheckBox->setChecked( mTable->sourceLayer() && mTable->sourceLayer()->geometryType() != 
QgsWkbTypes::NullGeometry && mTable->displayOnlyVisibleFeatures() );
 
  994       mComposerMapComboBox->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  995       mComposerMapLabel->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
  996       mIntersectAtlasCheckBox->setEnabled( 
false );
 
  999       mLayerComboBox->setEnabled( 
false );
 
 1000       mLayerComboBox->setVisible( 
false );
 
 1001       mLayerLabel->setVisible( 
false );
 
 1002       mLayerSourceDDBtn->setVisible( 
false );
 
 1003       mRelationsComboBox->setEnabled( 
true );
 
 1004       mRelationsComboBox->setVisible( 
true );
 
 1005       mRelationLabel->setVisible( 
true );
 
 1006       mMaximumRowsSpinBox->setEnabled( 
true );
 
 1007       mMaxNumFeaturesLabel->setEnabled( 
true );
 
 1009       mShowOnlyVisibleFeaturesCheckBox->setEnabled( 
true );
 
 1010       mComposerMapComboBox->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
 1011       mComposerMapLabel->setEnabled( mShowOnlyVisibleFeaturesCheckBox->isChecked() );
 
A generic dialog for building expression strings.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
void toggled(bool)
Emitted when atlas is enabled or disabled.
bool enabled() const
Returns whether the atlas generation is enabled.
A dialog to select what attributes to display (in the table item), set the column properties and spec...
Base class for frame items, which form a layout multiframe item.
QgsLayoutMultiFrame * multiFrame() const
Returns the parent multiframe for the frame.
A layout table subclass that displays attributes from a vector layer.
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.
void itemChanged(QgsLayoutItem *item)
Emitted whenever the currently selected item changes.
@ LayoutAttributeTable
Attribute table.
Base class for graphical items within a QgsLayout.
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
virtual int type() const =0
Returns unique multiframe type id.
ResizeMode
Specifies the behavior for creating new frames to fit the multiframe's content.
@ UseExistingFrames
Don't automatically create new frames, just use existing frames.
@ ExtendToNextPage
Creates new full page frames on the following page(s) until the entire multiframe content is visible.
@ UndoTableMaximumFeatures
Maximum features in table.
@ UndoTableBackgroundColor
Table background color.
@ UndoTableGridStrokeWidth
Table grid stroke width.
@ UndoTableGridColor
Table grid color.
@ UndoTableMargin
Table margins.
void changed()
Emitted when the object's properties change.
@ AttributeTableSourceLayer
Attribute table source layer.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
A dialog for customization of the cell background colors for a QgsLayoutTable.
HeaderMode
Controls where headers are shown in the table.
@ FirstFrame
Header shown on first frame only.
@ AllFrames
Headers shown on all frames.
@ NoHeaders
No headers shown for table.
WrapBehavior
Controls how long strings in the table are handled.
@ WrapText
Text which doesn't fit inside the cell is wrapped. Note that this only applies to text in columns wit...
@ TruncateText
Text which doesn't fit inside the cell is truncated.
HeaderHAlignment
Controls how headers are horizontally aligned in a table.
@ HeaderRight
Align headers right.
@ HeaderLeft
Align headers left.
@ HeaderCenter
Align headers to center.
@ FollowColumn
Header uses the same alignment as the column.
EmptyTableMode
Controls how empty tables are displayed.
@ HideTable
Hides entire table if empty.
@ ShowMessage
Shows preset message instead of table contents.
@ HeadersOnly
Show header rows only.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
void layerChanged(QgsMapLayer *layer)
Emitted whenever the currently selected layer changes.
Base class for all map layer types.
Interface for master layout type objects, such as print layouts and reports.
QgsRelationManager * relationManager
static QgsProject * instance()
Returns the QgsProject singleton instance.
QList< QgsRelation > referencedRelations(const QgsVectorLayer *layer=nullptr) const
Gets all relations where this layer is the referenced part (i.e.
void changed()
Emitted when relations are added or removed to the manager.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.