@@ -1363,6 +1363,17 @@ void QgsVectorLayerProperties::handleDiagramTypeChanged( const QString& itemtext
1363
1363
mLabelPlacementComboBox ->hide ();
1364
1364
mLabelPlacementLabel ->hide ();
1365
1365
}
1366
+
1367
+ if ( tr ( " Histogram" ) == itemtext )
1368
+ {
1369
+ mDiagramOptionsGroupBox ->show ();
1370
+ mBarWidthLabel ->show ();
1371
+ }
1372
+ else
1373
+ {
1374
+ mDiagramOptionsGroupBox ->hide ();
1375
+ mBarWidthLabel ->hide ();
1376
+ }
1366
1377
}
1367
1378
1368
1379
void QgsVectorLayerProperties::on_mIncreaseSmallDiagramsCheckBox_stateChanged ( int state )
@@ -1588,6 +1599,21 @@ void QgsVectorLayerProperties::on_mDiagramPenColorButton_clicked()
1588
1599
}
1589
1600
}
1590
1601
1602
+ void QgsVectorLayerProperties::on_mDisplayDiagramsCheckBox_stateChanged ( int state )
1603
+ {
1604
+ // Set all widget enabled states
1605
+ foreach ( QWidget *widget, mDiagramDetailWidgets )
1606
+ {
1607
+ widget->setEnabled ( Qt::Checked == state );
1608
+ }
1609
+
1610
+ // if enabled show diagram specific options
1611
+ if ( Qt::Checked == state )
1612
+ {
1613
+ handleDiagramTypeChanged ( mDiagramTypeComboBox ->currentText () );
1614
+ }
1615
+ }
1616
+
1591
1617
void QgsVectorLayerProperties::initDiagramTab ()
1592
1618
{
1593
1619
if ( !layer )
@@ -1698,7 +1724,7 @@ void QgsVectorLayerProperties::initDiagramTab()
1698
1724
}
1699
1725
mBackgroundColorButton ->setColor ( QColor ( 255 , 255 , 255 , 255 ) );
1700
1726
}
1701
- else
1727
+ else // already a diagram renderer present
1702
1728
{
1703
1729
mDisplayDiagramsCheckBox ->setChecked ( true );
1704
1730
@@ -1813,13 +1839,15 @@ void QgsVectorLayerProperties::initDiagramTab()
1813
1839
mDiagramTypeComboBox ->setCurrentIndex ( mDiagramTypeComboBox ->findText ( tr ( " Histogram" ) ) );
1814
1840
}
1815
1841
}
1816
- }
1842
+ } // if ( !dr ), else
1843
+
1844
+ // Popuplate the widget list with all widgets which should be enabled/disabled when diagrams are
1845
+ // enabled / disabled
1846
+ mDiagramDetailWidgets << mTypeLabel << mDiagramTypeComboBox << mPriorityLabel << mPriorityLowLabel
1847
+ << mPrioritySlider << mPriorityHighLabel << mAppearanceGroupBox << mVisibilityGroupBox << mSizeGroupBox
1848
+ << mPlacementGroupBox << mAttributesLabel << mDiagramAttributesComboBox << mRemoveCategoryPushButton
1849
+ << mAddCategoryPushButton << mDiagramAttributesTreeWidget << mDiagramOptionsGroupBox ;
1817
1850
1818
- // Hide/Show diagram specific widgets
1819
- // handleDiagramTypeChanged( mDiagramTypeComboBox->currentText() );
1820
- // Enable / disable small diagram scaling related widgets
1821
- // on_mFixedSizeCheckBox_stateChanged( mIncreaseSmallDiagramsCheckBox->checkState() );
1822
1851
connect ( mDiagramAttributesTreeWidget , SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ), this , SLOT ( handleDiagramItemDoubleClick ( QTreeWidgetItem*, int ) ) );
1823
1852
connect ( mDiagramTypeComboBox , SIGNAL ( currentIndexChanged ( const QString& ) ), this , SLOT ( handleDiagramTypeChanged ( const QString& ) ) );
1824
- // connect( mIncreaseSmallDiagramsCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( handleIncreaseSmallDiagramsChanged( int ) ) );
1825
1853
}
0 commit comments