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 blockAllSignals(
true );
99 toggleAtlasSpecificControls(
static_cast< bool >(
coverageLayer() ) );
107 mComposerMapComboBox->setCurrentLayout( mTable->layout() );
111 mGridColorButton->setColorDialogTitle( tr(
"Select Grid Color" ) );
112 mGridColorButton->setAllowOpacity(
true );
113 mGridColorButton->setContext( QStringLiteral(
"composer" ) );
114 mGridColorButton->setDefaultColor( Qt::black );
115 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
116 mBackgroundColorButton->setAllowOpacity(
true );
117 mBackgroundColorButton->setContext( QStringLiteral(
"composer" ) );
118 mBackgroundColorButton->setShowNoColor(
true );
119 mBackgroundColorButton->setNoColorString( tr(
"No Background" ) );
129 this, &QgsLayoutAttributeTableWidget::atlasToggled );
137 mLayerSourceDDBtn->registerExpressionContextGenerator( mTable );
147 mainLayout->addWidget( mItemPropertiesWidget );
150 connect( mHeaderFontToolButton, &
QgsFontButton::changed,
this, &QgsLayoutAttributeTableWidget::headerFontChanged );
151 connect( mContentFontToolButton, &
QgsFontButton::changed,
this, &QgsLayoutAttributeTableWidget::contentFontChanged );
156 mIntersectAtlasCheckBox->setText( tr(
"Show only features intersecting %1 feature" ).arg(
string ) );
158 if ( atlasFeatureIndex != -1 )
160 mSourceComboBox->setItemText( atlasFeatureIndex, tr(
"Current %1 Feature" ).arg(
string ) );
166 if ( mItemPropertiesWidget )
188 mTable = qobject_cast< QgsLayoutItemAttributeTable * >( multiFrame );
190 mItemPropertiesWidget->
setItem( frame );
203 void QgsLayoutAttributeTableWidget::mRefreshPushButton_clicked()
210 mTable->refreshAttributes();
213 void QgsLayoutAttributeTableWidget::mAttributesPushButton_clicked()
221 QVector<QgsLayoutTableColumn> currentColumns = mTable->columns();
222 QVector<QgsLayoutTableColumn> currentSortColumns = mTable->sortColumns();
224 mTable->beginCommand( tr(
"Change Table Attributes" ) );
227 window()->setUpdatesEnabled(
false );
230 if ( d.exec() == QDialog::Accepted )
232 mTable->refreshAttributes();
234 window()->setUpdatesEnabled(
true );
236 mTable->endCommand();
239 currentColumns.clear();
240 currentSortColumns.clear();
245 mTable->setColumns( currentColumns );
246 mTable->setSortColumns( currentSortColumns );
247 window()->setUpdatesEnabled(
true );
248 mTable->cancelCommand();
252 void QgsLayoutAttributeTableWidget::composerMapChanged(
QgsLayoutItem *item )
259 mTable->beginCommand( tr(
"Change Table Map" ) );
260 mTable->setMap( qobject_cast< QgsLayoutItemMap * >( item ) );
262 mTable->endCommand();
265 void QgsLayoutAttributeTableWidget::mMaximumRowsSpinBox_valueChanged(
int i )
273 mTable->setMaximumNumberOfFeatures( i );
275 mTable->endCommand();
278 void QgsLayoutAttributeTableWidget::mMarginSpinBox_valueChanged(
double d )
286 mTable->setCellMargin( d );
287 mTable->endCommand();
290 void QgsLayoutAttributeTableWidget::headerFontChanged()
295 mTable->beginCommand( tr(
"Change Table Text Format" ) );
296 mTable->setHeaderTextFormat( mHeaderFontToolButton->textFormat() );
297 mTable->endCommand();
300 void QgsLayoutAttributeTableWidget::contentFontChanged()
307 mTable->beginCommand( tr(
"Change Table Text Format" ) );
308 mTable->setContentTextFormat( mContentFontToolButton->textFormat() );
309 mTable->endCommand();
312 void QgsLayoutAttributeTableWidget::mGridStrokeWidthSpinBox_valueChanged(
double d )
320 mTable->setGridStrokeWidth( d );
321 mTable->endCommand();
324 void QgsLayoutAttributeTableWidget::mGridColorButton_colorChanged(
const QColor &newColor )
332 mTable->setGridColor( newColor );
333 mTable->endCommand();
336 void QgsLayoutAttributeTableWidget::mDrawHorizontalGrid_toggled(
bool state )
343 mTable->beginCommand( tr(
"Toggle Table Grid" ) );
344 mTable->setHorizontalGrid( state );
345 mTable->endCommand();
348 void QgsLayoutAttributeTableWidget::mDrawVerticalGrid_toggled(
bool state )
355 mTable->beginCommand( tr(
"Toggled Table Grid" ) );
356 mTable->setVerticalGrid( state );
357 mTable->endCommand();
360 void QgsLayoutAttributeTableWidget::mShowGridGroupCheckBox_toggled(
bool state )
367 mTable->beginCommand( tr(
"Toggle Table Grid" ) );
368 mTable->setShowGrid( state );
369 mTable->endCommand();
372 void QgsLayoutAttributeTableWidget::mBackgroundColorButton_colorChanged(
const QColor &newColor )
380 mTable->setBackgroundColor( newColor );
381 mTable->endCommand();
384 void QgsLayoutAttributeTableWidget::updateGuiElements()
386 if ( !mTable || !mFrame )
391 blockAllSignals(
true );
393 mSourceComboBox->setCurrentIndex( mSourceComboBox->findData( mTable->source() ) );
394 mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mTable->relationId() ) );
397 if ( mTable->vectorLayer() )
399 mLayerComboBox->setLayer( mTable->vectorLayer() );
403 mShowOnlyVisibleFeaturesCheckBox->setChecked(
false );
404 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
false );
408 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
412 mComposerMapComboBox->setItem( mTable->map() );
413 mMaximumRowsSpinBox->setValue( mTable->maximumNumberOfFeatures() );
414 mMarginSpinBox->setValue( mTable->cellMargin() );
415 mGridStrokeWidthSpinBox->setValue( mTable->gridStrokeWidth() );
416 mGridColorButton->setColor( mTable->gridColor() );
417 mDrawHorizontalGrid->setChecked( mTable->horizontalGrid() );
418 mDrawVerticalGrid->setChecked( mTable->verticalGrid() );
419 if ( mTable->showGrid() )
421 mShowGridGroupCheckBox->setChecked(
true );
425 mShowGridGroupCheckBox->setChecked(
false );
427 mBackgroundColorButton->setColor( mTable->backgroundColor() );
429 mHeaderFontToolButton->setTextFormat( mTable->headerTextFormat() );
430 mContentFontToolButton->setTextFormat( mTable->contentTextFormat() );
432 if ( mTable->displayOnlyVisibleFeatures() && mShowOnlyVisibleFeaturesCheckBox->isEnabled() )
434 mShowOnlyVisibleFeaturesCheckBox->setCheckState( Qt::Checked );
435 mComposerMapComboBox->setEnabled(
true );
436 mComposerMapLabel->setEnabled(
true );
440 mShowOnlyVisibleFeaturesCheckBox->setCheckState( Qt::Unchecked );
441 mComposerMapComboBox->setEnabled(
false );
442 mComposerMapLabel->setEnabled(
false );
445 mUniqueOnlyCheckBox->setChecked( mTable->uniqueRowsOnly() );
446 mIntersectAtlasCheckBox->setChecked( mTable->filterToAtlasFeature() );
447 mFeatureFilterEdit->setText( mTable->featureFilter() );
448 mFeatureFilterCheckBox->setCheckState( mTable->filterFeatures() ? Qt::Checked : Qt::Unchecked );
449 mFeatureFilterEdit->setEnabled( mTable->filterFeatures() );
450 mFeatureFilterButton->setEnabled( mTable->filterFeatures() );
451 mUseConditionalStylingCheckBox->setChecked( mTable->useConditionalStyling() );
453 mHeaderHAlignmentComboBox->setCurrentIndex( mHeaderHAlignmentComboBox->findData( mTable->headerHAlignment() ) );
454 mHeaderModeComboBox->setCurrentIndex( mHeaderModeComboBox->findData( mTable->headerMode() ) );
456 mEmptyModeComboBox->setCurrentIndex( mEmptyModeComboBox->findData( mTable->emptyTableBehavior() ) );
457 mEmptyMessageLineEdit->setText( mTable->emptyTableMessage() );
460 mDrawEmptyCheckBox->setChecked( mTable->showEmptyRows() );
461 mWrapStringLineEdit->setText( mTable->wrapString() );
462 mWrapBehaviorComboBox->setCurrentIndex( mWrapBehaviorComboBox->findData( mTable->wrapBehavior() ) );
464 mResizeModeComboBox->setCurrentIndex( mResizeModeComboBox->findData( mTable->resizeMode() ) );
467 mEmptyFrameCheckBox->setChecked( mFrame->hidePageIfEmpty() );
468 mHideEmptyBgCheckBox->setChecked( mFrame->hideBackgroundIfEmpty() );
472 toggleSourceControls();
474 blockAllSignals(
false );
477 void QgsLayoutAttributeTableWidget::atlasToggled()
484 toggleAtlasSpecificControls( atlasEnabled );
489 whileBlocking( mSourceComboBox )->setCurrentIndex( mSourceComboBox->findData( mTable->source() ) );
491 if ( !atlasEnabled && mTable->filterToAtlasFeature() )
493 mTable->setFilterToAtlasFeature(
false );
497 void QgsLayoutAttributeTableWidget::updateRelationsCombo()
499 mRelationsComboBox->blockSignals(
true );
500 mRelationsComboBox->clear();
508 mRelationsComboBox->addItem( relation.name(), relation.id() );
512 mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mTable->relationId() ) );
516 mRelationsComboBox->blockSignals(
false );
519 void QgsLayoutAttributeTableWidget::toggleAtlasSpecificControls(
const bool atlasEnabled )
529 mRelationsComboBox->blockSignals(
true );
530 mRelationsComboBox->setEnabled(
false );
531 mRelationsComboBox->clear();
532 mRelationsComboBox->blockSignals(
false );
533 mIntersectAtlasCheckBox->setEnabled(
false );
549 updateRelationsCombo();
550 mRelationsComboBox->setEnabled(
true );
551 mIntersectAtlasCheckBox->setEnabled(
true );
555 void QgsLayoutAttributeTableWidget::blockAllSignals(
bool b )
557 mSourceComboBox->blockSignals( b );
558 mLayerComboBox->blockSignals( b );
559 mComposerMapComboBox->blockSignals( b );
560 mMaximumRowsSpinBox->blockSignals( b );
561 mMarginSpinBox->blockSignals( b );
562 mGridColorButton->blockSignals( b );
563 mGridStrokeWidthSpinBox->blockSignals( b );
564 mBackgroundColorButton->blockSignals( b );
565 mDrawHorizontalGrid->blockSignals( b );
566 mDrawVerticalGrid->blockSignals( b );
567 mShowGridGroupCheckBox->blockSignals( b );
568 mShowOnlyVisibleFeaturesCheckBox->blockSignals( b );
569 mUniqueOnlyCheckBox->blockSignals( b );
570 mIntersectAtlasCheckBox->blockSignals( b );
571 mFeatureFilterEdit->blockSignals( b );
572 mFeatureFilterCheckBox->blockSignals( b );
573 mHeaderHAlignmentComboBox->blockSignals( b );
574 mHeaderModeComboBox->blockSignals( b );
575 mResizeModeComboBox->blockSignals( b );
576 mRelationsComboBox->blockSignals( b );
577 mEmptyModeComboBox->blockSignals( b );
578 mEmptyMessageLineEdit->blockSignals( b );
579 mEmptyFrameCheckBox->blockSignals( b );
580 mHideEmptyBgCheckBox->blockSignals( b );
581 mDrawEmptyCheckBox->blockSignals( b );
582 mWrapStringLineEdit->blockSignals( b );
583 mWrapBehaviorComboBox->blockSignals( b );
584 mContentFontToolButton->blockSignals( b );
585 mHeaderFontToolButton->blockSignals( b );
588 void QgsLayoutAttributeTableWidget::setMaximumNumberOfFeatures(
int n )
593 void QgsLayoutAttributeTableWidget::mShowOnlyVisibleFeaturesCheckBox_stateChanged(
int state )
600 mTable->beginCommand( tr(
"Toggle Visible Features Only" ) );
601 bool showOnlyVisibleFeatures = ( state == Qt::Checked );
602 mTable->setDisplayOnlyVisibleFeatures( showOnlyVisibleFeatures );
604 mTable->endCommand();
607 mComposerMapComboBox->setEnabled( state == Qt::Checked );
608 mComposerMapLabel->setEnabled( state == Qt::Checked );
611 void QgsLayoutAttributeTableWidget::mUniqueOnlyCheckBox_stateChanged(
int state )
618 mTable->beginCommand( tr(
"Toggle Table Filter Duplicates" ) );
619 mTable->setUniqueRowsOnly( state == Qt::Checked );
621 mTable->endCommand();
624 void QgsLayoutAttributeTableWidget::mEmptyFrameCheckBox_toggled(
bool checked )
631 mFrame->beginCommand( tr(
"Toggle Empty Frame Mode" ) );
632 mFrame->setHidePageIfEmpty( checked );
633 mFrame->endCommand();
636 void QgsLayoutAttributeTableWidget::mHideEmptyBgCheckBox_toggled(
bool checked )
643 mFrame->beginCommand( tr(
"Toggle Background Display" ) );
644 mFrame->setHideBackgroundIfEmpty( checked );
645 mFrame->endCommand();
648 void QgsLayoutAttributeTableWidget::mIntersectAtlasCheckBox_stateChanged(
int state )
655 mTable->beginCommand( tr(
"Toggle Table Atlas Filter" ) );
656 bool filterToAtlas = ( state == Qt::Checked );
657 mTable->setFilterToAtlasFeature( filterToAtlas );
659 mTable->endCommand();
662 void QgsLayoutAttributeTableWidget::mFeatureFilterCheckBox_stateChanged(
int state )
669 if ( state == Qt::Checked )
671 mFeatureFilterEdit->setEnabled(
true );
672 mFeatureFilterButton->setEnabled(
true );
676 mFeatureFilterEdit->setEnabled(
false );
677 mFeatureFilterButton->setEnabled(
false );
680 mTable->beginCommand( tr(
"Toggle Table Feature Filter" ) );
681 mTable->setFilterFeatures( state == Qt::Checked );
683 mTable->endCommand();
686 void QgsLayoutAttributeTableWidget::mFeatureFilterEdit_editingFinished()
693 mTable->beginCommand( tr(
"Change Table Feature Filter" ) );
694 mTable->setFeatureFilter( mFeatureFilterEdit->text() );
696 mTable->endCommand();
699 void QgsLayoutAttributeTableWidget::mFeatureFilterButton_clicked()
707 QgsExpressionBuilderDialog exprDlg( mTable->sourceLayer(), mFeatureFilterEdit->text(),
this, QStringLiteral(
"generic" ), context );
708 exprDlg.setWindowTitle( tr(
"Expression Based Filter" ) );
709 if ( exprDlg.exec() == QDialog::Accepted )
711 QString expression = exprDlg.expressionText();
712 if ( !expression.isEmpty() )
714 mFeatureFilterEdit->setText( expression );
715 mTable->beginCommand( tr(
"Change Table Feature Filter" ) );
716 mTable->setFeatureFilter( mFeatureFilterEdit->text() );
718 mTable->endCommand();
723 void QgsLayoutAttributeTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged(
int )
730 mTable->beginCommand( tr(
"Change Table Alignment" ) );
732 mTable->endCommand();
735 void QgsLayoutAttributeTableWidget::mHeaderModeComboBox_currentIndexChanged(
int )
742 mTable->beginCommand( tr(
"Change Table Header Mode" ) );
744 mTable->endCommand();
747 void QgsLayoutAttributeTableWidget::mWrapStringLineEdit_editingFinished()
754 mTable->beginCommand( tr(
"Change Table Wrap String" ) );
755 mTable->setWrapString( mWrapStringLineEdit->text() );
756 mTable->endCommand();
759 void QgsLayoutAttributeTableWidget::changeLayer(
QgsMapLayer *layer )
772 mTable->beginCommand( tr(
"Change Table Layer" ) );
773 mTable->setVectorLayer( vl );
775 mTable->endCommand();
780 mShowOnlyVisibleFeaturesCheckBox->setChecked(
false );
781 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
false );
785 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
789 void QgsLayoutAttributeTableWidget::mAddFramePushButton_clicked()
791 if ( !mTable || !mFrame )
797 QPointF pos = mFrame->pos();
799 pos.ry() += mFrame->rect().height() + 10;
801 QgsLayoutFrame *newFrame = mTable->createNewFrame( mFrame, pos, mFrame->rect().size() );
802 mTable->recalculateFrameSizes();
805 if (
QgsLayout *layout = mTable->layout() )
807 layout->setSelectedItem( newFrame );
811 void QgsLayoutAttributeTableWidget::mResizeModeComboBox_currentIndexChanged(
int index )
818 mTable->beginCommand( tr(
"Change Resize Mode" ) );
820 mTable->endCommand();
825 void QgsLayoutAttributeTableWidget::mSourceComboBox_currentIndexChanged(
int index )
832 mTable->beginCommand( tr(
"Change Table Source" ) );
834 mTable->endCommand();
836 toggleSourceControls();
839 void QgsLayoutAttributeTableWidget::mRelationsComboBox_currentIndexChanged(
int index )
846 mTable->beginCommand( tr(
"Change Table Source Relation" ) );
847 mTable->setRelationId( mRelationsComboBox->itemData( index ).toString() );
848 mTable->endCommand();
851 void QgsLayoutAttributeTableWidget::mEmptyModeComboBox_currentIndexChanged(
int index )
858 mTable->beginCommand( tr(
"Change Empty Table Behavior" ) );
860 mTable->endCommand();
865 void QgsLayoutAttributeTableWidget::mWrapBehaviorComboBox_currentIndexChanged(
int index )
872 mTable->beginCommand( tr(
"Change Table Wrap Mode" ) );
874 mTable->endCommand();
877 void QgsLayoutAttributeTableWidget::mAdvancedCustomizationButton_clicked()
888 void QgsLayoutAttributeTableWidget::useConditionalStylingChanged(
bool checked )
895 mTable->beginCommand( tr(
"Toggle Table Conditional Styling" ) );
896 mTable->setUseConditionalStyling( checked );
898 mTable->endCommand();
901 void QgsLayoutAttributeTableWidget::mDrawEmptyCheckBox_toggled(
bool checked )
908 mTable->beginCommand( tr(
"Change Show Empty Rows" ) );
909 mTable->setShowEmptyRows( checked );
910 mTable->endCommand();
913 void QgsLayoutAttributeTableWidget::mEmptyMessageLineEdit_editingFinished()
920 mTable->beginCommand( tr(
"Change Empty Table Message" ) );
921 mTable->setEmptyTableMessage( mEmptyMessageLineEdit->text() );
922 mTable->endCommand();
925 void QgsLayoutAttributeTableWidget::toggleSourceControls()
927 switch ( mTable->source() )
930 mLayerComboBox->setEnabled(
true );
931 mLayerComboBox->setVisible(
true );
932 mLayerSourceDDBtn->setVisible(
true );
933 mLayerLabel->setVisible(
true );
934 mRelationsComboBox->setEnabled(
false );
935 mRelationsComboBox->setVisible(
false );
936 mRelationLabel->setVisible(
false );
937 mMaximumRowsSpinBox->setEnabled(
true );
938 mMaxNumFeaturesLabel->setEnabled(
true );
939 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
940 mComposerMapComboBox->setEnabled( mTable->displayOnlyVisibleFeatures() );
941 mComposerMapLabel->setEnabled( mTable->displayOnlyVisibleFeatures() );
944 mLayerComboBox->setEnabled(
false );
945 mLayerComboBox->setVisible(
false );
946 mLayerSourceDDBtn->setVisible(
false );
947 mLayerLabel->setVisible(
false );
948 mRelationsComboBox->setEnabled(
false );
949 mRelationsComboBox->setVisible(
false );
950 mRelationLabel->setVisible(
false );
951 mMaximumRowsSpinBox->setEnabled(
false );
952 mMaxNumFeaturesLabel->setEnabled(
false );
953 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
false );
954 mComposerMapComboBox->setEnabled(
false );
955 mComposerMapLabel->setEnabled(
false );
958 mLayerComboBox->setEnabled(
false );
959 mLayerComboBox->setVisible(
false );
960 mLayerLabel->setVisible(
false );
961 mLayerSourceDDBtn->setVisible(
false );
962 mRelationsComboBox->setEnabled(
true );
963 mRelationsComboBox->setVisible(
true );
964 mRelationLabel->setVisible(
true );
965 mMaximumRowsSpinBox->setEnabled(
true );
966 mMaxNumFeaturesLabel->setEnabled(
true );
967 mShowOnlyVisibleFeaturesCheckBox->setEnabled(
true );
968 mComposerMapComboBox->setEnabled(
true );
969 mComposerMapLabel->setEnabled(
true );