Skip to content
Permalink
Browse files

Modernise diagram properties UI:

Switch to stacked widget, QgsScaleRangeWidget, QgsFieldExpression
widget, QgsDoubleSpinBoxes.

Rearrange and reword controls to clarify their behaviour.
  • Loading branch information
nyalldawson committed Apr 22, 2015
1 parent 16af787 commit b2ca7faf3e07a8bd770050bb525ef8d9d37074dd
@@ -87,6 +87,7 @@ class QgsDiagramSettings
bool scaleByArea;
int angleOffset;

bool scaleBasedVisibility;
//scale range (-1 if no lower / upper bound )
double minScaleDenominator;
double maxScaleDenominator;

Large diffs are not rendered by default.

@@ -38,15 +38,13 @@ class APP_EXPORT QgsDiagramProperties : public QWidget, private Ui::QgsDiagramPr
public slots:
void apply();
void on_mDiagramTypeComboBox_currentIndexChanged( int index );
void on_mTransparencySlider_valueChanged( int value );
void on_mAddCategoryPushButton_clicked();
void on_mAttributesTreeWidget_itemDoubleClicked( QTreeWidgetItem * item, int column );
void on_mFindMaximumValueButton_clicked();
void on_mRemoveCategoryPushButton_clicked();
void on_mDiagramFontButton_clicked();
void on_mDiagramAttributesTreeWidget_itemDoubleClicked( QTreeWidgetItem * item, int column );
void on_mEngineSettingsButton_clicked();
void showSizeAttributeExpressionDialog();
void showAddAttributeExpressionDialog();
void on_mDiagramStackedWidget_currentChanged( int index );
void on_mPlacementComboBox_currentIndexChanged( int index );
@@ -56,9 +54,6 @@ class APP_EXPORT QgsDiagramProperties : public QWidget, private Ui::QgsDiagramPr

QgsVectorLayer* mLayer;

private:
int mAvailableAttributes;

};

#endif // QGSDIAGRAMPROPERTIES_H
@@ -91,6 +91,14 @@ void QgsDiagramSettings::readXML( const QDomElement& elem, const QgsVectorLayer*

minScaleDenominator = elem.attribute( "minScaleDenominator", "-1" ).toDouble();
maxScaleDenominator = elem.attribute( "maxScaleDenominator", "-1" ).toDouble();
if ( elem.hasAttribute( "scaleBasedVisibility" ) )
{
scaleBasedVisibility = ( elem.attribute( "scaleBasedVisibility", "1" ) != "0" );
}
else
{
scaleBasedVisibility = minScaleDenominator >= 0 && maxScaleDenominator >= 0;
}

//mm vs map units
if ( elem.attribute( "sizeType" ) == "MM" )
@@ -199,6 +207,7 @@ void QgsDiagramSettings::writeXML( QDomElement& rendererElem, QDomDocument& doc,
categoryElem.setAttribute( "penColor", penColor.name() );
categoryElem.setAttribute( "penAlpha", penColor.alpha() );
categoryElem.setAttribute( "penWidth", QString::number( penWidth ) );
categoryElem.setAttribute( "scaleBasedVisibility", scaleBasedVisibility );
categoryElem.setAttribute( "minScaleDenominator", QString::number( minScaleDenominator ) );
categoryElem.setAttribute( "maxScaleDenominator", QString::number( maxScaleDenominator ) );
categoryElem.setAttribute( "transparency", QString::number( transparency ) );
@@ -120,6 +120,7 @@ class CORE_EXPORT QgsDiagramSettings
, transparency( 0 )
, scaleByArea( true )
, angleOffset( 90 * 16 ) //top
, scaleBasedVisibility( false )
, minScaleDenominator( -1 )
, maxScaleDenominator( -1 )
, minimumSize( 0.0 )
@@ -140,6 +141,7 @@ class CORE_EXPORT QgsDiagramSettings
bool scaleByArea;
int angleOffset;

bool scaleBasedVisibility;
//scale range (-1 if no lower / upper bound )
double minScaleDenominator;
double maxScaleDenominator;

0 comments on commit b2ca7fa

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