Skip to content

Commit

Permalink
Add missing fox for QgsFontMarkerSymbolLayer, improve existing dox
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 1, 2018
1 parent 644ea71 commit 3ecb154
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 24 deletions.
85 changes: 77 additions & 8 deletions python/core/auto_generated/symbology/qgsmarkersymbollayer.sip.in
Expand Up @@ -715,7 +715,14 @@ class QgsFontMarkerSymbolLayer : QgsMarkerSymbolLayer


static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
Creates a new QgsFontMarkerSymbolLayer from a property map (see properties())
%End

static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
%Docstring
Creates a new QgsFontMarkerSymbolLayer from an SLD XML ``element``.
%End


virtual QString layerType() const;
Expand All @@ -741,66 +748,128 @@ class QgsFontMarkerSymbolLayer : QgsMarkerSymbolLayer


QString fontFamily() const;
%Docstring
Returns the font family name for the associated font which will be used to render the point.

.. seealso:: :py:func:`setFontFamily`
%End

void setFontFamily( const QString &family );
%Docstring
Sets the font ``family`` for the font which will be used to render the point.

.. seealso:: :py:func:`fontFamily`
%End

QChar character() const;
%Docstring
Returns the character used when rendering points.

.. seealso:: :py:func:`setCharacter`
%End

void setCharacter( QChar ch );
%Docstring
Sets the character used when rendering points.

.. seealso:: :py:func:`character`
%End

virtual QColor strokeColor() const;
virtual void setStrokeColor( const QColor &color );

double strokeWidth() const;
%Docstring
Gets stroke width.
Returns the marker's stroke width. Units are retrieved by strokeWidthUnit()

.. seealso:: :py:func:`setStrokeWidth`

.. seealso:: :py:func:`strokeWidthUnit`

.. seealso:: :py:func:`strokeWidthMapUnitScale`

.. versionadded:: 2.16
%End

void setStrokeWidth( double width );
%Docstring
Set stroke width.
Set's the marker's stroke ``width``. Units are set by setStrokeWidthUnit().

.. seealso:: :py:func:`strokeWidth`

.. seealso:: :py:func:`setStrokeWidthUnit`

.. seealso:: :py:func:`setStrokeWidthMapUnitScale`

.. versionadded:: 2.16
%End

QgsUnitTypes::RenderUnit strokeWidthUnit() const;
%Docstring
Gets stroke width unit.
Returns the stroke width unit.

.. seealso:: :py:func:`setStrokeWidthUnit`

.. seealso:: :py:func:`strokeWidth`

.. seealso:: :py:func:`strokeWidthMapUnitScale`

.. versionadded:: 2.16
%End

void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Set stroke width unit.
Sets the stroke width ``unit``.

.. seealso:: :py:func:`strokeWidthUnit`

.. seealso:: :py:func:`setStrokeWidth`

.. seealso:: :py:func:`setStrokeWidthMapUnitScale`

.. versionadded:: 2.16
%End

const QgsMapUnitScale &strokeWidthMapUnitScale() const;
%Docstring
Gets stroke width map unit scale.
Returns the stroke width map unit scale.

.. seealso:: :py:func:`setStrokeWidthMapUnitScale`

.. seealso:: :py:func:`strokeWidth`

.. seealso:: :py:func:`strokeWidthUnit`

.. versionadded:: 2.16
%End

void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
%Docstring
Set stroke width map unit scale.
Sets the stroke width map unit ``scale``.

.. seealso:: :py:func:`strokeWidthMapUnitScale`

.. seealso:: :py:func:`setStrokeWidth`

.. seealso:: :py:func:`setStrokeWidthUnit`

.. versionadded:: 2.16
%End

Qt::PenJoinStyle penJoinStyle() const;
%Docstring
Gets stroke join style.
Returns the stroke join style.

.. seealso:: :py:func:`setPenJoinStyle`

.. versionadded:: 2.16
%End

void setPenJoinStyle( Qt::PenJoinStyle style );
%Docstring
Set stroke join style.
Sets the stroke join ``style``.

.. seealso:: :py:func:`penJoinStyle`

.. versionadded:: 2.16
%End
Expand Down
104 changes: 88 additions & 16 deletions src/core/symbology/qgsmarkersymbollayer.h
Expand Up @@ -666,7 +666,14 @@ class CORE_EXPORT QgsFontMarkerSymbolLayer : public QgsMarkerSymbolLayer

// static stuff

/**
* Creates a new QgsFontMarkerSymbolLayer from a property map (see properties())
*/
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

/**
* Creates a new QgsFontMarkerSymbolLayer from an SLD XML \a element.
*/
static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;

// implemented from base classes
Expand All @@ -687,53 +694,118 @@ class CORE_EXPORT QgsFontMarkerSymbolLayer : public QgsMarkerSymbolLayer

// new methods

/**
* Returns the font family name for the associated font which will be used to render the point.
*
* \see setFontFamily()
*/
QString fontFamily() const { return mFontFamily; }

/**
* Sets the font \a family for the font which will be used to render the point.
*
* \see fontFamily()
*/
void setFontFamily( const QString &family ) { mFontFamily = family; }

/**
* Returns the character used when rendering points.
*
* \see setCharacter()
*/
QChar character() const { return mChr; }

/**
* Sets the character used when rendering points.
*
* \see character()
*/
void setCharacter( QChar ch ) { mChr = ch; }

QColor strokeColor() const override { return mStrokeColor; }
void setStrokeColor( const QColor &color ) override { mStrokeColor = color; }

/**
* Gets stroke width.
* \since QGIS 2.16 */
* Returns the marker's stroke width. Units are retrieved by strokeWidthUnit()
*
* \see setStrokeWidth()
* \see strokeWidthUnit()
* \see strokeWidthMapUnitScale()
*
* \since QGIS 2.16
*/
double strokeWidth() const { return mStrokeWidth; }

/**
* Set stroke width.
* \since QGIS 2.16 */
* Set's the marker's stroke \a width. Units are set by setStrokeWidthUnit().
*
* \see strokeWidth()
* \see setStrokeWidthUnit()
* \see setStrokeWidthMapUnitScale()
*
* \since QGIS 2.16
*/
void setStrokeWidth( double width ) { mStrokeWidth = width; }

/**
* Gets stroke width unit.
* \since QGIS 2.16 */
* Returns the stroke width unit.
*
* \see setStrokeWidthUnit()
* \see strokeWidth()
* \see strokeWidthMapUnitScale()
*
* \since QGIS 2.16
*/
QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }

/**
* Set stroke width unit.
* \since QGIS 2.16 */
* Sets the stroke width \a unit.
*
* \see strokeWidthUnit()
* \see setStrokeWidth()
* \see setStrokeWidthMapUnitScale()
* \since QGIS 2.16
*/
void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }

/**
* Gets stroke width map unit scale.
* \since QGIS 2.16 */
* Returns the stroke width map unit scale.
*
* \see setStrokeWidthMapUnitScale()
* \see strokeWidth()
* \see strokeWidthUnit()
*
* \since QGIS 2.16
*/
const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }

/**
* Set stroke width map unit scale.
* \since QGIS 2.16 */
* Sets the stroke width map unit \a scale.
*
* \see strokeWidthMapUnitScale()
* \see setStrokeWidth()
* \see setStrokeWidthUnit()
*
* \since QGIS 2.16
*/
void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }

/**
* Gets stroke join style.
* \since QGIS 2.16 */
* Returns the stroke join style.
*
* \see setPenJoinStyle()
*
* \since QGIS 2.16
*/
Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }

/**
* Set stroke join style.
* \since QGIS 2.16 */
* Sets the stroke join \a style.
*
* \see penJoinStyle()
*
* \since QGIS 2.16
*/
void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }

QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
Expand Down

1 comment on commit 3ecb154

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 3ecb154 Oct 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson , TIL, QGIS was missing a fox! 😉

Please sign in to comment.