Skip to content
Permalink
Browse files

Rename API methods as requested

  • Loading branch information
nyalldawson committed Mar 22, 2020
1 parent 1887846 commit 4079878dfb960f9214581ac54ed0df957a8bae13
@@ -231,52 +231,52 @@ transferred to the scalebar.
.. versionadded:: 3.14
%End

QgsFillSymbol *fillSymbol1() const;
QgsFillSymbol *fillSymbol() const;
%Docstring
Returns the primary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

.. seealso:: :py:func:`setFillSymbol1`
.. seealso:: :py:func:`setFillSymbol`

.. seealso:: :py:func:`fillSymbol2`
.. seealso:: :py:func:`alternateFillSymbol`

.. versionadded:: 3.14
%End

void setFillSymbol1( QgsFillSymbol *symbol /Transfer/ );
void setFillSymbol( QgsFillSymbol *symbol /Transfer/ );
%Docstring
Sets the primary fill ``symbol`` used to render the scalebar (only used for some scalebar types). Ownership of ``symbol`` is
transferred to the scalebar.

.. seealso:: :py:func:`fillSymbol1`
.. seealso:: :py:func:`fillSymbol`

.. seealso:: :py:func:`setFillSymbol2`
.. seealso:: :py:func:`setAlternateFillSymbol`

.. versionadded:: 3.14
%End

QgsFillSymbol *fillSymbol2() const;
QgsFillSymbol *alternateFillSymbol() const;
%Docstring
Returns the secondary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

.. seealso:: :py:func:`setFillSymbol2`
.. seealso:: :py:func:`setAlternateFillSymbol`

.. seealso:: :py:func:`fillSymbol1`
.. seealso:: :py:func:`fillSymbol`

.. versionadded:: 3.14
%End

void setFillSymbol2( QgsFillSymbol *symbol /Transfer/ );
void setAlternateFillSymbol( QgsFillSymbol *symbol /Transfer/ );
%Docstring
Sets the secondary fill ``symbol`` used to render the scalebar (only used for some scalebar types). Ownership of ``symbol`` is
transferred to the scalebar.

.. seealso:: :py:func:`fillSymbol2`
.. seealso:: :py:func:`alternateFillSymbol`

.. seealso:: :py:func:`setFillSymbol1`
.. seealso:: :py:func:`setFillSymbol`

.. versionadded:: 3.14
%End
@@ -334,7 +334,7 @@ Returns the color used for fills in the scalebar.
.. seealso:: :py:func:`fillColor2`

.. deprecated::
use fillSymbol1() instead
use fillSymbol() instead
%End

void setFillColor( const QColor &color ) /Deprecated/;
@@ -346,7 +346,7 @@ Sets the ``color`` used for fills in the scalebar.
.. seealso:: :py:func:`setFillColor2`

.. deprecated::
use setFillSymbol1() instead
use setFillSymbol() instead
%End

QColor fillColor2() const /Deprecated/;
@@ -358,7 +358,7 @@ Returns the secondary color used for fills in the scalebar.
.. seealso:: :py:func:`fillColor`

.. deprecated::
use fillSymbol2() instead
use alternateFillSymbol() instead
%End

void setFillColor2( const QColor &color ) /Deprecated/;
@@ -370,7 +370,7 @@ Sets the secondary ``color`` used for fills in the scalebar.
.. seealso:: :py:func:`setFillColor2`

.. deprecated::
use setFillSymbol2() instead
use setAlternateFillSymbol() instead
%End

QColor lineColor() const /Deprecated/;
@@ -434,7 +434,7 @@ Returns the primary brush for the scalebar.
.. seealso:: :py:func:`pen`

.. deprecated::
use fillSymbol1() instead
use fillSymbol() instead
%End

QBrush brush2() const /Deprecated/;
@@ -447,7 +447,7 @@ as single and double box styles.
.. seealso:: :py:func:`brush`

.. deprecated::
use fillSymbol2() instead
use alternateFillSymbol() instead
%End

double height() const;
@@ -299,7 +299,7 @@ Returns the color used for fills in the scalebar.
.. seealso:: :py:func:`fillColor2`

.. deprecated::
use fillSymbol1() instead.
use fillSymbol() instead.
%End

void setFillColor( const QColor &color ) /Deprecated/;
@@ -311,7 +311,7 @@ Sets the ``color`` used for fills in the scalebar.
.. seealso:: :py:func:`setFillColor2`

.. deprecated::
use setFillSymbol1() instead.
use setFillSymbol() instead.
%End

QColor fillColor2() const /Deprecated/;
@@ -323,7 +323,7 @@ Returns the secondary color used for fills in the scalebar.
.. seealso:: :py:func:`fillColor`

.. deprecated::
use fillSymbol2() instead
use alternateFillSymbol() instead
%End

void setFillColor2( const QColor &color ) /Deprecated/;
@@ -335,7 +335,7 @@ Sets the secondary ``color`` used for fills in the scalebar.
.. seealso:: :py:func:`setFillColor2`

.. deprecated::
use setFillSymbol2() instead.
use setAlternateFillSymbol() instead.
%End

QColor lineColor() const /Deprecated/;
@@ -421,53 +421,53 @@ transferred to the scalebar.
.. versionadded:: 3.14
%End

QgsFillSymbol *fillSymbol1() const;
QgsFillSymbol *fillSymbol() const;
%Docstring
Returns the primary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

.. seealso:: :py:func:`setFillSymbol1`
.. seealso:: :py:func:`setFillSymbol`

.. seealso:: :py:func:`fillSymbol2`
.. seealso:: :py:func:`alternateFillSymbol`

.. versionadded:: 3.14
%End

void setFillSymbol1( QgsFillSymbol *symbol /Transfer/ );
void setFillSymbol( QgsFillSymbol *symbol /Transfer/ );
%Docstring
Sets the primary fill ``symbol`` used to render the scalebar (only used for some scalebar types). Ownership of ``symbol`` is
transferred to the scalebar.

.. seealso:: :py:func:`fillSymbol1`
.. seealso:: :py:func:`fillSymbol`

.. seealso:: :py:func:`setFillSymbol2`
.. seealso:: :py:func:`setAlternateFillSymbol`

.. versionadded:: 3.14
%End


QgsFillSymbol *fillSymbol2() const;
QgsFillSymbol *alternateFillSymbol() const;
%Docstring
Returns the secondary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

.. seealso:: :py:func:`setFillSymbol2`
.. seealso:: :py:func:`setAlternateFillSymbol`

.. seealso:: :py:func:`fillSymbol1`
.. seealso:: :py:func:`fillSymbol`

.. versionadded:: 3.14
%End

void setFillSymbol2( QgsFillSymbol *symbol /Transfer/ );
void setAlternateFillSymbol( QgsFillSymbol *symbol /Transfer/ );
%Docstring
Sets the secondary fill ``symbol`` used to render the scalebar (only used for some scalebar types). Ownership of ``symbol`` is
transferred to the scalebar.

.. seealso:: :py:func:`fillSymbol2`
.. seealso:: :py:func:`alternateFillSymbol`

.. seealso:: :py:func:`setFillSymbol1`
.. seealso:: :py:func:`setFillSymbol`

.. versionadded:: 3.14
%End
@@ -483,7 +483,7 @@ Returns the primary brush used for filling the scalebar.
.. seealso:: :py:func:`pen`

.. deprecated::
use fillSymbol1() instead
use fillSymbol() instead
%End

void setBrush( const QBrush &brush ) /Deprecated/;
@@ -493,7 +493,7 @@ Sets the primary brush used for filling the scalebar.
.. seealso:: :py:func:`brush`

.. deprecated::
use setFillSymbol1() instead
use setFillSymbol() instead
%End

QBrush brush2() const /Deprecated/;
@@ -506,7 +506,7 @@ as single and double box styles.
.. seealso:: :py:func:`brush`

.. deprecated::
use fillSymbol2() instead
use alternateFillSymbol() instead
%End

void setBrush2( const QBrush &brush ) /Deprecated/;
@@ -516,7 +516,7 @@ Sets the secondary brush used for filling the scalebar.
.. seealso:: :py:func:`brush`

.. deprecated::
use setFillSymbol2() instead
use setAlternateFillSymbol() instead
%End

double height() const;
@@ -161,7 +161,7 @@ void QgsDecorationScaleBar::setupScaleBar()
{
fill->setStrokeStyle( Qt::NoPen );
}
mSettings.setFillSymbol1( fillSymbol.release() );
mSettings.setFillSymbol( fillSymbol.release() );

std::unique_ptr< QgsLineSymbol > lineSymbol = qgis::make_unique< QgsLineSymbol >();
lineSymbol->setColor( mColor ); // Compatibility with pre 3.2 configuration
@@ -183,15 +183,15 @@ void QgsDecorationScaleBar::setupScaleBar()
{
fill->setStrokeStyle( Qt::NoPen );
}
mSettings.setFillSymbol1( fillSymbol.release() );
mSettings.setFillSymbol( fillSymbol.release() );

std::unique_ptr< QgsFillSymbol > fillSymbol2 = qgis::make_unique< QgsFillSymbol >();
fillSymbol2->setColor( QColor( 255, 255, 255, 0 ) );
if ( QgsSimpleFillSymbolLayer *fill = dynamic_cast< QgsSimpleFillSymbolLayer * >( fillSymbol2->symbolLayer( 0 ) ) )
{
fill->setStrokeStyle( Qt::NoPen );
}
mSettings.setFillSymbol2( fillSymbol2.release() );
mSettings.setAlternateFillSymbol( fillSymbol2.release() );

mSettings.setHeight( mStyleIndex == 2 ? 1 : 3 );
std::unique_ptr< QgsLineSymbol > lineSymbol = qgis::make_unique< QgsLineSymbol >();
@@ -1057,12 +1057,12 @@ bool QgsCompositionConverter::readScaleBarXml( QgsLayoutItemScaleBar *layoutItem

if ( redOk && greenOk && blueOk && alphaOk )
{
layoutItem->fillSymbol1()->setColor( QColor( fillRed, fillGreen, fillBlue, fillAlpha ) );
layoutItem->fillSymbol()->setColor( QColor( fillRed, fillGreen, fillBlue, fillAlpha ) );
}
}
else
{
layoutItem->fillSymbol1()->setColor( QColor( itemElem.attribute( QStringLiteral( "brushColor" ), QStringLiteral( "#000000" ) ) ) );
layoutItem->fillSymbol()->setColor( QColor( itemElem.attribute( QStringLiteral( "brushColor" ), QStringLiteral( "#000000" ) ) ) );
}

//fill color 2
@@ -1080,12 +1080,12 @@ bool QgsCompositionConverter::readScaleBarXml( QgsLayoutItemScaleBar *layoutItem

if ( redOk && greenOk && blueOk && alphaOk )
{
layoutItem->fillSymbol2()->setColor( QColor( fillRed, fillGreen, fillBlue, fillAlpha ) );
layoutItem->alternateFillSymbol()->setColor( QColor( fillRed, fillGreen, fillBlue, fillAlpha ) );
}
}
else
{
layoutItem->fillSymbol2()->setColor( QColor( itemElem.attribute( QStringLiteral( "brush2Color" ), QStringLiteral( "#ffffff" ) ) ) );
layoutItem->alternateFillSymbol()->setColor( QColor( itemElem.attribute( QStringLiteral( "brush2Color" ), QStringLiteral( "#ffffff" ) ) ) );
}

std::unique_ptr< QgsLineSymbol > lineSymbol = qgis::make_unique< QgsLineSymbol >();

0 comments on commit 4079878

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