29 mTextFormat.
setColor( QColor( 0, 0, 0 ) );
31 mNumericFormat = qgis::make_unique< QgsBasicNumericFormat >();
33 mLineSymbol = qgis::make_unique< QgsLineSymbol >();
34 mLineSymbol->setColor( QColor( 0, 0, 0 ) );
35 mLineSymbol->setWidth( 0.3 );
38 line->setPenJoinStyle( Qt::MiterJoin );
39 line->setPenCapStyle( Qt::SquareCap );
42 mDivisionLineSymbol.reset( mLineSymbol->clone() );
43 mSubdivisionLineSymbol.reset( mLineSymbol->clone() );
45 mFillSymbol = qgis::make_unique< QgsFillSymbol >();
46 mFillSymbol->setColor( QColor( 0, 0, 0 ) );
49 fill->setStrokeStyle( Qt::NoPen );
51 mAlternateFillSymbol = qgis::make_unique< QgsFillSymbol >();
52 mAlternateFillSymbol->setColor( QColor( 255, 255, 255 ) );
55 fill->setStrokeStyle( Qt::NoPen );
60 : mNumSegments( other.mNumSegments )
61 , mNumSegmentsLeft( other.mNumSegmentsLeft )
62 , mNumSubdivisions( other.mNumSubdivisions )
63 , mSubdivisionsHeight( other.mSubdivisionsHeight )
64 , mNumUnitsPerSegment( other.mNumUnitsPerSegment )
65 , mNumMapUnitsPerScaleBarUnit( other.mNumMapUnitsPerScaleBarUnit )
66 , mSegmentSizeMode( other.mSegmentSizeMode )
67 , mMinBarWidth( other.mMinBarWidth )
68 , mMaxBarWidth( other.mMaxBarWidth )
69 , mUnitLabeling( other.mUnitLabeling )
70 , mTextFormat( other.mTextFormat )
71 , mHeight( other.mHeight )
72 , mLineSymbol( other.mLineSymbol->clone() )
73 , mDivisionLineSymbol( other.mDivisionLineSymbol->clone() )
74 , mSubdivisionLineSymbol( other.mSubdivisionLineSymbol->clone() )
75 , mFillSymbol( other.mFillSymbol->clone() )
76 , mAlternateFillSymbol( other.mAlternateFillSymbol->clone() )
77 , mLabelBarSpace( other.mLabelBarSpace )
78 , mLabelVerticalPlacement( other.mLabelVerticalPlacement )
79 , mLabelHorizontalPlacement( other.mLabelHorizontalPlacement )
80 , mBoxContentSpace( other.mBoxContentSpace )
81 , mAlignment( other.mAlignment )
82 , mUnits( other.mUnits )
83 , mNumericFormat( other.mNumericFormat->clone() )
90 mNumSegments = other.mNumSegments;
91 mNumSegmentsLeft = other.mNumSegmentsLeft;
92 mNumSubdivisions = other.mNumSubdivisions;
93 mSubdivisionsHeight = other.mSubdivisionsHeight;
94 mNumUnitsPerSegment = other.mNumUnitsPerSegment;
95 mNumMapUnitsPerScaleBarUnit = other.mNumMapUnitsPerScaleBarUnit;
96 mSegmentSizeMode = other.mSegmentSizeMode;
97 mMinBarWidth = other.mMinBarWidth;
98 mMaxBarWidth = other.mMaxBarWidth;
99 mUnitLabeling = other.mUnitLabeling;
100 mTextFormat = other.mTextFormat;
101 mLineSymbol.reset( other.mLineSymbol->clone() );
102 mDivisionLineSymbol.reset( other.mDivisionLineSymbol->clone() );
103 mSubdivisionLineSymbol.reset( other.mSubdivisionLineSymbol->clone() );
104 mFillSymbol.reset( other.mFillSymbol->clone() );
105 mAlternateFillSymbol.reset( other.mAlternateFillSymbol->clone() );
106 mHeight = other.mHeight;
107 mLabelBarSpace = other.mLabelBarSpace;
108 mLabelVerticalPlacement = other.mLabelVerticalPlacement;
109 mLabelHorizontalPlacement = other.mLabelHorizontalPlacement;
110 mBoxContentSpace = other.mBoxContentSpace;
111 mAlignment = other.mAlignment;
112 mUnits = other.mUnits;
113 mNumericFormat.reset( other.mNumericFormat->clone() );
119 return mFillSymbol->color();
124 mFillSymbol->setColor( color );
129 return mAlternateFillSymbol->color();
134 mAlternateFillSymbol->setColor( color );
139 return mLineSymbol->color();
144 for (
QgsLineSymbol *symbol : { mLineSymbol.get(), mDivisionLineSymbol.get(), mSubdivisionLineSymbol.get() } )
146 symbol->setColor( color );
152 return mLineSymbol->width();
157 for (
QgsLineSymbol *symbol : { mLineSymbol.get(), mDivisionLineSymbol.get(), mSubdivisionLineSymbol.get() } )
159 symbol->setWidth( width );
166 QPen
pen( mLineSymbol->color() );
169 pen.setJoinStyle( line->penJoinStyle() );
170 pen.setCapStyle( line->penCapStyle() );
172 pen.setWidthF( mLineSymbol->width() );
178 for (
QgsLineSymbol *symbol : { mLineSymbol.get(), mDivisionLineSymbol.get(), mSubdivisionLineSymbol.get() } )
180 symbol->setColor(
pen.color() );
181 symbol->setWidth(
pen.widthF() );
185 line->setPenJoinStyle(
pen.joinStyle() );
186 line->setPenCapStyle(
pen.capStyle() );
193 return mLineSymbol.get();
198 mLineSymbol.reset( symbol );
203 return mDivisionLineSymbol.get();
208 mDivisionLineSymbol.reset( symbol );
213 return mSubdivisionLineSymbol.get();
218 mSubdivisionLineSymbol.reset( symbol );
223 return mFillSymbol.get();
228 mFillSymbol.reset( symbol );
233 return mAlternateFillSymbol.get();
238 mAlternateFillSymbol.reset( symbol );
244 b.setColor( mFillSymbol->color() );
247 b.setStyle( fill->brushStyle() );
255 mFillSymbol->setColor(
brush.color() );
258 fill->setBrushStyle(
brush.style() );
265 b.setColor( mAlternateFillSymbol->color() );
268 b.setStyle( fill->brushStyle() );
276 mAlternateFillSymbol->setColor(
brush.color() );
279 fill->setBrushStyle(
brush.style() );
287 return line->penJoinStyle();
289 return Qt::MiterJoin;
294 for (
QgsLineSymbol *symbol : { mLineSymbol.get(), mDivisionLineSymbol.get(), mSubdivisionLineSymbol.get() } )
298 line->setPenJoinStyle( style );
307 return line->penCapStyle();
314 for (
QgsLineSymbol *symbol : { mLineSymbol.get(), mDivisionLineSymbol.get(), mSubdivisionLineSymbol.get() } )
318 line->setPenCapStyle( style );
325 return mNumericFormat.get();
330 mNumericFormat.reset( format );