From d902575f58d1c683c1a5e6df0fcb539b029288b2 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 7 Apr 2017 08:50:57 +0200 Subject: [PATCH] Sipify --- python/auto_sip.blacklist | 5 - python/core/qgscolorramp.sip | 883 +++++++++++++++++++++-------- python/core/qgslegendstyle.sip | 74 ++- python/core/qgsmessagelog.sip | 68 ++- python/core/qgsofflineediting.sip | 105 ++-- python/gui/qgsmessagelogviewer.sip | 38 +- src/core/qgscolorramp.h | 48 +- src/core/qgslegendsettings.h | 8 +- src/core/qgslegendstyle.h | 17 +- src/core/qgsmessagelog.h | 2 +- src/core/qgsofflineediting.h | 21 +- src/gui/qgsmessagelogviewer.h | 3 +- tests/scripts/sipifyheader.h | 1 + 13 files changed, 913 insertions(+), 360 deletions(-) diff --git a/python/auto_sip.blacklist b/python/auto_sip.blacklist index d9eca60ad55..9d7619254e3 100644 --- a/python/auto_sip.blacklist +++ b/python/auto_sip.blacklist @@ -4,7 +4,6 @@ core/qgis.sip core/qgsapplication.sip core/qgsbearingutils.sip core/qgsbrowsermodel.sip -core/qgscolorramp.sip core/qgscolorscheme.sip core/qgscolorschemeregistry.sip core/qgscontexthelp.sip @@ -52,7 +51,6 @@ core/qgsfontutils.sip core/qgslabelsearchtree.sip core/qgslegendrenderer.sip core/qgslegendsettings.sip -core/qgslegendstyle.sip core/qgslogger.sip core/qgsmaphittest.sip core/qgsmaplayer.sip @@ -71,14 +69,12 @@ core/qgsmapsettings.sip core/qgsmaptopixel.sip core/qgsmapunitscale.sip core/qgsmargins.sip -core/qgsmessagelog.sip core/qgsmessageoutput.sip core/qgsmimedatautils.sip core/qgsmultirenderchecker.sip core/qgsnetworkaccessmanager.sip core/qgsnetworkcontentfetcher.sip core/qgsobjectcustomproperties.sip -core/qgsofflineediting.sip core/qgsogcutils.sip core/qgsoptionalexpression.sip core/qgsowsconnection.sip @@ -427,7 +423,6 @@ gui/qgsmaptoolzoom.sip gui/qgsmaplayerstylemanagerwidget.sip gui/qgsmessagebar.sip gui/qgsmessagebaritem.sip -gui/qgsmessagelogviewer.sip gui/qgsmessageviewer.sip gui/qgsnewhttpconnection.sip gui/qgsnewmemorylayerdialog.sip diff --git a/python/core/qgscolorramp.sip b/python/core/qgscolorramp.sip index b69acd30704..a038e9ce566 100644 --- a/python/core/qgscolorramp.sip +++ b/python/core/qgscolorramp.sip @@ -1,454 +1,841 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgscolorramp.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + -/** \ingroup core - * \class QgsColorRamp - * \brief Abstract base class for color ramps - */ class QgsColorRamp { +%Docstring + Abstract base class for color ramps +.. versionadded:: 3.0 +%End + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End - %ConvertToSubClassCode - if (sipCpp->type() == "gradient") - sipType = sipType_QgsGradientColorRamp; - else if (sipCpp->type() == "random") - sipType = sipType_QgsLimitedRandomColorRamp; - else if (sipCpp->type() == "randomcolors") - sipType = sipType_QgsRandomColorRamp; - else if (sipCpp->type() == "preset") - sipType = sipType_QgsPresetSchemeColorRamp; - else if (sipCpp->type() == "colorbrewer") - sipType = sipType_QgsColorBrewerColorRamp; - else if (sipCpp->type() == "cpt-city") - sipType = sipType_QgsCptCityColorRamp; - else - sipType = 0; + if ( sipCpp->type() == "gradient" ) + sipType = sipType_QgsGradientColorRamp; + else if ( sipCpp->type() == "random" ) + sipType = sipType_QgsLimitedRandomColorRamp; + else if ( sipCpp->type() == "randomcolors" ) + sipType = sipType_QgsRandomColorRamp; + else if ( sipCpp->type() == "preset" ) + sipType = sipType_QgsPresetSchemeColorRamp; + else if ( sipCpp->type() == "colorbrewer" ) + sipType = sipType_QgsColorBrewerColorRamp; + else if ( sipCpp->type() == "cpt-city" ) + sipType = sipType_QgsCptCityColorRamp; + else + sipType = 0; %End - public: virtual ~QgsColorRamp(); - /** Returns number of defined colors, or -1 if undefined - */ virtual int count() const = 0; +%Docstring + Returns number of defined colors, or -1 if undefined + :rtype: int +%End - /** Returns relative value between [0,1] of color at specified index - */ virtual double value( int index ) const = 0; +%Docstring + Returns relative value between [0,1] of color at specified index + :rtype: float +%End - /** Returns the color corresponding to a specified value. - * @param value value between [0, 1] inclusive - * @returns color for value - */ virtual QColor color( double value ) const = 0; +%Docstring + Returns the color corresponding to a specified value. + \param value value between [0, 1] inclusive + :return: color for value + :rtype: QColor +%End - /** Returns a string representing the color ramp type. - */ virtual QString type() const = 0; +%Docstring + Returns a string representing the color ramp type. + :rtype: str +%End + virtual void invert(); +%Docstring + Inverts the ordering of the color ramp. +%End - /** Creates a clone of the color ramp. - */ - virtual QgsColorRamp* clone() const = 0 /Factory/; + virtual QgsColorRamp *clone() const = 0 /Factory/; +%Docstring + Creates a clone of the color ramp. + :rtype: QgsColorRamp +%End - /** Returns a string map containing all the color ramp's properties. - */ virtual QgsStringMap properties() const = 0; - +%Docstring + Returns a string map containing all the color ramp's properties. + :rtype: QgsStringMap +%End }; -/** \ingroup core - * \class QgsGradientStop - * \brief Represents a color stop within a QgsGradientColorRamp color ramp. - */ class QgsGradientStop { +%Docstring + Represents a color stop within a QgsGradientColorRamp color ramp. +.. versionadded:: 3.0 +%End + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End public: - /** Constructor for QgsGradientStop - * @param offset positional offset for stop, between 0 and 1.0 - * @param color color for stop - */ - QgsGradientStop( double offset, const QColor& color ); + QgsGradientStop( double offset, const QColor &color ); +%Docstring + Constructor for QgsGradientStop + \param offset positional offset for stop, between 0 and 1.0 + \param color color for stop +%End - //! Relative positional offset, between 0 and 1 double offset; - - //! Gradient color at stop +%Docstring +Relative positional offset, between 0 and 1 +%End QColor color; +%Docstring +Gradient color at stop +%End - bool operator==( const QgsGradientStop& other ) const; + bool operator==( const QgsGradientStop &other ) const; +%Docstring + :rtype: bool +%End }; -//! List of gradient stops typedef QList QgsGradientStopsList; -/** \ingroup core - * \class QgsGradientColorRamp - * \brief Gradient color ramp, which smoothly interpolates between two colors and also - * supports optional extra color stops. - */ + class QgsGradientColorRamp : QgsColorRamp { +%Docstring + Gradient color ramp, which smoothly interpolates between two colors and also + supports optional extra color stops. +.. versionadded:: 3.0 +%End + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End public: - /** Constructor for QgsGradientColorRamp - * @param color1 start color, corresponding to a position of 0.0 - * @param color2 end color, corresponding to a position of 1.0 - * @param discrete set to true for discrete interpolation instead of smoothly - * interpolating between colors - * @param stops optional list of additional color stops - */ - QgsGradientColorRamp( const QColor& color1 = DEFAULT_GRADIENT_COLOR1, - const QColor& color2 = QColor(0,255,0), - bool discrete = false, - const QgsGradientStopsList& stops = QgsGradientStopsList() ); + QgsGradientColorRamp( const QColor &color1 = DEFAULT_GRADIENT_COLOR1, + const QColor &color2 = DEFAULT_GRADIENT_COLOR2, + bool discrete = false, + const QgsGradientStopsList &stops = QgsGradientStopsList() ); +%Docstring + Constructor for QgsGradientColorRamp + \param color1 start color, corresponding to a position of 0.0 + \param color2 end color, corresponding to a position of 1.0 + \param discrete set to true for discrete interpolation instead of smoothly + interpolating between colors + \param stops optional list of additional color stops +%End - //! Creates a new QgsVectorColorRamp from a map of properties - static QgsColorRamp* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/; + static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ); +%Docstring +Creates a new QgsColorRamp from a map of properties + :rtype: QgsColorRamp +%End virtual int count() const; +%Docstring + :rtype: int +%End virtual double value( int index ) const; +%Docstring + :rtype: float +%End virtual QColor color( double value ) const; +%Docstring + :rtype: QColor +%End virtual QString type() const; +%Docstring + :rtype: str +%End virtual void invert(); - virtual QgsGradientColorRamp* clone() const /Factory/; + virtual QgsGradientColorRamp *clone() const; +%Docstring + :rtype: QgsGradientColorRamp +%End virtual QgsStringMap properties() const; +%Docstring + :rtype: QgsStringMap +%End - /** Returns the gradient start color. - * @see setColor1() - * @see color2() - */ QColor color1() const; +%Docstring + Returns the gradient start color. + \see setColor1() + \see color2() + :rtype: QColor +%End - /** Returns the gradient end color. - * @see setColor2() - * @see color1() - */ QColor color2() const; +%Docstring + Returns the gradient end color. + \see setColor2() + \see color1() + :rtype: QColor +%End - /** Sets the gradient start color. - * @param color start color - * @see color1() - * @see setColor2() - */ - void setColor1( const QColor& color ); + void setColor1( const QColor &color ); +%Docstring + Sets the gradient start color. + \param color start color + \see color1() + \see setColor2() +%End - /** Sets the gradient end color. - * @param color end color - * @see color2() - * @see setColor1() - */ - void setColor2( const QColor& color ); + void setColor2( const QColor &color ); +%Docstring + Sets the gradient end color. + \param color end color + \see color2() + \see setColor1() +%End - /** Returns true if the gradient is using discrete interpolation, rather than - * smoothly interpolating between colors. - * @see setDiscrete() - */ bool isDiscrete() const; +%Docstring + Returns true if the gradient is using discrete interpolation, rather than + smoothly interpolating between colors. + \see setDiscrete() + :rtype: bool +%End - /** Sets whether the gradient should use discrete interpolation, rather than - * smoothly interpolating between colors. - * @param discrete set to true to use discrete interpolation - * @see convertToDiscrete() - * @see isDiscrete() - */ void setDiscrete( bool discrete ); +%Docstring + Sets whether the gradient should use discrete interpolation, rather than + smoothly interpolating between colors. + \param discrete set to true to use discrete interpolation + \see convertToDiscrete() + \see isDiscrete() +%End - /** Converts a gradient with existing color stops to or from discrete - * interpolation. - * @param discrete set to true to convert the gradient stops to discrete, - * or false to convert them to smooth interpolation - * @see isDiscrete() - */ void convertToDiscrete( bool discrete ); +%Docstring + Converts a gradient with existing color stops to or from discrete + interpolation. + \param discrete set to true to convert the gradient stops to discrete, + or false to convert them to smooth interpolation + \see isDiscrete() +%End - /** Sets the list of intermediate gradient stops for the ramp. - * @param stops list of stops. Any existing color stops will be replaced - * @see stops() - */ - void setStops( const QgsGradientStopsList& stops ); + void setStops( const QgsGradientStopsList &stops ); +%Docstring + Sets the list of intermediate gradient stops for the ramp. + \param stops list of stops. Any existing color stops will be replaced. The stop + list will be automatically reordered so that stops are listed in ascending offset + order. + \see stops() +%End - /** Returns the list of intermediate gradient stops for the ramp. - * @see setStops() - */ QgsGradientStopsList stops() const; +%Docstring + Returns the list of intermediate gradient stops for the ramp. + \see setStops() + :rtype: QgsGradientStopsList +%End - /** Returns any additional info attached to the gradient ramp (e.g., authorship notes) - * @see setInfo() - */ QgsStringMap info() const; +%Docstring + Returns any additional info attached to the gradient ramp (e.g., authorship notes) + \see setInfo() + :rtype: QgsStringMap +%End - /** Sets additional info to attach to the gradient ramp (e.g., authorship notes) - * @param info map of string info to attach - * @see info() - */ - void setInfo( const QgsStringMap& info ); + void setInfo( const QgsStringMap &info ); +%Docstring + Sets additional info to attach to the gradient ramp (e.g., authorship notes) + \param info map of string info to attach + \see info() +%End - /** Copy color ramp stops to a QGradient - * @param gradient gradient to copy stops into - * @param alpha alpha multiplier. Opacity of colors will be multiplied - * by this factor before adding to the gradient. - * @note added in 2.1 - */ - void addStopsToGradient( QGradient* gradient, double alpha = 1 ); + void addStopsToGradient( QGradient *gradient, double alpha = 1 ); +%Docstring + Copy color ramp stops to a QGradient + \param gradient gradient to copy stops into + \param alpha alpha multiplier. Opacity of colors will be multiplied + by this factor before adding to the gradient. +.. versionadded:: 2.1 +%End + + protected: }; -/** \ingroup core - * \class QgsLimitedRandomColorRamp - * \brief Constrained random color ramp, which returns random colors based on preset parameters. - */ + class QgsLimitedRandomColorRamp : QgsColorRamp { +%Docstring + Constrained random color ramp, which returns random colors based on preset parameters. +.. versionadded:: 3.0 +%End + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End public: - QgsLimitedRandomColorRamp( int count = DEFAULT_RANDOM_COUNT, - int hueMin = DEFAULT_RANDOM_HUE_MIN, int hueMax = DEFAULT_RANDOM_HUE_MAX, - int satMin = DEFAULT_RANDOM_SAT_MIN, int satMax = DEFAULT_RANDOM_SAT_MAX, - int valMin = DEFAULT_RANDOM_VAL_MIN, int valMax = DEFAULT_RANDOM_VAL_MAX ); - static QgsColorRamp* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/; + QgsLimitedRandomColorRamp( int count = DEFAULT_RANDOM_COUNT, + int hueMin = DEFAULT_RANDOM_HUE_MIN, int hueMax = DEFAULT_RANDOM_HUE_MAX, + int satMin = DEFAULT_RANDOM_SAT_MIN, int satMax = DEFAULT_RANDOM_SAT_MAX, + int valMin = DEFAULT_RANDOM_VAL_MIN, int valMax = DEFAULT_RANDOM_VAL_MAX ); +%Docstring + Constructor for QgsLimitedRandomColorRamp + \param count number of colors in ramp + \param hueMin minimum hue + \param hueMax maximum hue + \param satMin minimum saturation + \param satMax maximum saturation + \param valMin minimum color value + \param valMax maximum color value +%End + + static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/; +%Docstring + Returns a new QgsLimitedRandomColorRamp color ramp created using the properties encoded in a string + map. + \param properties color ramp properties + \see properties() + :rtype: QgsColorRamp +%End virtual double value( int index ) const; - +%Docstring + :rtype: float +%End virtual QColor color( double value ) const; - +%Docstring + :rtype: QColor +%End virtual QString type() const; - - virtual QgsLimitedRandomColorRamp* clone() const /Factory/; - +%Docstring + :rtype: str +%End + virtual QgsLimitedRandomColorRamp *clone() const /Factory/; +%Docstring + :rtype: QgsLimitedRandomColorRamp +%End virtual QgsStringMap properties() const; +%Docstring + :rtype: QgsStringMap +%End + int count() const; +%Docstring + :rtype: int +%End - /** Get a list of random colors - * @note added in 2.4 - */ static QList randomColors( int count, int hueMax = DEFAULT_RANDOM_HUE_MAX, int hueMin = DEFAULT_RANDOM_HUE_MIN, int satMax = DEFAULT_RANDOM_SAT_MAX, int satMin = DEFAULT_RANDOM_SAT_MIN, int valMax = DEFAULT_RANDOM_VAL_MAX, int valMin = DEFAULT_RANDOM_VAL_MIN ); +%Docstring + Get a list of random colors +.. versionadded:: 2.4 + :rtype: list of QColor +%End void updateColors(); +%Docstring + Must be called after changing the properties of the color ramp + to regenerate the list of random colors. +%End - int count() const; int hueMin() const; +%Docstring + Returns the minimum hue for generated colors + \see setHueMin() + :rtype: int +%End + int hueMax() const; +%Docstring + Returns the maximum hue for generated colors + \see setHueMax() + :rtype: int +%End + int satMin() const; +%Docstring + Returns the minimum saturation for generated colors + \see setSatMin() + :rtype: int +%End + int satMax() const; +%Docstring + Returns the maximum saturation for generated colors + \see setSatMax() + :rtype: int +%End + int valMin() const; +%Docstring + Returns the minimum value for generated colors + \see setValMin() + :rtype: int +%End + int valMax() const; +%Docstring + Returns the maximum value for generated colors + \see setValMax() + :rtype: int +%End void setCount( int val ); +%Docstring + Sets the number of colors contained in the ramp. +%End + void setHueMin( int val ); +%Docstring + Sets the minimum hue for generated colors + \see hueMin() +%End + void setHueMax( int val ); +%Docstring + Sets the maximum hue for generated colors + \see hueMax() +%End + void setSatMin( int val ); +%Docstring + Sets the minimum saturation for generated colors + \see satMin() +%End + void setSatMax( int val ); +%Docstring + Sets the maximum saturation for generated colors + \see satMax() +%End + void setValMin( int val ); +%Docstring + Sets the minimum value for generated colors + \see valMin() +%End + void setValMax( int val ); +%Docstring + Sets the maximum value for generated colors + \see valMax() +%End + + protected: + QList mColors; }; -/** \ingroup core - * \class QgsRandomColorRamp - */ -class QgsRandomColorRamp : QgsColorRamp +class QgsRandomColorRamp: QgsColorRamp { +%Docstring + Totally random color ramp. Returns colors generated at random, but constrained + to some hardcoded saturation and value ranges to prevent ugly color generation. +.. versionadded:: 3.0 +%End + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End public: QgsRandomColorRamp(); - ~QgsRandomColorRamp(); int count() const; +%Docstring + :rtype: int +%End double value( int index ) const; +%Docstring + :rtype: float +%End QColor color( double value ) const; +%Docstring + :rtype: QColor +%End - /** Sets the desired total number of unique colors for the resultant ramp. Calling - * this method pregenerates a set of visually distinct colors which are returned - * by subsequent calls to color(). - * @param colorCount number of unique colors - * @note added in QGIS 2.5 - */ virtual void setTotalColorCount( const int colorCount ); +%Docstring + Sets the desired total number of unique colors for the resultant ramp. Calling + this method pregenerates a set of visually distinct colors which are returned + by subsequent calls to color(). + \param colorCount number of unique colors +.. versionadded:: 2.5 +%End QString type() const; +%Docstring + :rtype: str +%End - virtual QgsRandomColorRamp* clone() const /Factory/; + virtual QgsRandomColorRamp *clone() const /Factory/; +%Docstring + :rtype: QgsRandomColorRamp +%End + + virtual QgsStringMap properties() const; +%Docstring + :rtype: QgsStringMap +%End + + protected: + + QList mPrecalculatedColors; - QgsStringMap properties() const; }; -/** \ingroup core - * \class QgsPresetSchemeColorRamp - * \brief A scheme based color ramp consisting of a list of predefined colors. - * \note added in QGIS 3.0 - */ + class QgsPresetSchemeColorRamp : QgsColorRamp, QgsColorScheme { -%TypeHeaderCode -#include +%Docstring + A scheme based color ramp consisting of a list of predefined colors. +.. versionadded:: 3.0 %End +%TypeHeaderCode +#include "qgscolorramp.h" +%End public: - /** Constructor for QgsPresetSchemeColorRamp. - * @param colors list of colors in ramp - */ - QgsPresetSchemeColorRamp( const QList< QColor >& colors = QList< QColor >() ); + QgsPresetSchemeColorRamp( const QList< QColor > &colors = QList< QColor >() ); +%Docstring + Constructor for QgsPresetSchemeColorRamp. + \param colors list of colors in ramp +%End - /** Constructor for QgsPresetColorRamp. - * @param colors list of named colors in ramp - * @note not available in Python bindings - use setColors instead - */ - //QgsPresetSchemeColorRamp( const QgsNamedColorList& colors ); + QgsPresetSchemeColorRamp( const QgsNamedColorList &colors ); +%Docstring + Constructor for QgsPresetColorRamp. + \param colors list of named colors in ramp +.. note:: - /** Returns a new QgsPresetSchemeColorRamp color ramp created using the properties encoded in a string - * map. - * @param properties color ramp properties - * @see properties() - */ - static QgsColorRamp* create( const QgsStringMap& properties = QgsStringMap() ); + not available in Python bindings - use setColors instead +%End - /** Sets the list of colors used by the ramp. - * @param colors list of colors - * @see colors() - */ - bool setColors( const QgsNamedColorList& colors, const QString& = QString(), const QColor& = QColor() ); + static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ); +%Docstring + Returns a new QgsPresetSchemeColorRamp color ramp created using the properties encoded in a string + map. + \param properties color ramp properties + \see properties() + :rtype: QgsColorRamp +%End + + bool setColors( const QgsNamedColorList &colors, const QString & = QString(), const QColor & = QColor() ); +%Docstring + Sets the list of colors used by the ramp. + \param colors list of colors + \see colors() + :rtype: bool +%End - /** Returns the list of colors used by the ramp. - * @see setColors() - */ QList< QColor > colors() const; +%Docstring + Returns the list of colors used by the ramp. + \see setColors() + :rtype: list of QColor +%End - // QgsColorRamp interface virtual double value( int index ) const; +%Docstring +QgsColorRamp interface + :rtype: float +%End virtual QColor color( double value ) const; +%Docstring + :rtype: QColor +%End virtual QString type() const; +%Docstring + :rtype: str +%End virtual void invert(); - virtual QgsPresetSchemeColorRamp* clone() const /Factory/; + virtual QgsPresetSchemeColorRamp *clone() const /Factory/; +%Docstring + :rtype: QgsPresetSchemeColorRamp +%End virtual QgsStringMap properties() const; +%Docstring + :rtype: QgsStringMap +%End int count() const; +%Docstring + :rtype: int +%End - // QgsColorScheme interface QString schemeName() const; +%Docstring +QgsColorScheme interface + :rtype: str +%End QgsNamedColorList fetchColors( const QString &context = QString(), const QColor &baseColor = QColor() ); +%Docstring + :rtype: QgsNamedColorList +%End bool isEditable() const; +%Docstring + :rtype: bool +%End }; -/** \ingroup core - * \class QgsColorBrewerColorRamp - */ + + class QgsColorBrewerColorRamp : QgsColorRamp { +%Docstring + Color ramp utilising "Color Brewer" preset color schemes. +.. versionadded:: 3.0 +%End + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End public: - QgsColorBrewerColorRamp( const QString& schemeName = DEFAULT_COLORBREWER_SCHEMENAME, - int colors = DEFAULT_COLORBREWER_COLORS, - bool inverted = false ); - static QgsColorRamp* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/; + QgsColorBrewerColorRamp( const QString &schemeName = DEFAULT_COLORBREWER_SCHEMENAME, + int colors = DEFAULT_COLORBREWER_COLORS, + bool inverted = false ); +%Docstring + Constructor for QgsColorBrewerColorRamp + \param schemeName color brewer scheme name + \param colors number of colors in ramp + \param inverted invert ramp ordering +%End + + static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ); +%Docstring + Returns a new QgsColorBrewerColorRamp color ramp created using the properties encoded in a string + map. + \param properties color ramp properties + \see properties() + :rtype: QgsColorRamp +%End virtual double value( int index ) const; - +%Docstring + :rtype: float +%End virtual QColor color( double value ) const; - +%Docstring + :rtype: QColor +%End virtual QString type() const; - +%Docstring + :rtype: str +%End virtual void invert(); - - virtual QgsColorBrewerColorRamp* clone() const /Factory/; - + virtual QgsColorBrewerColorRamp *clone() const /Factory/; +%Docstring + :rtype: QgsColorBrewerColorRamp +%End virtual QgsStringMap properties() const; +%Docstring + :rtype: QgsStringMap +%End + virtual int count() const; +%Docstring + :rtype: int +%End QString schemeName() const; - virtual int count() const; - int colors() const; +%Docstring + Returns the name of the color brewer color scheme. + \see setSchemeName() + :rtype: str +%End + + int colors() const; +%Docstring + Returns the number of colors in the ramp. + \see setColors() + :rtype: int +%End + + void setSchemeName( const QString &schemeName ); +%Docstring + Sets the name of the color brewer color scheme. + \param schemeName scheme name, must match a valid color brewer scheme name + \see schemeName() + \see listSchemeNames() +%End - void setSchemeName( const QString& schemeName ); void setColors( int colors ); +%Docstring + Sets the number of colors in the ramp. + \param colors number of colors. Must match a valid value for the scheme, + which can be retrieved using listSchemeVariants() + \see colors() +%End static QStringList listSchemeNames(); - static QList listSchemeVariants( const QString& schemeName ); +%Docstring + Returns a list of all valid color brewer scheme names. + \see listSchemeVariants() + :rtype: list of str +%End + + static QList listSchemeVariants( const QString &schemeName ); +%Docstring + Returns a list of the valid variants (numbers of colors) for a specified + color brewer scheme name + \param schemeName color brewer scheme name + \see listSchemeNames() + :rtype: list of int +%End protected: void loadPalette(); +%Docstring +Generates the scheme using the current name and number of colors +%End + + QList mPalette; }; -/** \ingroup core - * \class QgsCptCityColorRamp - */ + class QgsCptCityColorRamp : QgsGradientColorRamp { + %TypeHeaderCode -#include +#include "qgscolorramp.h" %End public: - /** Constructor for QgsCptCityColorRamp - * @param schemeName cpt-city scheme name - * @param variantName cpt-city variant name - * @param inverted invert ramp ordering - * @param doLoadFile load cpt-city ramp from file - */ - QgsCptCityColorRamp( const QString& schemeName = DEFAULT_CPTCITY_SCHEMENAME, - const QString& variantName = DEFAULT_CPTCITY_VARIANTNAME, - bool inverted = false, bool doLoadFile = true ); - /** Constructor for QgsCptCityColorRamp - * @param schemeName cpt-city scheme name - * @param variantList cpt-city variant list - * @param variantName cpt-city variant name - * @param inverted invert ramp ordering - * @param doLoadFile load cpt-city ramp from file - */ - QgsCptCityColorRamp( const QString& schemeName, const QStringList& variantList, - const QString& variantName = QString(), bool inverted = false, - bool doLoadFile = true ); - static QgsColorRamp* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/; + QgsCptCityColorRamp( const QString &schemeName = DEFAULT_CPTCITY_SCHEMENAME, + const QString &variantName = DEFAULT_CPTCITY_VARIANTNAME, + bool inverted = false, + bool doLoadFile = true ); +%Docstring + Constructor for QgsCptCityColorRamp + \param schemeName cpt-city scheme name + \param variantName cpt-city variant name + \param inverted invert ramp ordering + \param doLoadFile load cpt-city ramp from file +%End + + QgsCptCityColorRamp( const QString &schemeName, const QStringList &variantList, + const QString &variantName = QString(), bool inverted = false, + bool doLoadFile = true ); +%Docstring + Constructor for QgsCptCityColorRamp + \param schemeName cpt-city scheme name + \param variantList cpt-city variant list + \param variantName cpt-city variant name + \param inverted invert ramp ordering + \param doLoadFile load cpt-city ramp from file +%End + + static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ); +%Docstring + :rtype: QgsColorRamp +%End virtual QString type() const; +%Docstring + :rtype: str +%End + virtual void invert(); - virtual QgsCptCityColorRamp* clone() const /Factory/; - void copy( const QgsCptCityColorRamp* other ); - QgsGradientColorRamp* cloneGradientRamp() const /Factory/; + + virtual QgsCptCityColorRamp *clone() const /Factory/; +%Docstring + :rtype: QgsCptCityColorRamp +%End + void copy( const QgsCptCityColorRamp *other ); + QgsGradientColorRamp *cloneGradientRamp() const /Factory/; +%Docstring + :rtype: QgsGradientColorRamp +%End virtual QgsStringMap properties() const; +%Docstring + :rtype: QgsStringMap +%End QString schemeName() const; +%Docstring + :rtype: str +%End QString variantName() const; +%Docstring + :rtype: str +%End QStringList variantList() const; +%Docstring + :rtype: list of str +%End - /* lazy loading - have to call loadPalette() explicitly */ - void setSchemeName( const QString& schemeName ); - void setVariantName( const QString& variantName ); - void setVariantList( const QStringList& variantList ); - void setName( const QString& schemeName, const QString& variantName = "", const QStringList& variantList = QStringList() ); + void setSchemeName( const QString &schemeName ); +%Docstring +lazy loading - have to call loadPalette() explicitly +%End + void setVariantName( const QString &variantName ); + void setVariantList( const QStringList &variantList ); + void setName( const QString &schemeName, const QString &variantName = "", const QStringList &variantList = QStringList() ); void loadPalette(); bool hasMultiStops() const; +%Docstring + :rtype: bool +%End QString fileName() const; +%Docstring + :rtype: str +%End bool loadFile(); +%Docstring + :rtype: bool +%End bool fileLoaded() const; +%Docstring + :rtype: bool +%End QString copyingFileName() const; +%Docstring + :rtype: str +%End QString descFileName() const; - QMap< QString, QString > copyingInfo() const; +%Docstring + :rtype: str +%End + QgsStringMap copyingInfo() const; +%Docstring + :rtype: QgsStringMap +%End + + protected: + }; + + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgscolorramp.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/qgslegendstyle.sip b/python/core/qgslegendstyle.sip index 91cc6ceb0cb..f2375f63379 100644 --- a/python/core/qgslegendstyle.sip +++ b/python/core/qgslegendstyle.sip @@ -1,48 +1,88 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgslegendstyle.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + class QgsLegendStyle { +%Docstring + Composer legend components style +%End + %TypeHeaderCode -#include +#include "qgslegendstyle.h" %End public: enum Style { - Undefined, // should not happen, only if corrupted project file - Hidden, // special style, item is hidden includeing margins around + Undefined, + Hidden, Title, Group, - Subgroup, // layer - Symbol, // symbol without label + Subgroup, + Symbol, SymbolLabel }; - enum Side // margin side + enum Side //! margin side { Top, Bottom, Left, - Right, - }; + Right }; QgsLegendStyle(); QFont font() const; - QFont & rfont(); - void setFont( const QFont & font ); +%Docstring + :rtype: QFont +%End + void setFont( const QFont &font ); double margin( Side side ); +%Docstring + :rtype: float +%End void setMargin( Side side, double margin ); - // set all margins void setMargin( double margin ); +%Docstring +set all margins +%End - void writeXml( const QString& name, QDomElement& elem, QDomDocument & doc ) const; + void writeXml( const QString &name, QDomElement &elem, QDomDocument &doc ) const; - void readXml( const QDomElement& elem, const QDomDocument& doc ); + void readXml( const QDomElement &elem, const QDomDocument &doc ); - /** Get name for style, used in project file */ static QString styleName( Style s ); +%Docstring +Get name for style, used in project file + :rtype: str +%End - /** Get style from name, used in project file */ - static Style styleFromName( const QString& styleName ); + static Style styleFromName( const QString &styleName ); +%Docstring +Get style from name, used in project file + :rtype: Style +%End - /** Get style label, translated, used in UI */ static QString styleLabel( Style s ); +%Docstring +Get style label, translated, used in UI + :rtype: str +%End + }; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgslegendstyle.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/qgsmessagelog.sip b/python/core/qgsmessagelog.sip index 52ab8d42718..6426eaf9d10 100644 --- a/python/core/qgsmessagelog.sip +++ b/python/core/qgsmessagelog.sip @@ -1,43 +1,77 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgsmessagelog.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + class QgsMessageLog : QObject { -%TypeHeaderCode -#include +%Docstring + Interface for logging messages from QGIS in GUI independent way. + This class provides abstraction of a tabbed window for showing messages to the user. + By default QgsMessageLogOutput will be used if not overridden with another + message log creator function. + QGIS application uses QgsMessageLog class for logging messages in a dockable + window for the user. + + QgsMessageLog is not usually directly created, but rather accessed through + QgsApplication.messageLog(). %End +%TypeHeaderCode +#include "qgsmessagelog.h" +%End public: - QgsMessageLog(); enum MessageLevel { + ALL, INFO, WARNING, CRITICAL, - }; + NONE }; - //! add a message to the instance (and create it if necessary) - static void logMessage( const QString& message, const QString& tag = QString::null, MessageLevel level = WARNING ); + QgsMessageLog(); + + static void logMessage( const QString &message, const QString &tag = QString(), MessageLevel level = QgsMessageLog::WARNING ); +%Docstring +add a message to the instance (and create it if necessary) +%End signals: - void messageReceived( const QString& message, const QString& tag, MessageLevel level ); + void messageReceived( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level ); + + void messageReceived( bool received ); }; - -/** -\brief Default implementation of message logging interface - -This class outputs log messages to the standard output. Therefore it might -be the right choice for apps without GUI. -*/ class QgsMessageLogConsole : QObject { -%TypeHeaderCode -#include +%Docstring + Default implementation of message logging interface +This class outputs log messages to the standard output. Therefore it might +be the right choice for apps without GUI. %End +%TypeHeaderCode +#include "qgsmessagelog.h" +%End public: QgsMessageLogConsole(); public slots: - void logMessage( const QString& message, const QString& tag, QgsMessageLog::MessageLevel level ); + void logMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level ); }; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgsmessagelog.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/qgsofflineediting.sip b/python/core/qgsofflineediting.sip index 6170f656456..080756db895 100644 --- a/python/core/qgsofflineediting.sip +++ b/python/core/qgsofflineediting.sip @@ -1,13 +1,22 @@ -/** \class QgsOfflineEditing - * \brief Class for accessing functionality of Offline Editing Plugin. - * This class can be used to access offline editing functionality from plugins. - */ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgsofflineediting.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + +struct sqlite3; + class QgsOfflineEditing : QObject { -%TypeHeaderCode -#include -%End +%TypeHeaderCode +#include "qgsofflineediting.h" +%End public: enum ProgressMode { @@ -21,49 +30,75 @@ class QgsOfflineEditing : QObject }; QgsOfflineEditing(); - ~QgsOfflineEditing(); - /** Convert current project for offline editing - * @param offlineDataPath path to offline db file - * @param offlineDbFile offline db file name - * @param layerIds list of layer names to convert - */ - bool convertToOfflineProject( const QString& offlineDataPath, const QString& offlineDbFile, const QStringList& layerIds, bool onlySelected = false ); + bool convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected = false ); +%Docstring + Convert current project for offline editing + \param offlineDataPath Path to offline db file + \param offlineDbFile Offline db file name + \param layerIds List of layer names to convert + \param onlySelected Only copy selected features from layers where a selection is present + :rtype: bool +%End - /** Return true if current project is offline */ bool isOfflineProject() const; +%Docstring +Return true if current project is offline + :rtype: bool +%End - /** Synchronize to remote layers */ void synchronize(); +%Docstring +Synchronize to remote layers +%End signals: - /** Emit a signal that processing has started */ + void progressStarted(); +%Docstring + The signal is emitted when the process has started. +%End - /** Emit a signal that the next layer of numLayers has started processing - * @param layer current layer index - * @param numLayers total number of layers - */ void layerProgressUpdated( int layer, int numLayers ); +%Docstring + Is emitted whenever a new layer is being processed. + It is possible to estimate the progress of the complete operation by + comparing the index of the current layer to the total amount + numLayers. +%End - /** Emit a signal that sets the mode for the progress of the current operation - * @param mode progress mode - * @param maximum total number of entities to process in the current operation - */ void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum ); +%Docstring + Is emitted when the mode for the progress of the current operation is + set. + \param mode progress mode + \param maximum total number of entities to process in the current operation +%End - /** Emit a signal with the progress of the current mode - * @param progress current index of processed entities - */ void progressUpdated( int progress ); +%Docstring + Emitted with the progress of the current mode + \param progress current index of processed entities +%End - /** Emit a signal that processing of all layers has finished */ void progressStopped(); +%Docstring +Emitted when the processing of all layers has finished +%End + + void warning( const QString &title, const QString &message ); +%Docstring + Emitted when a warning needs to be displayed. + \param title title string for message + \param message A descriptive message for the warning +%End - /** - * Emitted when a warning needs to be displayed. - * @param title title string for message - * @param message A descriptive message for the warning - */ - void warning( const QString& title, const QString& message ); }; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgsofflineediting.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/gui/qgsmessagelogviewer.sip b/python/gui/qgsmessagelogviewer.sip index d30d471a1d0..62bc2973985 100644 --- a/python/gui/qgsmessagelogviewer.sip +++ b/python/gui/qgsmessagelogviewer.sip @@ -1,16 +1,40 @@ -/** \ingroup gui - * A generic dialog widget for displaying QGIS log messages. - */ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsmessagelogviewer.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + class QgsMessageLogViewer: QDialog { -%TypeHeaderCode -#include +%Docstring + A generic dialog widget for displaying QGIS log messages. %End +%TypeHeaderCode +#include "qgsmessagelogviewer.h" +%End public: - QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags ); - ~QgsMessageLogViewer(); + QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags ); public slots: void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level ); + + protected: + void closeEvent( QCloseEvent *e ); + void reject(); + }; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsmessagelogviewer.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/src/core/qgscolorramp.h b/src/core/qgscolorramp.h index c81e90069b2..55053876671 100644 --- a/src/core/qgscolorramp.h +++ b/src/core/qgscolorramp.h @@ -29,6 +29,25 @@ */ class CORE_EXPORT QgsColorRamp { + +#ifdef SIP_RUN + SIP_CONVERT_TO_SUBCLASS_CODE + if ( sipCpp->type() == "gradient" ) + sipType = sipType_QgsGradientColorRamp; + else if ( sipCpp->type() == "random" ) + sipType = sipType_QgsLimitedRandomColorRamp; + else if ( sipCpp->type() == "randomcolors" ) + sipType = sipType_QgsRandomColorRamp; + else if ( sipCpp->type() == "preset" ) + sipType = sipType_QgsPresetSchemeColorRamp; + else if ( sipCpp->type() == "colorbrewer" ) + sipType = sipType_QgsColorBrewerColorRamp; + else if ( sipCpp->type() == "cpt-city" ) + sipType = sipType_QgsCptCityColorRamp; + else + sipType = 0; + SIP_END +#endif public: virtual ~QgsColorRamp() = default; @@ -58,7 +77,7 @@ class CORE_EXPORT QgsColorRamp /** Creates a clone of the color ramp. */ - virtual QgsColorRamp *clone() const = 0; + virtual QgsColorRamp *clone() const = 0 SIP_FACTORY; /** Returns a string map containing all the color ramp's properties. */ @@ -257,12 +276,12 @@ class CORE_EXPORT QgsLimitedRandomColorRamp : public QgsColorRamp * \param properties color ramp properties * \see properties() */ - static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ); + static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY; virtual double value( int index ) const override; virtual QColor color( double value ) const override; virtual QString type() const override { return QStringLiteral( "random" ); } - virtual QgsLimitedRandomColorRamp *clone() const override; + virtual QgsLimitedRandomColorRamp *clone() const override SIP_FACTORY; virtual QgsStringMap properties() const override; int count() const override { return mCount; } @@ -345,7 +364,12 @@ class CORE_EXPORT QgsLimitedRandomColorRamp : public QgsColorRamp protected: int mCount; - int mHueMin, mHueMax, mSatMin, mSatMax, mValMin, mValMax; + int mHueMin; + int mHueMax; + int mSatMin; + int mSatMax; + int mValMin; + int mValMax; QList mColors; }; @@ -376,9 +400,9 @@ class CORE_EXPORT QgsRandomColorRamp: public QgsColorRamp QString type() const override; - QgsRandomColorRamp *clone() const override; + virtual QgsRandomColorRamp *clone() const override SIP_FACTORY; - QgsStringMap properties() const override; + virtual QgsStringMap properties() const override; protected: @@ -431,7 +455,7 @@ class CORE_EXPORT QgsPresetSchemeColorRamp : public QgsColorRamp, public QgsColo virtual QColor color( double value ) const override; virtual QString type() const override { return QStringLiteral( "preset" ); } virtual void invert() override; - virtual QgsPresetSchemeColorRamp *clone() const override; + virtual QgsPresetSchemeColorRamp *clone() const override SIP_FACTORY; virtual QgsStringMap properties() const override; int count() const override; @@ -479,7 +503,7 @@ class CORE_EXPORT QgsColorBrewerColorRamp : public QgsColorRamp virtual QColor color( double value ) const override; virtual QString type() const override { return QStringLiteral( "colorbrewer" ); } virtual void invert() override; - virtual QgsColorBrewerColorRamp *clone() const override; + virtual QgsColorBrewerColorRamp *clone() const override SIP_FACTORY; virtual QgsStringMap properties() const override; virtual int count() const override { return mColors; } @@ -569,9 +593,9 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp virtual void invert() override; - virtual QgsCptCityColorRamp *clone() const override; + virtual QgsCptCityColorRamp *clone() const override SIP_FACTORY; void copy( const QgsCptCityColorRamp *other ); - QgsGradientColorRamp *cloneGradientRamp() const; + QgsGradientColorRamp *cloneGradientRamp() const SIP_FACTORY; virtual QgsStringMap properties() const override; @@ -579,7 +603,7 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp QString variantName() const { return mVariantName; } QStringList variantList() const { return mVariantList; } - /* lazy loading - have to call loadPalette() explicitly */ + // lazy loading - have to call loadPalette() explicitly void setSchemeName( const QString &schemeName ) { mSchemeName = schemeName; mFileLoaded = false; } void setVariantName( const QString &variantName ) { mVariantName = variantName; mFileLoaded = false; } void setVariantList( const QStringList &variantList ) { mVariantList = variantList; } @@ -598,13 +622,13 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp QgsStringMap copyingInfo() const; protected: - QString mSchemeName; QString mVariantName; QStringList mVariantList; bool mFileLoaded; bool mMultiStops; bool mInverted; + }; diff --git a/src/core/qgslegendsettings.h b/src/core/qgslegendsettings.h index 9744eb71106..2175cdc21d2 100644 --- a/src/core/qgslegendsettings.h +++ b/src/core/qgslegendsettings.h @@ -52,8 +52,12 @@ class CORE_EXPORT QgsLegendSettings */ void setTitleAlignment( Qt::AlignmentFlag alignment ) { mTitleAlignment = alignment; } - //! Returns reference to modifiable style - QgsLegendStyle &rstyle( QgsLegendStyle::Style s ) { return mStyleMap[s]; } + /** + * Returns reference to modifiable style + * + * \note Not available in Python bindings. + */ + SIP_SKIP QgsLegendStyle &rstyle( QgsLegendStyle::Style s ) { return mStyleMap[s]; } //! Returns style QgsLegendStyle style( QgsLegendStyle::Style s ) const { return mStyleMap.value( s ); } void setStyle( QgsLegendStyle::Style s, const QgsLegendStyle &style ) { mStyleMap[s] = style; } diff --git a/src/core/qgslegendstyle.h b/src/core/qgslegendstyle.h index 4c9862f99a4..b109b77b1a9 100644 --- a/src/core/qgslegendstyle.h +++ b/src/core/qgslegendstyle.h @@ -25,6 +25,7 @@ #include #include "qgis_core.h" +#include "qgis.h" /** \ingroup core * Composer legend components style @@ -34,15 +35,15 @@ class CORE_EXPORT QgsLegendStyle public: enum Style { - Undefined, // should not happen, only if corrupted project file - Hidden, // special style, item is hidden includeing margins around + Undefined, //!< Should not happen, only if corrupted project file + Hidden, //!< Special style, item is hidden including margins around Title, Group, - Subgroup, // layer - Symbol, // symbol without label + Subgroup, //!< Layer + Symbol, //!< Symbol without label SymbolLabel }; - enum Side // margin side + enum Side //! margin side { Top = 0, Bottom = 1, @@ -52,13 +53,13 @@ class CORE_EXPORT QgsLegendStyle QgsLegendStyle(); QFont font() const { return mFont; } - QFont &rfont() { return mFont; } + SIP_SKIP QFont &rfont() { return mFont; } void setFont( const QFont &font ) { mFont = font; } double margin( Side side ) { return mMarginMap.value( side ); } void setMargin( Side side, double margin ) { mMarginMap[side] = margin; } - // set all margins + //! set all margins void setMargin( double margin ); void writeXml( const QString &name, QDomElement &elem, QDomDocument &doc ) const; @@ -76,7 +77,7 @@ class CORE_EXPORT QgsLegendStyle private: QFont mFont; - // Space around element + //! Space around element QMap mMarginMap; }; diff --git a/src/core/qgsmessagelog.h b/src/core/qgsmessagelog.h index 8d9c30aa9bc..1233dad7049 100644 --- a/src/core/qgsmessagelog.h +++ b/src/core/qgsmessagelog.h @@ -52,7 +52,7 @@ class CORE_EXPORT QgsMessageLog : public QObject QgsMessageLog(); //! add a message to the instance (and create it if necessary) - static void logMessage( const QString &message, const QString &tag = QString::null, MessageLevel level = WARNING ); + static void logMessage( const QString &message, const QString &tag = QString(), MessageLevel level = QgsMessageLog::WARNING ); signals: void messageReceived( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level ); diff --git a/src/core/qgsofflineediting.h b/src/core/qgsofflineediting.h index c7f57082469..2c57a6fe4c1 100644 --- a/src/core/qgsofflineediting.h +++ b/src/core/qgsofflineediting.h @@ -65,27 +65,34 @@ class CORE_EXPORT QgsOfflineEditing : public QObject void synchronize(); signals: - //! Emit a signal that processing has started + + /** + * The signal is emitted when the process has started. + */ void progressStarted(); - /** Emit a signal that the next layer of numLayers has started processing - * \param layer current layer index - * \param numLayers total number of layers + /** + * Is emitted whenever a new layer is being processed. + * It is possible to estimate the progress of the complete operation by + * comparing the index of the current \a layer to the total amount + * \a numLayers. */ void layerProgressUpdated( int layer, int numLayers ); - /** Emit a signal that sets the mode for the progress of the current operation + /** + * Is emitted when the mode for the progress of the current operation is + * set. * \param mode progress mode * \param maximum total number of entities to process in the current operation */ void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum ); - /** Emit a signal with the progress of the current mode + /** Emitted with the progress of the current mode * \param progress current index of processed entities */ void progressUpdated( int progress ); - //! Emit a signal that processing of all layers has finished + //! Emitted when the processing of all layers has finished void progressStopped(); /** diff --git a/src/gui/qgsmessagelogviewer.h b/src/gui/qgsmessagelogviewer.h index d3fb48dd883..51a51e39bfb 100644 --- a/src/gui/qgsmessagelogviewer.h +++ b/src/gui/qgsmessagelogviewer.h @@ -23,6 +23,7 @@ #include #include "qgis_gui.h" +#include "qgis.h" class QStatusBar; class QCloseEvent; @@ -34,7 +35,7 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV { Q_OBJECT public: - QgsMessageLogViewer( QStatusBar *statusBar = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags ); + QgsMessageLogViewer( QStatusBar *statusBar = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags ); public slots: void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level ); diff --git a/tests/scripts/sipifyheader.h b/tests/scripts/sipifyheader.h index 2e4f902816f..8c2fcdcd66f 100644 --- a/tests/scripts/sipifyheader.h +++ b/tests/scripts/sipifyheader.h @@ -237,6 +237,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass, private Ui::QgsBas private: void PrivateAgain(); + /* Single line block comments shouldn't break the parser */ struct ProcessFeatureWrapper {