Skip to content

Commit 1b437d3

Browse files
committedNov 13, 2012
multicolumn composer legend
1 parent d8d9766 commit 1b437d3

File tree

7 files changed

+423
-136
lines changed

7 files changed

+423
-136
lines changed
 

‎src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ void QgsComposerLegendWidget::setGuiElements()
8787

8888
blockAllSignals( true );
8989
mTitleLineEdit->setText( mLegend->title() );
90+
mColumnCountSpinBox->setValue( mLegend->columnCount() );
9091
mSymbolWidthSpinBox->setValue( mLegend->symbolWidth() );
9192
mSymbolHeightSpinBox->setValue( mLegend->symbolHeight() );
9293
mGroupSpaceSpinBox->setValue( mLegend->groupSpace() );
@@ -109,7 +110,6 @@ void QgsComposerLegendWidget::setGuiElements()
109110
{
110111
mMapComboBox->setCurrentIndex( mMapComboBox->findData( -1 ) );
111112
}
112-
113113
blockAllSignals( false );
114114
}
115115

@@ -137,6 +137,18 @@ void QgsComposerLegendWidget::on_mTitleLineEdit_textChanged( const QString& text
137137
}
138138
}
139139

140+
void QgsComposerLegendWidget::on_mColumnCountSpinBox_valueChanged( int c )
141+
{
142+
if ( mLegend )
143+
{
144+
mLegend->beginCommand( tr( "Legend column count" ), QgsComposerMergeCommand::LegendColumnCount );
145+
mLegend->setColumnCount( c );
146+
mLegend->adjustBoxSize();
147+
mLegend->update();
148+
mLegend->endCommand();
149+
}
150+
}
151+
140152
void QgsComposerLegendWidget::on_mSymbolWidthSpinBox_valueChanged( double d )
141153
{
142154
if ( mLegend )
@@ -718,6 +730,7 @@ void QgsComposerLegendWidget::blockAllSignals( bool b )
718730
mItemTreeView->blockSignals( b );
719731
mCheckBoxAutoUpdate->blockSignals( b );
720732
mMapComboBox->blockSignals( b );
733+
mColumnCountSpinBox->blockSignals( b );
721734
mSymbolWidthSpinBox->blockSignals( b );
722735
mSymbolHeightSpinBox->blockSignals( b );
723736
mGroupSpaceSpinBox->blockSignals( b );

‎src/app/composer/qgscomposerlegendwidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class QgsComposerLegendWidget: public QWidget, private Ui::QgsComposerLegendWidg
4141

4242
void on_mWrapCharLineEdit_textChanged( const QString& text );
4343
void on_mTitleLineEdit_textChanged( const QString& text );
44+
void on_mColumnCountSpinBox_valueChanged( int c );
4445
void on_mSymbolWidthSpinBox_valueChanged( double d );
4546
void on_mSymbolHeightSpinBox_valueChanged( double d );
4647
void on_mGroupSpaceSpinBox_valueChanged( double d );

‎src/core/composer/qgscomposeritemcommand.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class CORE_EXPORT QgsComposerMergeCommand: public QgsComposerItemCommand
8080
ComposerMapAnnotationDistance,
8181
//composer legend
8282
ComposerLegendText,
83+
LegendColumnCount,
8384
LegendSymbolWidth,
8485
LegendSymbolHeight,
8586
LegendGroupSpace,

0 commit comments

Comments
 (0)