Sipify QgsConditionalStyle

This commit is contained in:
Matthias Kuhn 2017-04-02 11:29:03 +02:00
parent d76bca0ade
commit 4cfb60796e
2 changed files with 186 additions and 158 deletions

View File

@ -10,7 +10,6 @@ core/qgsbrowsermodel.sip
core/qgscolorramp.sip core/qgscolorramp.sip
core/qgscolorscheme.sip core/qgscolorscheme.sip
core/qgscolorschemeregistry.sip core/qgscolorschemeregistry.sip
core/qgsconditionalstyle.sip
core/qgscontexthelp.sip core/qgscontexthelp.sip
core/qgscoordinatereferencesystem.sip core/qgscoordinatereferencesystem.sip
core/qgscoordinatetransform.sip core/qgscoordinatetransform.sip

View File

@ -1,216 +1,245 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsconditionalstyle.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
typedef QList<QgsConditionalStyle> QgsConditionalStyles; typedef QList<QgsConditionalStyle> QgsConditionalStyles;
/**
* @brief The QgsConditionalLayerStyles class holds conditional style information
* for a layer. This includes field styles and full row styles.
*/
class QgsConditionalLayerStyles class QgsConditionalLayerStyles
{ {
%Docstring
The QgsConditionalLayerStyles class holds conditional style information
for a layer. This includes field styles and full row styles.
%End
%TypeHeaderCode %TypeHeaderCode
#include <qgsconditionalstyle.h> #include "qgsconditionalstyle.h"
%End %End
public: public:
QgsConditionalLayerStyles(); QgsConditionalLayerStyles();
QList<QgsConditionalStyle> rowStyles(); QList<QgsConditionalStyle> rowStyles();
/** void setRowStyles( const QList<QgsConditionalStyle> &styles );
* @brief Set the conditional styles that apply to full rows of data in the attribute table. %Docstring
* Each row will check be checked against each rule. Set the conditional styles that apply to full rows of data in the attribute table.
* @param styles The styles to assign to all the rows Each row will check be checked against each rule.
* @note added in QGIS 2.12 @param styles The styles to assign to all the rows
*/ .. versionadded:: 2.12
void setRowStyles( const QList<QgsConditionalStyle>& styles ); %End
/** void setFieldStyles( const QString &fieldName, const QList<QgsConditionalStyle> &styles );
* @brief Set the conditional styles for the field UI properties. %Docstring
* @param fieldName name of field Set the conditional styles for the field UI properties.
* @param styles @param fieldName name of field
*/ @param styles
void setFieldStyles( const QString& fieldName, const QList<QgsConditionalStyle>& styles ); %End
/** QList<QgsConditionalStyle> fieldStyles( const QString &fieldName );
* @brief Returns the conditional styles set for the field UI properties %Docstring
* @return A list of conditional styles that have been set. Returns the conditional styles set for the field UI properties
*/ @return A list of conditional styles that have been set.
QList<QgsConditionalStyle> fieldStyles( const QString& fieldName ); %End
/** Reads field ui properties specific state from Dom node. bool readXml( const QDomNode &node );
*/ %Docstring
bool readXml( const QDomNode& node ); Reads field ui properties specific state from Dom node.
%End
bool writeXml( QDomNode &node, QDomDocument &doc ) const;
%Docstring
Write field ui properties specific state from Dom node.
%End
/** Write field ui properties specific state from Dom node.
*/
bool writeXml( QDomNode & node, QDomDocument & doc ) const;
}; };
/** \class QgsConditionalStyle
* \ingroup core
* Conditional styling for a rule.
*/
class QgsConditionalStyle class QgsConditionalStyle
{ {
%Docstring
Conditional styling for a rule.
%End
%TypeHeaderCode %TypeHeaderCode
#include <qgsconditionalstyle.h> #include "qgsconditionalstyle.h"
%End %End
public: public:
QgsConditionalStyle(); QgsConditionalStyle();
QgsConditionalStyle( const QgsConditionalStyle& other ); QgsConditionalStyle( const QgsConditionalStyle &other );
QgsConditionalStyle( const QString& rule ); QgsConditionalStyle( const QString &rule );
~QgsConditionalStyle();
/** // QgsConditionalStyle &operator=( const QgsConditionalStyle &other );
* @brief Check if the rule matches using the given value and feature
* @param value The current value being checked. The "value" variable from the context is replaced with this value. bool matches( const QVariant &value, QgsExpressionContext &context ) const;
* @param context Expression context for evaluating rule expression %Docstring
* @return True of the rule matches against the given feature Check if the rule matches using the given value and feature
*/ @param value The current value being checked. The "value" variable from the context is replaced with this value.
bool matches( const QVariant& value, QgsExpressionContext& context ) const; @param context Expression context for evaluating rule expression
@return True of the rule matches against the given feature
%End
/**
* @brief Render a preview icon of the rule.
* @return QPixmap preview of the style
*/
QPixmap renderPreview() const; QPixmap renderPreview() const;
%Docstring
Render a preview icon of the rule.
@return QPixmap preview of the style
%End
/** void setName( const QString &value );
* @brief Set the name of the style. Names are optional but handy for display %Docstring
* @param value The name given to the style Set the name of the style. Names are optional but handy for display
*/ @param value The name given to the style
void setName( const QString& value ); %End
/** void setRule( const QString &value );
* @brief Set the rule for the style. Rules should be of QgsExpression syntax. %Docstring
* Special value of \@value is replaced at run time with the check value Set the rule for the style. Rules should be of QgsExpression syntax.
* @param value The QgsExpression style rule to use for this style Special value of \@value is replaced at run time with the check value
*/ @param value The QgsExpression style rule to use for this style
void setRule( const QString& value ); %End
/** void setBackgroundColor( const QColor &value );
* @brief Set the background color for the style %Docstring
* @param value QColor for background color Set the background color for the style
*/ @param value QColor for background color
void setBackgroundColor( const QColor& value ); %End
/** void setTextColor( const QColor &value );
* @brief Set the text color for the style %Docstring
* @param value QColor for text color Set the text color for the style
*/ @param value QColor for text color
void setTextColor( const QColor& value ); %End
/** void setFont( const QFont &value );
* @brief Set the font for the the style %Docstring
* @param value QFont to be used for text Set the font for the the style
*/ @param value QFont to be used for text
void setFont( const QFont& value ); %End
/** void setSymbol( QgsSymbol *value );
* @brief Set the icon for the style. Icons are generated from symbols %Docstring
* @param value QgsSymbol to be used when generating the icon Set the icon for the style. Icons are generated from symbols
*/ @param value QgsSymbol to be used when generating the icon
void setSymbol( QgsSymbol* value ); %End
/**
* @brief The name of the style.
* @return The name of the style. Names are optional so might be empty.
*/
QString displayText() const; QString displayText() const;
%Docstring
The name of the style.
@return The name of the style. Names are optional so might be empty.
%End
/**
* @brief The name of the style.
* @return The name of the style. Names are optional so might be empty.
*/
QString name() const; QString name() const;
%Docstring
The name of the style.
@return The name of the style. Names are optional so might be empty.
%End
/**
* @brief The icon set for style generated from the set symbol
* @return A QPixmap that was set for the icon using the symbol
*/
QPixmap icon() const; QPixmap icon() const;
%Docstring
The icon set for style generated from the set symbol
@return A QPixmap that was set for the icon using the symbol
%End
/** QgsSymbol *symbol() const;
* @brief The symbol used to generate the icon for the style %Docstring
* @return The QgsSymbol used for the icon The symbol used to generate the icon for the style
*/ @return The QgsSymbol used for the icon
QgsSymbol* symbol() const; %End
/**
* @brief The text color set for style
* @return QColor for text color
*/
QColor textColor() const; QColor textColor() const;
%Docstring
The text color set for style
@return QColor for text color
%End
/**
* @brief Check if the text color is valid for render.
* Valid colors are non invalid QColors and a color with a > 0 alpha
* @return True of the color set for text is valid.
*/
bool validTextColor() const; bool validTextColor() const;
%Docstring
Check if the text color is valid for render.
Valid colors are non invalid QColors and a color with a > 0 alpha
@return True of the color set for text is valid.
%End
/**
* @brief The background color for style
* @return QColor for background color
*/
QColor backgroundColor() const; QColor backgroundColor() const;
%Docstring
The background color for style
@return QColor for background color
%End
/**
* @brief Check if the background color is valid for render.
* Valid colors are non invalid QColors and a color with a > 0 alpha
* @return True of the color set for background is valid.
*/
bool validBackgroundColor() const; bool validBackgroundColor() const;
/** %Docstring
* @brief The font for the style Check if the background color is valid for render.
* @return QFont for the style Valid colors are non invalid QColors and a color with a > 0 alpha
*/ @return True of the color set for background is valid.
%End
QFont font() const; QFont font() const;
%Docstring
The font for the style
@return QFont for the style
%End
/**
* @brief The condition rule set for the style. Rule may contain variable \@value
* to represent the current value
* @return QString of the current set rule
*/
QString rule() const; QString rule() const;
%Docstring
The condition rule set for the style. Rule may contain variable \@value
to represent the current value
@return QString of the current set rule
%End
/**
* @brief isValid Check if this rule is valid. A valid rule has one or more properties
* set.
* @return True if the rule is valid.
*/
bool isValid() const; bool isValid() const;
%Docstring
isValid Check if this rule is valid. A valid rule has one or more properties
set.
@return True if the rule is valid.
%End
/** static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
* @brief Find and return the matching styles for the value and feature. %Docstring
* If no match is found a invalid QgsConditionalStyle is return. Find and return the matching styles for the value and feature.
* If no match is found a invalid QgsConditionalStyle is return.
* @return A condtional style that matches the value and feature.
* Check with QgsConditionalStyle::isValid()
*/
static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle>& styles, const QVariant& value, QgsExpressionContext& context );
/** @return A condtional style that matches the value and feature.
* @brief Find and return the matching style for the value and feature. Check with QgsConditionalStyle::isValid()
* If no match is found a invalid QgsConditionalStyle is return. %End
*
* @return A condtional style that matches the value and feature.
* Check with QgsConditionalStyle::isValid()
*/
static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle>& styles, const QVariant& value, QgsExpressionContext& context );
/** static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
* @brief Compress a list of styles into a single style. This can be used to stack the elements of the %Docstring
* styles. The font of the last style is used in the output. Find and return the matching style for the value and feature.
* @param styles The list of styles to compress down If no match is found a invalid QgsConditionalStyle is return.
* @return A single style generated from joining each style property.
*/ @return A condtional style that matches the value and feature.
static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle>& styles ); Check with QgsConditionalStyle::isValid()
%End
static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle> &styles );
%Docstring
Compress a list of styles into a single style. This can be used to stack the elements of the
styles. The font of the last style is used in the output.
@param styles The list of styles to compress down
@return A single style generated from joining each style property.
%End
bool readXml( const QDomNode &node );
%Docstring
Reads vector conditional style specific state from layer Dom node.
%End
bool writeXml( QDomNode &node, QDomDocument &doc ) const;
%Docstring
Write vector conditional style specific state from layer Dom node.
%End
/** Reads vector conditional style specific state from layer Dom node.
*/
bool readXml( const QDomNode& node );
/** Write vector conditional style specific state from layer Dom node.
*/
bool writeXml( QDomNode & node, QDomDocument & doc ) const;
}; };
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsconditionalstyle.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/