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( mHeaderFontColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutAttributeTableWidget::mHeaderFontColorButton_colorChanged );
48 connect( mContentFontColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutAttributeTableWidget::mContentFontColorButton_colorChanged );
49 connect( mDrawHorizontalGrid, &QCheckBox::toggled,
this, &QgsLayoutAttributeTableWidget::mDrawHorizontalGrid_toggled );
50 connect( mDrawVerticalGrid, &QCheckBox::toggled,
this, &QgsLayoutAttributeTableWidget::mDrawVerticalGrid_toggled );
51 connect( mShowGridGroupCheckBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutAttributeTableWidget::mShowGridGroupCheckBox_toggled );
52 connect( mShowOnlyVisibleFeaturesCheckBox, &QCheckBox::stateChanged,
this, &QgsLayoutAttributeTableWidget::mShowOnlyVisibleFeaturesCheckBox_stateChanged );
53 connect( mFeatureFilterCheckBox, &QCheckBox::stateChanged,
this, &QgsLayoutAttributeTableWidget::mFeatureFilterCheckBox_stateChanged );
54 connect( mFeatureFilterEdit, &QLineEdit::editingFinished,
this, &QgsLayoutAttributeTableWidget::mFeatureFilterEdit_editingFinished );
55 connect( mFeatureFilterButton, &QToolButton::clicked,
this, &QgsLayoutAttributeTableWidget::mFeatureFilterButton_clicked );
56 connect( mHeaderHAlignmentComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged );
57 connect( mHeaderModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged );
58 connect( mWrapStringLineEdit, &QLineEdit::editingFinished,
this, &QgsLayoutAttributeTableWidget::mWrapStringLineEdit_editingFinished );
59 connect( mAddFramePushButton, &QPushButton::clicked,
this, &QgsLayoutAttributeTableWidget::mAddFramePushButton_clicked );
60 connect( mResizeModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mResizeModeComboBox_currentIndexChanged );
61 connect( mSourceComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mSourceComboBox_currentIndexChanged );
62 connect( mRelationsComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mRelationsComboBox_currentIndexChanged );
63 connect( mEmptyModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mEmptyModeComboBox_currentIndexChanged );
64 connect( mDrawEmptyCheckBox, &QCheckBox::toggled,
this, &QgsLayoutAttributeTableWidget::mDrawEmptyCheckBox_toggled );
65 connect( mEmptyMessageLineEdit, &QLineEdit::editingFinished,
this, &QgsLayoutAttributeTableWidget::mEmptyMessageLineEdit_editingFinished );
66 connect( mIntersectAtlasCheckBox, &QCheckBox::stateChanged,
this, &QgsLayoutAttributeTableWidget::mIntersectAtlasCheckBox_stateChanged );
67 connect( mUniqueOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsLayoutAttributeTableWidget::mUniqueOnlyCheckBox_stateChanged );
68 connect( mEmptyFrameCheckBox, &QCheckBox::toggled,
this, &QgsLayoutAttributeTableWidget::mEmptyFrameCheckBox_toggled );
69 connect( mHideEmptyBgCheckBox, &QCheckBox::toggled,
this, &QgsLayoutAttributeTableWidget::mHideEmptyBgCheckBox_toggled );
70 connect( mWrapBehaviorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutAttributeTableWidget::mWrapBehaviorComboBox_currentIndexChanged );
71 connect( mAdvancedCustomizationButton, &QPushButton::clicked,
this, &QgsLayoutAttributeTableWidget::mAdvancedCustomizationButton_clicked );
72 connect( mUseConditionalStylingCheckBox, &QCheckBox::stateChanged,
this, &QgsLayoutAttributeTableWidget::useConditionalStylingChanged );
78 blockAllSignals(
true );
101 toggleAtlasSpecificControls(
static_cast< bool >(
coverageLayer() ) );
109 mComposerMapComboBox->setCurrentLayout( mTable->layout() );
113 mHeaderFontColorButton->setColorDialogTitle( tr(
"Select Header Font Color" ) );
114 mHeaderFontColorButton->setAllowOpacity(
true );
115 mHeaderFontColorButton->setContext( QStringLiteral(
"composer" ) );
116 mContentFontColorButton->setColorDialogTitle( tr(
"Select Content Font Color" ) );
117 mContentFontColorButton->setAllowOpacity(
true );
118 mContentFontColorButton->setContext( QStringLiteral(
"composer" ) );
119 mGridColorButton->setColorDialogTitle( tr(
"Select Grid Color" ) );
120 mGridColorButton->setAllowOpacity(
true );
121 mGridColorButton->setContext( QStringLiteral(
"composer" ) );
122 mGridColorButton->setDefaultColor( Qt::black );
123 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
124 mBackgroundColorButton->setAllowOpacity(
true );
125 mBackgroundColorButton->setContext( QStringLiteral(
"composer" ) );
126 mBackgroundColorButton->setShowNoColor(
true );
127 mBackgroundColorButton->setNoColorString( tr(
"No Background" ) );
137 this, &QgsLayoutAttributeTableWidget::atlasToggled );
145 mLayerSourceDDBtn->registerExpressionContextGenerator( mTable );
155 mainLayout->addWidget( mItemPropertiesWidget );
158 connect( mHeaderFontToolButton, &
QgsFontButton::changed,
this, &QgsLayoutAttributeTableWidget::headerFontChanged );
159 connect( mContentFontToolButton, &
QgsFontButton::changed,
this, &QgsLayoutAttributeTableWidget::contentFontChanged );
164 mIntersectAtlasCheckBox->setText( tr(
"Show only features intersecting %1 feature" ).arg(
string ) );
166 if ( atlasFeatureIndex != -1 )
168 mSourceComboBox->setItemText( atlasFeatureIndex, tr(
"Current %1 Feature" ).arg(
string ) );
174 if ( mItemPropertiesWidget )
196 mTable = qobject_cast< QgsLayoutItemAttributeTable * >( multiFrame );
198 mItemPropertiesWidget->
setItem( frame );
211 void QgsLayoutAttributeTableWidget::mRefreshPushButton_clicked()
218 mTable->refreshAttributes();
221 void QgsLayoutAttributeTableWidget::mAttributesPushButton_clicked()
229 QVector<QgsLayoutTableColumn> currentColumns = mTable->columns();
230 QVector<QgsLayoutTableColumn> currentSortColumns = mTable->sortColumns();
232 mTable->beginCommand( tr(
"Change Table Attributes" ) );
235 window()->setUpdatesEnabled(
false );
238 if ( d.exec() == QDialog::Accepted )
240 mTable->refreshAttributes();
242 window()->setUpdatesEnabled(
true );
244 mTable->endCommand();
247 currentColumns.clear();
248 currentSortColumns.clear();
253 mTable->setColumns( currentColumns );
254 mTable->setSortColumns( currentSortColumns );
255 window()->setUpdatesEnabled(
true );
256 mTable->cancelCommand();
260 void QgsLayoutAttributeTableWidget::composerMapChanged(
QgsLayoutItem *item )
267 mTable->beginCommand( tr(
"Change Table Map" ) );
268 mTable->setMap( qobject_cast< QgsLayoutItemMap * >( item ) );
270 mTable->endCommand();
273 void QgsLayoutAttributeTableWidget::mMaximumRowsSpinBox_valueChanged(
int i )
281 mTable->setMaximumNumberOfFeatures( i );
283 mTable->endCommand();
286 void QgsLayoutAttributeTableWidget::mMarginSpinBox_valueChanged(
double d )
294 mTable->setCellMargin( d );
295 mTable->endCommand();
298 void QgsLayoutAttributeTableWidget::headerFontChanged()
303 mTable->beginCommand( tr(
"Change Table Font" ) );
304 mTable->setHeaderFont( mHeaderFontToolButton->currentFont() );
305 mTable->endCommand();
308 void QgsLayoutAttributeTableWidget::mHeaderFontColorButton_colorChanged(
const QColor &newColor )
316 mTable->setHeaderFontColor( newColor );
317 mTable->endCommand();
320 void QgsLayoutAttributeTableWidget::contentFontChanged()
327 mTable->beginCommand( tr(
"Change Table Font" ) );
328 mTable->setContentFont( mContentFontToolButton->currentFont() );
329 mTable->endCommand();
332 void QgsLayoutAttributeTableWidget::mContentFontColorButton_colorChanged(
const QColor &newColor )
340 mTable->setContentFontColor( newColor );
341 mTable->endCommand();
344 void QgsLayoutAttributeTableWidget::mGridStrokeWidthSpinBox_valueChanged(
double d )
352 mTable->setGridStrokeWidth( d );
353 mTable->endCommand();
356 void QgsLayoutAttributeTableWidget::mGridColorButton_colorChanged(
const QColor &newColor )
364 mTable->setGridColor( newColor );
365 mTable->endCommand();
368 void QgsLayoutAttributeTableWidget::mDrawHorizontalGrid_toggled(
bool state )
375 mTable->beginCommand( tr(
"Toggle Table Grid" ) );
376 mTable->setHorizontalGrid( state );
377 mTable->endCommand();
380 void QgsLayoutAttributeTableWidget::mDrawVerticalGrid_toggled(
bool state )
387 mTable->beginCommand( tr(
"Toggled Table Grid" ) );
388 mTable->setVerticalGrid( state );
389 mTable->endCommand();
392 void QgsLayoutAttributeTableWidget::mShowGridGroupCheckBox_toggled(
bool state )
399 mTable->beginCommand( tr(
"Toggle Table Grid" ) );
400 mTable->setShowGrid( state );
401 mTable->endCommand();
404 void QgsLayoutAttributeTableWidget::mBackgroundColorButton_colorChanged(
const QColor &newColor )
412 mTable->setBackgroundColor( newColor );
413 mTable->endCommand();
416 void QgsLayoutAttributeTableWidget::updateGuiElements()
418 if ( !mTable || !mFrame )
423 blockAllSignals(
true );
425 mSourceComboBox->setCurrentIndex( mSourceComboBox->findData( mTable->source() ) );
426 mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mTable->relationId() ) );
429 if ( mTable->vectorLayer() )
431 mLayerComboBox->setLayer( mTable->vectorLayer() );
435 mShowOnlyVisibleFeaturesCheckBox->setChecked(
false );
436 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
false );
440 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
444 mComposerMapComboBox->setItem( mTable->map() );
445 mMaximumRowsSpinBox->setValue( mTable->maximumNumberOfFeatures() );
446 mMarginSpinBox->setValue( mTable->cellMargin() );
447 mGridStrokeWidthSpinBox->setValue( mTable->gridStrokeWidth() );
448 mGridColorButton->setColor( mTable->gridColor() );
449 mDrawHorizontalGrid->setChecked( mTable->horizontalGrid() );
450 mDrawVerticalGrid->setChecked( mTable->verticalGrid() );
451 if ( mTable->showGrid() )
453 mShowGridGroupCheckBox->setChecked(
true );
457 mShowGridGroupCheckBox->setChecked(
false );
459 mBackgroundColorButton->setColor( mTable->backgroundColor() );
461 mHeaderFontColorButton->setColor( mTable->headerFontColor() );
462 mContentFontColorButton->setColor( mTable->contentFontColor() );
463 mHeaderFontToolButton->setCurrentFont( mTable->headerFont() );
464 mContentFontToolButton->setCurrentFont( mTable->contentFont() );
466 if ( mTable->displayOnlyVisibleFeatures() && mShowOnlyVisibleFeaturesCheckBox->isEnabled() )
468 mShowOnlyVisibleFeaturesCheckBox->setCheckState( Qt::Checked );
469 mComposerMapComboBox->setEnabled(
true );
470 mComposerMapLabel->setEnabled(
true );
474 mShowOnlyVisibleFeaturesCheckBox->setCheckState( Qt::Unchecked );
475 mComposerMapComboBox->setEnabled(
false );
476 mComposerMapLabel->setEnabled(
false );
479 mUniqueOnlyCheckBox->setChecked( mTable->uniqueRowsOnly() );
480 mIntersectAtlasCheckBox->setChecked( mTable->filterToAtlasFeature() );
481 mFeatureFilterEdit->setText( mTable->featureFilter() );
482 mFeatureFilterCheckBox->setCheckState( mTable->filterFeatures() ? Qt::Checked : Qt::Unchecked );
483 mFeatureFilterEdit->setEnabled( mTable->filterFeatures() );
484 mFeatureFilterButton->setEnabled( mTable->filterFeatures() );
485 mUseConditionalStylingCheckBox->setChecked( mTable->useConditionalStyling() );
487 mHeaderHAlignmentComboBox->setCurrentIndex( mHeaderHAlignmentComboBox->findData( mTable->headerHAlignment() ) );
488 mHeaderModeComboBox->setCurrentIndex( mHeaderModeComboBox->findData( mTable->headerMode() ) );
490 mEmptyModeComboBox->setCurrentIndex( mEmptyModeComboBox->findData( mTable->emptyTableBehavior() ) );
491 mEmptyMessageLineEdit->setText( mTable->emptyTableMessage() );
494 mDrawEmptyCheckBox->setChecked( mTable->showEmptyRows() );
495 mWrapStringLineEdit->setText( mTable->wrapString() );
496 mWrapBehaviorComboBox->setCurrentIndex( mWrapBehaviorComboBox->findData( mTable->wrapBehavior() ) );
498 mResizeModeComboBox->setCurrentIndex( mResizeModeComboBox->findData( mTable->resizeMode() ) );
501 mEmptyFrameCheckBox->setChecked( mFrame->hidePageIfEmpty() );
502 mHideEmptyBgCheckBox->setChecked( mFrame->hideBackgroundIfEmpty() );
506 toggleSourceControls();
508 blockAllSignals(
false );
511 void QgsLayoutAttributeTableWidget::atlasToggled()
518 toggleAtlasSpecificControls( atlasEnabled );
523 whileBlocking( mSourceComboBox )->setCurrentIndex( mSourceComboBox->findData( mTable->source() ) );
525 if ( !atlasEnabled && mTable->filterToAtlasFeature() )
527 mTable->setFilterToAtlasFeature(
false );
531 void QgsLayoutAttributeTableWidget::updateRelationsCombo()
533 mRelationsComboBox->blockSignals(
true );
534 mRelationsComboBox->clear();
542 mRelationsComboBox->addItem( relation.name(), relation.id() );
546 mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mTable->relationId() ) );
550 mRelationsComboBox->blockSignals(
false );
553 void QgsLayoutAttributeTableWidget::toggleAtlasSpecificControls(
const bool atlasEnabled )
563 mRelationsComboBox->blockSignals(
true );
564 mRelationsComboBox->setEnabled(
false );
565 mRelationsComboBox->clear();
566 mRelationsComboBox->blockSignals(
false );
567 mIntersectAtlasCheckBox->setEnabled(
false );
583 updateRelationsCombo();
584 mRelationsComboBox->setEnabled(
true );
585 mIntersectAtlasCheckBox->setEnabled(
true );
589 void QgsLayoutAttributeTableWidget::blockAllSignals(
bool b )
591 mSourceComboBox->blockSignals( b );
592 mLayerComboBox->blockSignals( b );
593 mComposerMapComboBox->blockSignals( b );
594 mMaximumRowsSpinBox->blockSignals( b );
595 mMarginSpinBox->blockSignals( b );
596 mGridColorButton->blockSignals( b );
597 mGridStrokeWidthSpinBox->blockSignals( b );
598 mBackgroundColorButton->blockSignals( b );
599 mDrawHorizontalGrid->blockSignals( b );
600 mDrawVerticalGrid->blockSignals( b );
601 mShowGridGroupCheckBox->blockSignals( b );
602 mShowOnlyVisibleFeaturesCheckBox->blockSignals( b );
603 mUniqueOnlyCheckBox->blockSignals( b );
604 mIntersectAtlasCheckBox->blockSignals( b );
605 mFeatureFilterEdit->blockSignals( b );
606 mFeatureFilterCheckBox->blockSignals( b );
607 mHeaderHAlignmentComboBox->blockSignals( b );
608 mHeaderModeComboBox->blockSignals( b );
609 mHeaderFontColorButton->blockSignals( b );
610 mContentFontColorButton->blockSignals( b );
611 mResizeModeComboBox->blockSignals( b );
612 mRelationsComboBox->blockSignals( b );
613 mEmptyModeComboBox->blockSignals( b );
614 mEmptyMessageLineEdit->blockSignals( b );
615 mEmptyFrameCheckBox->blockSignals( b );
616 mHideEmptyBgCheckBox->blockSignals( b );
617 mDrawEmptyCheckBox->blockSignals( b );
618 mWrapStringLineEdit->blockSignals( b );
619 mWrapBehaviorComboBox->blockSignals( b );
620 mContentFontToolButton->blockSignals( b );
621 mHeaderFontToolButton->blockSignals( b );
624 void QgsLayoutAttributeTableWidget::setMaximumNumberOfFeatures(
int n )
629 void QgsLayoutAttributeTableWidget::mShowOnlyVisibleFeaturesCheckBox_stateChanged(
int state )
636 mTable->beginCommand( tr(
"Toggle Visible Features Only" ) );
637 bool showOnlyVisibleFeatures = ( state == Qt::Checked );
638 mTable->setDisplayOnlyVisibleFeatures( showOnlyVisibleFeatures );
640 mTable->endCommand();
643 mComposerMapComboBox->setEnabled( state == Qt::Checked );
644 mComposerMapLabel->setEnabled( state == Qt::Checked );
647 void QgsLayoutAttributeTableWidget::mUniqueOnlyCheckBox_stateChanged(
int state )
654 mTable->beginCommand( tr(
"Toggle Table Filter Duplicates" ) );
655 mTable->setUniqueRowsOnly( state == Qt::Checked );
657 mTable->endCommand();
660 void QgsLayoutAttributeTableWidget::mEmptyFrameCheckBox_toggled(
bool checked )
667 mFrame->beginCommand( tr(
"Toggle Empty Frame Mode" ) );
668 mFrame->setHidePageIfEmpty( checked );
669 mFrame->endCommand();
672 void QgsLayoutAttributeTableWidget::mHideEmptyBgCheckBox_toggled(
bool checked )
679 mFrame->beginCommand( tr(
"Toggle Background Display" ) );
680 mFrame->setHideBackgroundIfEmpty( checked );
681 mFrame->endCommand();
684 void QgsLayoutAttributeTableWidget::mIntersectAtlasCheckBox_stateChanged(
int state )
691 mTable->beginCommand( tr(
"Toggle Table Atlas Filter" ) );
692 bool filterToAtlas = ( state == Qt::Checked );
693 mTable->setFilterToAtlasFeature( filterToAtlas );
695 mTable->endCommand();
698 void QgsLayoutAttributeTableWidget::mFeatureFilterCheckBox_stateChanged(
int state )
705 if ( state == Qt::Checked )
707 mFeatureFilterEdit->setEnabled(
true );
708 mFeatureFilterButton->setEnabled(
true );
712 mFeatureFilterEdit->setEnabled(
false );
713 mFeatureFilterButton->setEnabled(
false );
716 mTable->beginCommand( tr(
"Toggle Table Feature Filter" ) );
717 mTable->setFilterFeatures( state == Qt::Checked );
719 mTable->endCommand();
722 void QgsLayoutAttributeTableWidget::mFeatureFilterEdit_editingFinished()
729 mTable->beginCommand( tr(
"Change Table Feature Filter" ) );
730 mTable->setFeatureFilter( mFeatureFilterEdit->text() );
732 mTable->endCommand();
735 void QgsLayoutAttributeTableWidget::mFeatureFilterButton_clicked()
743 QgsExpressionBuilderDialog exprDlg( mTable->sourceLayer(), mFeatureFilterEdit->text(),
this, QStringLiteral(
"generic" ), context );
744 exprDlg.setWindowTitle( tr(
"Expression Based Filter" ) );
745 if ( exprDlg.exec() == QDialog::Accepted )
747 QString expression = exprDlg.expressionText();
748 if ( !expression.isEmpty() )
750 mFeatureFilterEdit->setText( expression );
751 mTable->beginCommand( tr(
"Change Table Feature Filter" ) );
752 mTable->setFeatureFilter( mFeatureFilterEdit->text() );
754 mTable->endCommand();
759 void QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged(
int )
766 mTable->beginCommand( tr(
"Change Table Alignment" ) );
768 mTable->endCommand();
771 void QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged(
int )
778 mTable->beginCommand( tr(
"Change Table Header Mode" ) );
780 mTable->endCommand();
783 void QgsLayoutAttributeTableWidget::mWrapStringLineEdit_editingFinished()
790 mTable->beginCommand( tr(
"Change Table Wrap String" ) );
791 mTable->setWrapString( mWrapStringLineEdit->text() );
792 mTable->endCommand();
795 void QgsLayoutAttributeTableWidget::changeLayer(
QgsMapLayer *layer )
808 mTable->beginCommand( tr(
"Change Table Layer" ) );
809 mTable->setVectorLayer( vl );
811 mTable->endCommand();
816 mShowOnlyVisibleFeaturesCheckBox->setChecked(
false );
817 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
false );
821 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
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(
true );
976 mComposerMapComboBox->setEnabled( mTable->displayOnlyVisibleFeatures() );
977 mComposerMapLabel->setEnabled( mTable->displayOnlyVisibleFeatures() );
980 mLayerComboBox->setEnabled(
false );
981 mLayerComboBox->setVisible(
false );
982 mLayerSourceDDBtn->setVisible(
false );
983 mLayerLabel->setVisible(
false );
984 mRelationsComboBox->setEnabled(
false );
985 mRelationsComboBox->setVisible(
false );
986 mRelationLabel->setVisible(
false );
987 mMaximumRowsSpinBox->setEnabled(
false );
988 mMaxNumFeaturesLabel->setEnabled(
false );
989 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
false );
990 mComposerMapComboBox->setEnabled(
false );
991 mComposerMapLabel->setEnabled(
false );
994 mLayerComboBox->setEnabled(
false );
995 mLayerComboBox->setVisible(
false );
996 mLayerLabel->setVisible(
false );
997 mLayerSourceDDBtn->setVisible(
false );
998 mRelationsComboBox->setEnabled(
true );
999 mRelationsComboBox->setVisible(
true );
1000 mRelationLabel->setVisible(
true );
1001 mMaximumRowsSpinBox->setEnabled(
true );
1002 mMaxNumFeaturesLabel->setEnabled(
true );
1003 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
1004 mComposerMapComboBox->setEnabled(
true );
1005 mComposerMapLabel->setEnabled(
true );