Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename API methods as requested
  • Loading branch information
nyalldawson committed Mar 22, 2020
1 parent 1887846 commit 4079878
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 141 deletions.
36 changes: 18 additions & 18 deletions python/core/auto_generated/layout/qgslayoutitemscalebar.sip.in
Expand Up @@ -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
Expand Down Expand Up @@ -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/;
Expand All @@ -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/;
Expand All @@ -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/;
Expand All @@ -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/;
Expand Down Expand Up @@ -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/;
Expand All @@ -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;
Expand Down
40 changes: 20 additions & 20 deletions python/core/auto_generated/scalebar/qgsscalebarsettings.sip.in
Expand Up @@ -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/;
Expand All @@ -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/;
Expand All @@ -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/;
Expand All @@ -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/;
Expand Down Expand Up @@ -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
Expand All @@ -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/;
Expand All @@ -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/;
Expand All @@ -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/;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/app/decorations/qgsdecorationscalebar.cpp
Expand Up @@ -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
Expand All @@ -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 >();
Expand Down
8 changes: 4 additions & 4 deletions src/core/layout/qgscompositionconverter.cpp
Expand Up @@ -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
Expand All @@ -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 >();
Expand Down

0 comments on commit 4079878

Please sign in to comment.