Skip to content
Permalink
Browse files

Followup 31d7be

Tweak some API and docs, and fix overlapping UI widgets
  • Loading branch information
nyalldawson committed Apr 5, 2016
1 parent fe54a78 commit 8948607f7da83bb2e9205192334ca538c4361819
@@ -260,6 +260,8 @@ class QgsDiagramSettings
#include <qgsdiagramrendererv2.h>
%End
public:

//! @deprecated use QgsSymbolV2::OutputUnit instead
enum SizeType
{
MM,
@@ -289,14 +291,26 @@ class QgsDiagramSettings
//! @note added in 2.10
QList< QString > categoryLabels;
QSizeF size; //size
//! Diagram size unit index (mm, map units, or pixels)

/** Diagram size unit
*/
QgsSymbolV2::OutputUnit sizeType;
//! Diagram size unit scale

/** Diagram size unit scale
* @note added in 2.16
*/
QgsMapUnitScale sizeScale;
//! Line unit index (mm, map units, or pixels)
QgsSymbolV2::OutputUnit lineSizeType;
//! Line unit scale

/** Line unit index
* @note added in 2.16
*/
QgsSymbolV2::OutputUnit lineSizeUnit;

/** Line unit scale
* @note added in 2.16
*/
QgsMapUnitScale lineSizeScale;

QColor backgroundColor;
QColor penColor;
double penWidth;
@@ -266,7 +266,7 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
mScaleVisibilityGroupBox->setChecked( settingList.at( 0 ).scaleBasedVisibility );
mDiagramUnitComboBox->setUnit( settingList.at( 0 ).sizeType );
mDiagramUnitComboBox->setMapUnitScale( settingList.at( 0 ).sizeScale );
mDiagramLineUnitComboBox->setUnit( settingList.at( 0 ).lineSizeType );
mDiagramLineUnitComboBox->setUnit( settingList.at( 0 ).lineSizeUnit );
mDiagramLineUnitComboBox->setMapUnitScale( settingList.at( 0 ).lineSizeScale );

if ( settingList.at( 0 ).labelPlacementMethod == QgsDiagramSettings::Height )
@@ -699,7 +699,7 @@ void QgsDiagramProperties::apply()
ds.size = QSizeF( mDiagramSizeSpinBox->value(), mDiagramSizeSpinBox->value() );
ds.sizeType = mDiagramUnitComboBox->unit();
ds.sizeScale = mDiagramUnitComboBox->getMapUnitScale();
ds.lineSizeType = mDiagramLineUnitComboBox->unit();
ds.lineSizeUnit = mDiagramLineUnitComboBox->unit();
ds.lineSizeScale = mDiagramLineUnitComboBox->getMapUnitScale();
ds.labelPlacementMethod = static_cast<QgsDiagramSettings::LabelPlacementMethod>( mLabelPlacementComboBox->itemData( mLabelPlacementComboBox->currentIndex() ).toInt() );
ds.scaleByArea = mScaleDependencyComboBox->itemData( mScaleDependencyComboBox->currentIndex() ).toBool();
@@ -70,7 +70,7 @@ QgsExpression *QgsDiagram::getExpression( const QString &expression, const QgsEx

void QgsDiagram::setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRenderContext& c )
{
pen.setWidthF( QgsSymbolLayerV2Utils::convertToPainterUnits( c, s.penWidth, s.lineSizeType, s.lineSizeScale ) );
pen.setWidthF( QgsSymbolLayerV2Utils::convertToPainterUnits( c, s.penWidth, s.lineSizeUnit, s.lineSizeScale ) );
}


@@ -194,7 +194,7 @@ void QgsDiagramSettings::readXML( const QDomElement& elem, const QgsVectorLayer*
sizeScale = QgsSymbolLayerV2Utils::decodeMapUnitScale( elem.attribute( "sizeScale" ) );

//line width unit type and scale
lineSizeType = QgsSymbolLayerV2Utils::decodeOutputUnit( elem.attribute( "lineSizeType" ) );
lineSizeUnit = QgsSymbolLayerV2Utils::decodeOutputUnit( elem.attribute( "lineSizeType" ) );
lineSizeScale = QgsSymbolLayerV2Utils::decodeMapUnitScale( elem.attribute( "lineSizeScale" ) );

//label placement method
@@ -310,7 +310,7 @@ void QgsDiagramSettings::writeXML( QDomElement& rendererElem, QDomDocument& doc,
categoryElem.setAttribute( "sizeScale", QgsSymbolLayerV2Utils::encodeMapUnitScale( sizeScale ) );

//line width unit type and scale
categoryElem.setAttribute( "lineSizeType", QgsSymbolLayerV2Utils::encodeOutputUnit( lineSizeType ) );
categoryElem.setAttribute( "lineSizeType", QgsSymbolLayerV2Utils::encodeOutputUnit( lineSizeUnit ) );
categoryElem.setAttribute( "lineSizeScale", QgsSymbolLayerV2Utils::encodeMapUnitScale( lineSizeScale ) );

// label placement method (text diagram)
@@ -298,6 +298,8 @@ class CORE_EXPORT QgsDiagramLayerSettings
class CORE_EXPORT QgsDiagramSettings
{
public:

//! @deprecated use QgsSymbolV2::OutputUnit instead
enum SizeType
{
MM,
@@ -322,7 +324,7 @@ class CORE_EXPORT QgsDiagramSettings
QgsDiagramSettings()
: enabled( true )
, sizeType( QgsSymbolV2::MM )
, lineSizeType( QgsSymbolV2::MM )
, lineSizeUnit( QgsSymbolV2::MM )
, penWidth( 0.0 )
, labelPlacementMethod( QgsDiagramSettings::Height )
, diagramOrientation( QgsDiagramSettings::Up )
@@ -342,22 +344,26 @@ class CORE_EXPORT QgsDiagramSettings
//! @note added in 2.10
QList< QString > categoryLabels;
QSizeF size; //size
/** Diagram size unit index (mm, map units, or pixels)
* @note added in 2.16

/** Diagram size unit
*/
QgsSymbolV2::OutputUnit sizeType;

/** Diagram size unit scale
* @note added in 2.16
*/
QgsMapUnitScale sizeScale;
/** Line unit index (mm, map units, or pixels)

/** Line unit index
* @note added in 2.16
*/
QgsSymbolV2::OutputUnit lineSizeType;
QgsSymbolV2::OutputUnit lineSizeUnit;

/** Line unit scale
* @note added in 2.16
*/
QgsMapUnitScale lineSizeScale;

QColor backgroundColor;
QColor penColor;
double penWidth;

0 comments on commit 8948607

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