Update SIP for fixedAspectRatio in SVG marker

This commit is contained in:
rldhont 2017-08-20 16:16:40 +02:00
parent 48514d2e84
commit 954d62f53a
3 changed files with 46 additions and 6 deletions

View File

@ -522,23 +522,64 @@ Constructs SVG marker symbol layer with picture from given absolute path to a SV
QString path() const; QString path() const;
%Docstring %Docstring
Returns the marker SVG path.
.. seealso:: setPath()
:rtype: str :rtype: str
%End %End
void setPath( const QString &path ); void setPath( const QString &path );
%Docstring
Set the marker SVG path.
\param path SVG path
.. seealso:: path()
%End
double defaultAspectRatio() const; double defaultAspectRatio() const;
%Docstring %Docstring
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
.. seealso:: updateDefaultAspectRatio()
:rtype: float :rtype: float
%End %End
double updateDefaultAspectRatio(); double updateDefaultAspectRatio();
%Docstring %Docstring
Calculates the default marker aspect ratio between width and height.
:return: the default aspect ratio value
.. seealso:: defaultAspectRatio()
:rtype: float :rtype: float
%End %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; double fixedAspectRatio() const;
%Docstring %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 :rtype: float
%End %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 QColor fillColor() const;
virtual void setFillColor( const QColor &color ); virtual void setFillColor( const QColor &color );

View File

@ -109,6 +109,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param fitsInCache \param fitsInCache
\param fixedAspectRatio fixed aspect ratio (optional)
:rtype: QImage :rtype: QImage
%End %End
@ -123,6 +124,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param forceVectorOutput \param forceVectorOutput
\param fixedAspectRatio fixed aspect ratio (optional)
:rtype: QPicture :rtype: QPicture
%End %End
@ -136,6 +138,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
\param stroke color of stroke \param stroke color of stroke
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param fixedAspectRatio fixed aspect ratio (optional)
:return: viewbox size set in SVG file :return: viewbox size set in SVG file
.. versionadded:: 2.14 .. versionadded:: 2.14
:rtype: QSizeF :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 stroke color of stroke
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param fixedAspectRatio fixed aspect ratio (optional)
:rtype: QgsSvgCacheEntry :rtype: QgsSvgCacheEntry
%End %End

View File

@ -364,11 +364,6 @@ class QgsSvgMarkerSymbolLayerWidget : QgsSymbolLayerWidget
public slots: public slots:
void setName( const QModelIndex &idx ); void setName( const QModelIndex &idx );
void populateIcons( const QModelIndex &idx ); void populateIcons( const QModelIndex &idx );
void setWidth();
void setHeight();
void stateChangedAspectRatio();
void setAngle();
void setOffset();
void on_mFileToolButton_clicked(); void on_mFileToolButton_clicked();
void on_mFileLineEdit_textEdited( const QString &text ); void on_mFileLineEdit_textEdited( const QString &text );
void on_mFileLineEdit_editingFinished(); void on_mFileLineEdit_editingFinished();