@@ -62,7 +62,6 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend ): m
62
62
mWrapCharLineEdit ->setText ( legend->wrapChar () );
63
63
64
64
setGuiElements ();
65
- connect ( mItemTreeView , SIGNAL ( itemChanged () ), this , SLOT ( setGuiElements () ) );
66
65
67
66
connect ( mItemTreeView ->selectionModel (), SIGNAL ( currentChanged ( const QModelIndex &, const QModelIndex & ) ),
68
67
this , SLOT ( selectedChanged ( const QModelIndex &, const QModelIndex & ) ) );
@@ -88,6 +87,8 @@ void QgsComposerLegendWidget::setGuiElements()
88
87
blockAllSignals ( true );
89
88
mTitleLineEdit ->setText ( mLegend ->title () );
90
89
mColumnCountSpinBox ->setValue ( mLegend ->columnCount () );
90
+ mSplitLayerCheckBox ->setChecked ( mLegend ->splitLayer () );
91
+ mEqualColumnWidthCheckBox ->setChecked ( mLegend ->equalColumnWidth () );
91
92
mSymbolWidthSpinBox ->setValue ( mLegend ->symbolWidth () );
92
93
mSymbolHeightSpinBox ->setValue ( mLegend ->symbolHeight () );
93
94
mGroupSpaceSpinBox ->setValue ( mLegend ->groupSpace () );
@@ -147,6 +148,32 @@ void QgsComposerLegendWidget::on_mColumnCountSpinBox_valueChanged( int c )
147
148
mLegend ->update ();
148
149
mLegend ->endCommand ();
149
150
}
151
+ mSplitLayerCheckBox ->setEnabled ( c > 1 );
152
+ mEqualColumnWidthCheckBox ->setEnabled ( c > 1 );
153
+ }
154
+
155
+ void QgsComposerLegendWidget::on_mSplitLayerCheckBox_toggled ( bool checked )
156
+ {
157
+ if ( mLegend )
158
+ {
159
+ mLegend ->beginCommand ( tr ( " Legend split layers" ), QgsComposerMergeCommand::LegendSplitLayer );
160
+ mLegend ->setSplitLayer ( checked );
161
+ mLegend ->adjustBoxSize ();
162
+ mLegend ->update ();
163
+ mLegend ->endCommand ();
164
+ }
165
+ }
166
+
167
+ void QgsComposerLegendWidget::on_mEqualColumnWidthCheckBox_toggled ( bool checked )
168
+ {
169
+ if ( mLegend )
170
+ {
171
+ mLegend ->beginCommand ( tr ( " Legend equal column width" ), QgsComposerMergeCommand::LegendEqualColumnWidth );
172
+ mLegend ->setEqualColumnWidth ( checked );
173
+ mLegend ->adjustBoxSize ();
174
+ mLegend ->update ();
175
+ mLegend ->endCommand ();
176
+ }
150
177
}
151
178
152
179
void QgsComposerLegendWidget::on_mSymbolWidthSpinBox_valueChanged ( double d )
@@ -731,6 +758,8 @@ void QgsComposerLegendWidget::blockAllSignals( bool b )
731
758
mCheckBoxAutoUpdate ->blockSignals ( b );
732
759
mMapComboBox ->blockSignals ( b );
733
760
mColumnCountSpinBox ->blockSignals ( b );
761
+ mSplitLayerCheckBox ->blockSignals ( b );
762
+ mEqualColumnWidthCheckBox ->blockSignals ( b );
734
763
mSymbolWidthSpinBox ->blockSignals ( b );
735
764
mSymbolHeightSpinBox ->blockSignals ( b );
736
765
mGroupSpaceSpinBox ->blockSignals ( b );
0 commit comments