Skip to content

Commit 8948607

Browse files
committed
Followup 31d7be
Tweak some API and docs, and fix overlapping UI widgets
1 parent fe54a78 commit 8948607

6 files changed

+157
-142
lines changed

python/core/qgsdiagramrendererv2.sip

+19-5
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ class QgsDiagramSettings
260260
#include <qgsdiagramrendererv2.h>
261261
%End
262262
public:
263+
264+
//! @deprecated use QgsSymbolV2::OutputUnit instead
263265
enum SizeType
264266
{
265267
MM,
@@ -289,14 +291,26 @@ class QgsDiagramSettings
289291
//! @note added in 2.10
290292
QList< QString > categoryLabels;
291293
QSizeF size; //size
292-
//! Diagram size unit index (mm, map units, or pixels)
294+
295+
/** Diagram size unit
296+
*/
293297
QgsSymbolV2::OutputUnit sizeType;
294-
//! Diagram size unit scale
298+
299+
/** Diagram size unit scale
300+
* @note added in 2.16
301+
*/
295302
QgsMapUnitScale sizeScale;
296-
//! Line unit index (mm, map units, or pixels)
297-
QgsSymbolV2::OutputUnit lineSizeType;
298-
//! Line unit scale
303+
304+
/** Line unit index
305+
* @note added in 2.16
306+
*/
307+
QgsSymbolV2::OutputUnit lineSizeUnit;
308+
309+
/** Line unit scale
310+
* @note added in 2.16
311+
*/
299312
QgsMapUnitScale lineSizeScale;
313+
300314
QColor backgroundColor;
301315
QColor penColor;
302316
double penWidth;

src/app/qgsdiagramproperties.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
266266
mScaleVisibilityGroupBox->setChecked( settingList.at( 0 ).scaleBasedVisibility );
267267
mDiagramUnitComboBox->setUnit( settingList.at( 0 ).sizeType );
268268
mDiagramUnitComboBox->setMapUnitScale( settingList.at( 0 ).sizeScale );
269-
mDiagramLineUnitComboBox->setUnit( settingList.at( 0 ).lineSizeType );
269+
mDiagramLineUnitComboBox->setUnit( settingList.at( 0 ).lineSizeUnit );
270270
mDiagramLineUnitComboBox->setMapUnitScale( settingList.at( 0 ).lineSizeScale );
271271

272272
if ( settingList.at( 0 ).labelPlacementMethod == QgsDiagramSettings::Height )
@@ -699,7 +699,7 @@ void QgsDiagramProperties::apply()
699699
ds.size = QSizeF( mDiagramSizeSpinBox->value(), mDiagramSizeSpinBox->value() );
700700
ds.sizeType = mDiagramUnitComboBox->unit();
701701
ds.sizeScale = mDiagramUnitComboBox->getMapUnitScale();
702-
ds.lineSizeType = mDiagramLineUnitComboBox->unit();
702+
ds.lineSizeUnit = mDiagramLineUnitComboBox->unit();
703703
ds.lineSizeScale = mDiagramLineUnitComboBox->getMapUnitScale();
704704
ds.labelPlacementMethod = static_cast<QgsDiagramSettings::LabelPlacementMethod>( mLabelPlacementComboBox->itemData( mLabelPlacementComboBox->currentIndex() ).toInt() );
705705
ds.scaleByArea = mScaleDependencyComboBox->itemData( mScaleDependencyComboBox->currentIndex() ).toBool();

src/core/diagram/qgsdiagram.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ QgsExpression *QgsDiagram::getExpression( const QString &expression, const QgsEx
7070

7171
void QgsDiagram::setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRenderContext& c )
7272
{
73-
pen.setWidthF( QgsSymbolLayerV2Utils::convertToPainterUnits( c, s.penWidth, s.lineSizeType, s.lineSizeScale ) );
73+
pen.setWidthF( QgsSymbolLayerV2Utils::convertToPainterUnits( c, s.penWidth, s.lineSizeUnit, s.lineSizeScale ) );
7474
}
7575

7676

src/core/qgsdiagramrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void QgsDiagramSettings::readXML( const QDomElement& elem, const QgsVectorLayer*
194194
sizeScale = QgsSymbolLayerV2Utils::decodeMapUnitScale( elem.attribute( "sizeScale" ) );
195195

196196
//line width unit type and scale
197-
lineSizeType = QgsSymbolLayerV2Utils::decodeOutputUnit( elem.attribute( "lineSizeType" ) );
197+
lineSizeUnit = QgsSymbolLayerV2Utils::decodeOutputUnit( elem.attribute( "lineSizeType" ) );
198198
lineSizeScale = QgsSymbolLayerV2Utils::decodeMapUnitScale( elem.attribute( "lineSizeScale" ) );
199199

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

312312
//line width unit type and scale
313-
categoryElem.setAttribute( "lineSizeType", QgsSymbolLayerV2Utils::encodeOutputUnit( lineSizeType ) );
313+
categoryElem.setAttribute( "lineSizeType", QgsSymbolLayerV2Utils::encodeOutputUnit( lineSizeUnit ) );
314314
categoryElem.setAttribute( "lineSizeScale", QgsSymbolLayerV2Utils::encodeMapUnitScale( lineSizeScale ) );
315315

316316
// label placement method (text diagram)

src/core/qgsdiagramrendererv2.h

+11-5
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ class CORE_EXPORT QgsDiagramLayerSettings
298298
class CORE_EXPORT QgsDiagramSettings
299299
{
300300
public:
301+
302+
//! @deprecated use QgsSymbolV2::OutputUnit instead
301303
enum SizeType
302304
{
303305
MM,
@@ -322,7 +324,7 @@ class CORE_EXPORT QgsDiagramSettings
322324
QgsDiagramSettings()
323325
: enabled( true )
324326
, sizeType( QgsSymbolV2::MM )
325-
, lineSizeType( QgsSymbolV2::MM )
327+
, lineSizeUnit( QgsSymbolV2::MM )
326328
, penWidth( 0.0 )
327329
, labelPlacementMethod( QgsDiagramSettings::Height )
328330
, diagramOrientation( QgsDiagramSettings::Up )
@@ -342,22 +344,26 @@ class CORE_EXPORT QgsDiagramSettings
342344
//! @note added in 2.10
343345
QList< QString > categoryLabels;
344346
QSizeF size; //size
345-
/** Diagram size unit index (mm, map units, or pixels)
346-
* @note added in 2.16
347+
348+
/** Diagram size unit
347349
*/
348350
QgsSymbolV2::OutputUnit sizeType;
351+
349352
/** Diagram size unit scale
350353
* @note added in 2.16
351354
*/
352355
QgsMapUnitScale sizeScale;
353-
/** Line unit index (mm, map units, or pixels)
356+
357+
/** Line unit index
354358
* @note added in 2.16
355359
*/
356-
QgsSymbolV2::OutputUnit lineSizeType;
360+
QgsSymbolV2::OutputUnit lineSizeUnit;
361+
357362
/** Line unit scale
358363
* @note added in 2.16
359364
*/
360365
QgsMapUnitScale lineSizeScale;
366+
361367
QColor backgroundColor;
362368
QColor penColor;
363369
double penWidth;

0 commit comments

Comments
 (0)