Skip to content
Permalink
Browse files

Remove some unused heading settings from manual table widget

  • Loading branch information
nyalldawson committed Jan 13, 2020
1 parent 2b5598d commit 8de0e76233bf3f6a77c6af71770d458119b158e2
@@ -37,12 +37,10 @@ QgsLayoutManualTableWidget::QgsLayoutManualTableWidget( QgsLayoutFrame *frame )
connect( mGridStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutManualTableWidget::mGridStrokeWidthSpinBox_valueChanged );
connect( mGridColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mGridColorButton_colorChanged );
connect( mBackgroundColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mBackgroundColorButton_colorChanged );
connect( mHeaderFontColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mHeaderFontColorButton_colorChanged );
connect( mContentFontColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mContentFontColorButton_colorChanged );
connect( mDrawHorizontalGrid, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawHorizontalGrid_toggled );
connect( mDrawVerticalGrid, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawVerticalGrid_toggled );
connect( mShowGridGroupCheckBox, &QgsCollapsibleGroupBoxBasic::toggled, this, &QgsLayoutManualTableWidget::mShowGridGroupCheckBox_toggled );
connect( mHeaderHAlignmentComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged );
connect( mAddFramePushButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::mAddFramePushButton_clicked );
connect( mResizeModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mResizeModeComboBox_currentIndexChanged );
connect( mDrawEmptyCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawEmptyCheckBox_toggled );
@@ -53,7 +51,6 @@ QgsLayoutManualTableWidget::QgsLayoutManualTableWidget( QgsLayoutFrame *frame )
setPanelTitle( tr( "Table Properties" ) );

mContentFontToolButton->setMode( QgsFontButton::ModeQFont );
mHeaderFontToolButton->setMode( QgsFontButton::ModeQFont );

blockAllSignals( true );

@@ -64,9 +61,6 @@ QgsLayoutManualTableWidget::QgsLayoutManualTableWidget( QgsLayoutFrame *frame )
mWrapBehaviorComboBox->addItem( tr( "Truncate text" ), QgsLayoutTable::TruncateText );
mWrapBehaviorComboBox->addItem( tr( "Wrap text" ), QgsLayoutTable::WrapText );

mHeaderFontColorButton->setColorDialogTitle( tr( "Select Header Font Color" ) );
mHeaderFontColorButton->setAllowOpacity( true );
mHeaderFontColorButton->setContext( QStringLiteral( "composer" ) );
mContentFontColorButton->setColorDialogTitle( tr( "Select Content Font Color" ) );
mContentFontColorButton->setAllowOpacity( true );
mContentFontColorButton->setContext( QStringLiteral( "composer" ) );
@@ -95,7 +89,6 @@ QgsLayoutManualTableWidget::QgsLayoutManualTableWidget( QgsLayoutFrame *frame )
mainLayout->addWidget( mItemPropertiesWidget );
}

connect( mHeaderFontToolButton, &QgsFontButton::changed, this, &QgsLayoutManualTableWidget::headerFontChanged );
connect( mContentFontToolButton, &QgsFontButton::changed, this, &QgsLayoutManualTableWidget::contentFontChanged );
}

@@ -198,28 +191,6 @@ void QgsLayoutManualTableWidget::mMarginSpinBox_valueChanged( double d )
mTable->endCommand();
}

void QgsLayoutManualTableWidget::headerFontChanged()
{
if ( !mTable )
return;

mTable->beginCommand( tr( "Change Table Font" ) );
mTable->setHeaderFont( mHeaderFontToolButton->currentFont() );
mTable->endCommand();
}

void QgsLayoutManualTableWidget::mHeaderFontColorButton_colorChanged( const QColor &newColor )
{
if ( !mTable )
{
return;
}

mTable->beginCommand( tr( "Change Font Color" ), QgsLayoutMultiFrame::UndoTableHeaderFontColor );
mTable->setHeaderFontColor( newColor );
mTable->endCommand();
}

void QgsLayoutManualTableWidget::contentFontChanged()
{
if ( !mTable )
@@ -340,13 +311,9 @@ void QgsLayoutManualTableWidget::updateGuiElements()
}
mBackgroundColorButton->setColor( mTable->backgroundColor() );

mHeaderFontColorButton->setColor( mTable->headerFontColor() );
mContentFontColorButton->setColor( mTable->contentFontColor() );
mHeaderFontToolButton->setCurrentFont( mTable->headerFont() );
mContentFontToolButton->setCurrentFont( mTable->contentFont() );

mHeaderHAlignmentComboBox->setCurrentIndex( static_cast<int>( mTable->headerHAlignment() ) );

mDrawEmptyCheckBox->setChecked( mTable->showEmptyRows() );
mWrapBehaviorComboBox->setCurrentIndex( mWrapBehaviorComboBox->findData( mTable->wrapBehavior() ) );

@@ -368,16 +335,13 @@ void QgsLayoutManualTableWidget::blockAllSignals( bool b )
mDrawHorizontalGrid->blockSignals( b );
mDrawVerticalGrid->blockSignals( b );
mShowGridGroupCheckBox->blockSignals( b );
mHeaderHAlignmentComboBox->blockSignals( b );
mHeaderFontColorButton->blockSignals( b );
mContentFontColorButton->blockSignals( b );
mResizeModeComboBox->blockSignals( b );
mEmptyFrameCheckBox->blockSignals( b );
mHideEmptyBgCheckBox->blockSignals( b );
mDrawEmptyCheckBox->blockSignals( b );
mWrapBehaviorComboBox->blockSignals( b );
mContentFontToolButton->blockSignals( b );
mHeaderFontToolButton->blockSignals( b );
}

void QgsLayoutManualTableWidget::mEmptyFrameCheckBox_toggled( bool checked )
@@ -404,18 +368,6 @@ void QgsLayoutManualTableWidget::mHideEmptyBgCheckBox_toggled( bool checked )
mFrame->endCommand();
}

void QgsLayoutManualTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged( int index )
{
if ( !mTable )
{
return;
}

mTable->beginCommand( tr( "Change Table Alignment" ) );
mTable->setHeaderHAlignment( static_cast< QgsLayoutTable::HeaderHAlignment >( index ) );
mTable->endCommand();
}

void QgsLayoutManualTableWidget::mAddFramePushButton_clicked()
{
if ( !mTable || !mFrame )
@@ -55,14 +55,11 @@ class QgsLayoutManualTableWidget: public QgsLayoutItemBaseWidget, private Ui::Qg
void mGridStrokeWidthSpinBox_valueChanged( double d );
void mGridColorButton_colorChanged( const QColor &newColor );
void mBackgroundColorButton_colorChanged( const QColor &newColor );
void headerFontChanged();
void mHeaderFontColorButton_colorChanged( const QColor &newColor );
void contentFontChanged();
void mContentFontColorButton_colorChanged( const QColor &newColor );
void mDrawHorizontalGrid_toggled( bool state );
void mDrawVerticalGrid_toggled( bool state );
void mShowGridGroupCheckBox_toggled( bool state );
void mHeaderHAlignmentComboBox_currentIndexChanged( int index );
void mAddFramePushButton_clicked();
void mResizeModeComboBox_currentIndexChanged( int index );
void mDrawEmptyCheckBox_toggled( bool checked );
@@ -25,7 +25,7 @@ QgsTableEditorDialog::QgsTableEditorDialog( QWidget *parent )
: QMainWindow( parent )
{
setupUi( this );
setWindowTitle( tr( "QGIS Table Designer" ) );
setWindowTitle( tr( "Table Designer" ) );

setAttribute( Qt::WA_DeleteOnClose );
setDockOptions( dockOptions() | QMainWindow::GroupedDragging );

0 comments on commit 8de0e76

Please sign in to comment.
You can’t perform that action at this time.