From 954d62f53a76e9f083fef1b88de56c7492286be1 Mon Sep 17 00:00:00 2001 From: rldhont Date: Sun, 20 Aug 2017 16:16:40 +0200 Subject: [PATCH] Update SIP for fixedAspectRatio in SVG marker --- .../core/symbology/qgsmarkersymbollayer.sip | 43 ++++++++++++++++++- python/core/symbology/qgssvgcache.sip | 4 ++ python/gui/symbology/qgssymbollayerwidget.sip | 5 --- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/python/core/symbology/qgsmarkersymbollayer.sip b/python/core/symbology/qgsmarkersymbollayer.sip index 9581ebc02b4..72d014a026d 100644 --- a/python/core/symbology/qgsmarkersymbollayer.sip +++ b/python/core/symbology/qgsmarkersymbollayer.sip @@ -522,23 +522,64 @@ Constructs SVG marker symbol layer with picture from given absolute path to a SV QString path() const; %Docstring + Returns the marker SVG path. +.. seealso:: setPath() :rtype: str %End + void setPath( const QString &path ); +%Docstring + Set the marker SVG path. + \param path SVG path +.. seealso:: path() +%End double defaultAspectRatio() const; %Docstring + Returns the default marker aspect ratio between width and height, 0 if not yet calculated. +.. seealso:: updateDefaultAspectRatio() :rtype: float %End + double updateDefaultAspectRatio(); %Docstring + Calculates the default marker aspect ratio between width and height. + :return: the default aspect ratio value +.. seealso:: defaultAspectRatio() :rtype: float %End + + bool preservedAspectRatio() const; +%Docstring + Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0. +.. seealso:: setPreservedAspectRatio() + :rtype: bool +%End + + bool setPreservedAspectRatio( bool par ); +%Docstring + Set preserved the marker aspect ratio between width and height. + \param par Preserved Aspect Ratio + :return: the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0 +.. seealso:: preservedAspectRatio() + :rtype: bool +%End + double fixedAspectRatio() const; %Docstring + Returns the marker aspect ratio between width and height to be used in rendering, + if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering +.. seealso:: setFixedAspectRatio() QgsSvgCache :rtype: float %End - void setFixedAspectRatio( double far ); + + void setFixedAspectRatio( double ratio ); +%Docstring + Set the marker aspect ratio between width and height to be used in rendering, + if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering + \param ratio Fixed Aspect Ratio +.. seealso:: fixedAspectRatio() QgsSvgCache +%End virtual QColor fillColor() const; virtual void setFillColor( const QColor &color ); diff --git a/python/core/symbology/qgssvgcache.sip b/python/core/symbology/qgssvgcache.sip index 5eb98b51958..f4b50c396df 100644 --- a/python/core/symbology/qgssvgcache.sip +++ b/python/core/symbology/qgssvgcache.sip @@ -109,6 +109,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. \param strokeWidth width of stroke \param widthScaleFactor width scale factor \param fitsInCache + \param fixedAspectRatio fixed aspect ratio (optional) :rtype: QImage %End @@ -123,6 +124,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. \param strokeWidth width of stroke \param widthScaleFactor width scale factor \param forceVectorOutput + \param fixedAspectRatio fixed aspect ratio (optional) :rtype: QPicture %End @@ -136,6 +138,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. \param stroke color of stroke \param strokeWidth width of stroke \param widthScaleFactor width scale factor + \param fixedAspectRatio fixed aspect ratio (optional) :return: viewbox size set in SVG file .. versionadded:: 2.14 :rtype: QSizeF @@ -209,6 +212,7 @@ Emit a signal to be caught by qgisapp and display a msg on status bar \param stroke color of stroke \param strokeWidth width of stroke \param widthScaleFactor width scale factor + \param fixedAspectRatio fixed aspect ratio (optional) :rtype: QgsSvgCacheEntry %End diff --git a/python/gui/symbology/qgssymbollayerwidget.sip b/python/gui/symbology/qgssymbollayerwidget.sip index 160a12105fb..ab0c8058809 100644 --- a/python/gui/symbology/qgssymbollayerwidget.sip +++ b/python/gui/symbology/qgssymbollayerwidget.sip @@ -364,11 +364,6 @@ class QgsSvgMarkerSymbolLayerWidget : QgsSymbolLayerWidget public slots: void setName( const QModelIndex &idx ); void populateIcons( const QModelIndex &idx ); - void setWidth(); - void setHeight(); - void stateChangedAspectRatio(); - void setAngle(); - void setOffset(); void on_mFileToolButton_clicked(); void on_mFileLineEdit_textEdited( const QString &text ); void on_mFileLineEdit_editingFinished();