Skip to content

Commit 4cfb607

Browse files
committedApr 2, 2017
Sipify QgsConditionalStyle
1 parent d76bca0 commit 4cfb607

File tree

2 files changed

+202
-174
lines changed

2 files changed

+202
-174
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ core/qgsbrowsermodel.sip
1010
core/qgscolorramp.sip
1111
core/qgscolorscheme.sip
1212
core/qgscolorschemeregistry.sip
13-
core/qgsconditionalstyle.sip
1413
core/qgscontexthelp.sip
1514
core/qgscoordinatereferencesystem.sip
1615
core/qgscoordinatetransform.sip

‎python/core/qgsconditionalstyle.sip

Lines changed: 202 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -1,216 +1,245 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsconditionalstyle.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
112
typedef QList<QgsConditionalStyle> QgsConditionalStyles;
213

314

4-
/**
5-
* @brief The QgsConditionalLayerStyles class holds conditional style information
6-
* for a layer. This includes field styles and full row styles.
7-
*/
815
class QgsConditionalLayerStyles
916
{
17+
%Docstring
18+
The QgsConditionalLayerStyles class holds conditional style information
19+
for a layer. This includes field styles and full row styles.
20+
%End
21+
1022
%TypeHeaderCode
11-
#include <qgsconditionalstyle.h>
23+
#include "qgsconditionalstyle.h"
1224
%End
1325
public:
1426
QgsConditionalLayerStyles();
1527

1628
QList<QgsConditionalStyle> rowStyles();
1729

18-
/**
19-
* @brief Set the conditional styles that apply to full rows of data in the attribute table.
20-
* Each row will check be checked against each rule.
21-
* @param styles The styles to assign to all the rows
22-
* @note added in QGIS 2.12
23-
*/
24-
void setRowStyles( const QList<QgsConditionalStyle>& styles );
25-
26-
/**
27-
* @brief Set the conditional styles for the field UI properties.
28-
* @param fieldName name of field
29-
* @param styles
30-
*/
31-
void setFieldStyles( const QString& fieldName, const QList<QgsConditionalStyle>& styles );
32-
33-
/**
34-
* @brief Returns the conditional styles set for the field UI properties
35-
* @return A list of conditional styles that have been set.
36-
*/
37-
QList<QgsConditionalStyle> fieldStyles( const QString& fieldName );
38-
39-
/** Reads field ui properties specific state from Dom node.
40-
*/
41-
bool readXml( const QDomNode& node );
42-
43-
/** Write field ui properties specific state from Dom node.
44-
*/
45-
bool writeXml( QDomNode & node, QDomDocument & doc ) const;
30+
void setRowStyles( const QList<QgsConditionalStyle> &styles );
31+
%Docstring
32+
Set the conditional styles that apply to full rows of data in the attribute table.
33+
Each row will check be checked against each rule.
34+
@param styles The styles to assign to all the rows
35+
.. versionadded:: 2.12
36+
%End
37+
38+
void setFieldStyles( const QString &fieldName, const QList<QgsConditionalStyle> &styles );
39+
%Docstring
40+
Set the conditional styles for the field UI properties.
41+
@param fieldName name of field
42+
@param styles
43+
%End
44+
45+
QList<QgsConditionalStyle> fieldStyles( const QString &fieldName );
46+
%Docstring
47+
Returns the conditional styles set for the field UI properties
48+
@return A list of conditional styles that have been set.
49+
%End
50+
51+
bool readXml( const QDomNode &node );
52+
%Docstring
53+
Reads field ui properties specific state from Dom node.
54+
%End
55+
56+
bool writeXml( QDomNode &node, QDomDocument &doc ) const;
57+
%Docstring
58+
Write field ui properties specific state from Dom node.
59+
%End
60+
4661
};
4762

48-
/** \class QgsConditionalStyle
49-
* \ingroup core
50-
* Conditional styling for a rule.
51-
*/
5263
class QgsConditionalStyle
5364
{
65+
%Docstring
66+
Conditional styling for a rule.
67+
%End
68+
5469
%TypeHeaderCode
55-
#include <qgsconditionalstyle.h>
70+
#include "qgsconditionalstyle.h"
5671
%End
5772
public:
5873
QgsConditionalStyle();
59-
QgsConditionalStyle( const QgsConditionalStyle& other );
60-
QgsConditionalStyle( const QString& rule );
61-
~QgsConditionalStyle();
62-
63-
/**
64-
* @brief Check if the rule matches using the given value and feature
65-
* @param value The current value being checked. The "value" variable from the context is replaced with this value.
66-
* @param context Expression context for evaluating rule expression
67-
* @return True of the rule matches against the given feature
68-
*/
69-
bool matches( const QVariant& value, QgsExpressionContext& context ) const;
70-
71-
/**
72-
* @brief Render a preview icon of the rule.
73-
* @return QPixmap preview of the style
74-
*/
74+
QgsConditionalStyle( const QgsConditionalStyle &other );
75+
QgsConditionalStyle( const QString &rule );
76+
77+
// QgsConditionalStyle &operator=( const QgsConditionalStyle &other );
78+
79+
bool matches( const QVariant &value, QgsExpressionContext &context ) const;
80+
%Docstring
81+
Check if the rule matches using the given value and feature
82+
@param value The current value being checked. The "value" variable from the context is replaced with this value.
83+
@param context Expression context for evaluating rule expression
84+
@return True of the rule matches against the given feature
85+
%End
86+
7587
QPixmap renderPreview() const;
88+
%Docstring
89+
Render a preview icon of the rule.
90+
@return QPixmap preview of the style
91+
%End
92+
93+
void setName( const QString &value );
94+
%Docstring
95+
Set the name of the style. Names are optional but handy for display
96+
@param value The name given to the style
97+
%End
98+
99+
void setRule( const QString &value );
100+
%Docstring
101+
Set the rule for the style. Rules should be of QgsExpression syntax.
102+
Special value of \@value is replaced at run time with the check value
103+
@param value The QgsExpression style rule to use for this style
104+
%End
105+
106+
void setBackgroundColor( const QColor &value );
107+
%Docstring
108+
Set the background color for the style
109+
@param value QColor for background color
110+
%End
111+
112+
void setTextColor( const QColor &value );
113+
%Docstring
114+
Set the text color for the style
115+
@param value QColor for text color
116+
%End
117+
118+
void setFont( const QFont &value );
119+
%Docstring
120+
Set the font for the the style
121+
@param value QFont to be used for text
122+
%End
123+
124+
void setSymbol( QgsSymbol *value );
125+
%Docstring
126+
Set the icon for the style. Icons are generated from symbols
127+
@param value QgsSymbol to be used when generating the icon
128+
%End
76129

77-
/**
78-
* @brief Set the name of the style. Names are optional but handy for display
79-
* @param value The name given to the style
80-
*/
81-
void setName( const QString& value );
82-
83-
/**
84-
* @brief Set the rule for the style. Rules should be of QgsExpression syntax.
85-
* Special value of \@value is replaced at run time with the check value
86-
* @param value The QgsExpression style rule to use for this style
87-
*/
88-
void setRule( const QString& value );
89-
90-
/**
91-
* @brief Set the background color for the style
92-
* @param value QColor for background color
93-
*/
94-
void setBackgroundColor( const QColor& value );
95-
96-
/**
97-
* @brief Set the text color for the style
98-
* @param value QColor for text color
99-
*/
100-
void setTextColor( const QColor& value );
101-
102-
/**
103-
* @brief Set the font for the the style
104-
* @param value QFont to be used for text
105-
*/
106-
void setFont( const QFont& value );
107-
108-
/**
109-
* @brief Set the icon for the style. Icons are generated from symbols
110-
* @param value QgsSymbol to be used when generating the icon
111-
*/
112-
void setSymbol( QgsSymbol* value );
113-
114-
/**
115-
* @brief The name of the style.
116-
* @return The name of the style. Names are optional so might be empty.
117-
*/
118130
QString displayText() const;
131+
%Docstring
132+
The name of the style.
133+
@return The name of the style. Names are optional so might be empty.
134+
%End
119135

120-
/**
121-
* @brief The name of the style.
122-
* @return The name of the style. Names are optional so might be empty.
123-
*/
124136
QString name() const;
137+
%Docstring
138+
The name of the style.
139+
@return The name of the style. Names are optional so might be empty.
140+
%End
125141

126-
/**
127-
* @brief The icon set for style generated from the set symbol
128-
* @return A QPixmap that was set for the icon using the symbol
129-
*/
130142
QPixmap icon() const;
143+
%Docstring
144+
The icon set for style generated from the set symbol
145+
@return A QPixmap that was set for the icon using the symbol
146+
%End
131147

132-
/**
133-
* @brief The symbol used to generate the icon for the style
134-
* @return The QgsSymbol used for the icon
135-
*/
136-
QgsSymbol* symbol() const;
148+
QgsSymbol *symbol() const;
149+
%Docstring
150+
The symbol used to generate the icon for the style
151+
@return The QgsSymbol used for the icon
152+
%End
137153

138-
/**
139-
* @brief The text color set for style
140-
* @return QColor for text color
141-
*/
142154
QColor textColor() const;
155+
%Docstring
156+
The text color set for style
157+
@return QColor for text color
158+
%End
143159

144-
/**
145-
* @brief Check if the text color is valid for render.
146-
* Valid colors are non invalid QColors and a color with a > 0 alpha
147-
* @return True of the color set for text is valid.
148-
*/
149160
bool validTextColor() const;
161+
%Docstring
162+
Check if the text color is valid for render.
163+
Valid colors are non invalid QColors and a color with a > 0 alpha
164+
@return True of the color set for text is valid.
165+
%End
150166

151-
/**
152-
* @brief The background color for style
153-
* @return QColor for background color
154-
*/
155167
QColor backgroundColor() const;
168+
%Docstring
169+
The background color for style
170+
@return QColor for background color
171+
%End
156172

157-
/**
158-
* @brief Check if the background color is valid for render.
159-
* Valid colors are non invalid QColors and a color with a > 0 alpha
160-
* @return True of the color set for background is valid.
161-
*/
162173
bool validBackgroundColor() const;
163-
/**
164-
* @brief The font for the style
165-
* @return QFont for the style
166-
*/
174+
%Docstring
175+
Check if the background color is valid for render.
176+
Valid colors are non invalid QColors and a color with a > 0 alpha
177+
@return True of the color set for background is valid.
178+
%End
179+
167180
QFont font() const;
181+
%Docstring
182+
The font for the style
183+
@return QFont for the style
184+
%End
168185

169-
/**
170-
* @brief The condition rule set for the style. Rule may contain variable \@value
171-
* to represent the current value
172-
* @return QString of the current set rule
173-
*/
174186
QString rule() const;
187+
%Docstring
188+
The condition rule set for the style. Rule may contain variable \@value
189+
to represent the current value
190+
@return QString of the current set rule
191+
%End
175192

176-
/**
177-
* @brief isValid Check if this rule is valid. A valid rule has one or more properties
178-
* set.
179-
* @return True if the rule is valid.
180-
*/
181193
bool isValid() const;
194+
%Docstring
195+
isValid Check if this rule is valid. A valid rule has one or more properties
196+
set.
197+
@return True if the rule is valid.
198+
%End
199+
200+
static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
201+
%Docstring
202+
Find and return the matching styles for the value and feature.
203+
If no match is found a invalid QgsConditionalStyle is return.
204+
205+
@return A condtional style that matches the value and feature.
206+
Check with QgsConditionalStyle::isValid()
207+
%End
208+
209+
static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
210+
%Docstring
211+
Find and return the matching style for the value and feature.
212+
If no match is found a invalid QgsConditionalStyle is return.
213+
214+
@return A condtional style that matches the value and feature.
215+
Check with QgsConditionalStyle::isValid()
216+
%End
217+
218+
static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle> &styles );
219+
%Docstring
220+
Compress a list of styles into a single style. This can be used to stack the elements of the
221+
styles. The font of the last style is used in the output.
222+
@param styles The list of styles to compress down
223+
@return A single style generated from joining each style property.
224+
%End
225+
226+
bool readXml( const QDomNode &node );
227+
%Docstring
228+
Reads vector conditional style specific state from layer Dom node.
229+
%End
230+
231+
bool writeXml( QDomNode &node, QDomDocument &doc ) const;
232+
%Docstring
233+
Write vector conditional style specific state from layer Dom node.
234+
%End
235+
182236

183-
/**
184-
* @brief Find and return the matching styles for the value and feature.
185-
* If no match is found a invalid QgsConditionalStyle is return.
186-
*
187-
* @return A condtional style that matches the value and feature.
188-
* Check with QgsConditionalStyle::isValid()
189-
*/
190-
static QList<QgsConditionalStyle> matchingConditionalStyles( const QList<QgsConditionalStyle>& styles, const QVariant& value, QgsExpressionContext& context );
191-
192-
/**
193-
* @brief Find and return the matching style for the value and feature.
194-
* If no match is found a invalid QgsConditionalStyle is return.
195-
*
196-
* @return A condtional style that matches the value and feature.
197-
* Check with QgsConditionalStyle::isValid()
198-
*/
199-
static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle>& styles, const QVariant& value, QgsExpressionContext& context );
200-
201-
/**
202-
* @brief Compress a list of styles into a single style. This can be used to stack the elements of the
203-
* styles. The font of the last style is used in the output.
204-
* @param styles The list of styles to compress down
205-
* @return A single style generated from joining each style property.
206-
*/
207-
static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle>& styles );
208-
209-
/** Reads vector conditional style specific state from layer Dom node.
210-
*/
211-
bool readXml( const QDomNode& node );
212-
213-
/** Write vector conditional style specific state from layer Dom node.
214-
*/
215-
bool writeXml( QDomNode & node, QDomDocument & doc ) const;
216237
};
238+
239+
/************************************************************************
240+
* This file has been generated automatically from *
241+
* *
242+
* src/core/qgsconditionalstyle.h *
243+
* *
244+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
245+
************************************************************************/

0 commit comments

Comments
 (0)
Please sign in to comment.