Skip to content

Commit 275736d

Browse files
committed
removed V2 from QgsSymbolV2*
1 parent c16d139 commit 275736d

File tree

230 files changed

+2074
-2068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+2074
-2068
lines changed

doc/api_break.dox

+21-15
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ This page tries to maintain a list with incompatible changes that happened in pr
2222

2323
<table>
2424
<caption id="renamed_classes">Renamed classes</caption>
25-
<tr><th>API 2.x<th>API 3.X
26-
<tr><td>QgsColorButtonV2 <tr><td>QgsColorButton
27-
<tr><td>QgsSymbolLayerV2 <tr><td>QgsSymbolLayer
28-
<tr><td>QgsSymbolLayerV2AbstractMetadata <tr><td>QgsSymbolLayerAbstractMetadata
29-
<tr><td>QgsSymbolLayerV2Metadata <tr><td>QgsSymbolLayerMetadata
30-
<tr><td>QgsSymbolLayerV2Registry <tr><td>QgsSymbolLayerRegistry
31-
<tr><td>QgsSymbolLayerV2Utils <tr><td>QgsSymbolLayerUtils
32-
<tr><td>QgsSymbolLayerV2Widget <tr><td>QgsSymbolLayerWidget
25+
<tr><th>API 2.x <th>API 3.X
26+
<tr><td>QgsColorButtonV2 <td>QgsColorButton
27+
<tr><td>QgsSymbolLayerV2 <td>QgsSymbolLayer
28+
<tr><td>QgsSymbolLayerV2AbstractMetadata <td>QgsSymbolLayerAbstractMetadata
29+
<tr><td>QgsSymbolLayerV2Metadata <td>QgsSymbolLayerMetadata
30+
<tr><td>QgsSymbolLayerV2Registry <td>QgsSymbolLayerRegistry
31+
<tr><td>QgsSymbolLayerV2Utils <td>QgsSymbolLayerUtils
32+
<tr><td>QgsSymbolLayerV2Widget <td>QgsSymbolLayerWidget
33+
<tr><th>QgsSymbolV2 <th>QgsSymbol
34+
<tr><td>QgsSymbolV2LegendNode <td>QgsSymbolLegendNode
35+
<tr><td>QgsSymbolV2LevelItem <td>QgsSymbolLevelItem
36+
<tr><td>QgsSymbolV2RenderContext <td>QgsSymbolRenderContext
37+
<tr><td>QgsSymbolV2SelectorDialog <td>QgsSymbolSelectorDialog
38+
<tr><td>QgsSymbolV2SelectorWidget <td>QgsSymbolSelectorWidget
3339
</table>
34-
40+
3541
\subsection qgis_api_break_3_0_removed_classes Removed Classes
3642

3743
<ul>
@@ -545,23 +551,23 @@ be returned instead of a null pointer if no transformation is required.</li>
545551
<li>Constructor variant with QgsMapRenderer has been removed. Use the variant with QgsMapSettings.</li>
546552
</ul>
547553

548-
\subsection qgis_api_break_3_0_QgsSymbolV2 QgsSymbolV2
554+
\subsection qgis_api_break_3_0_QgsSymbol QgsSymbol (renamed from QgsSymbolV2)
549555

550556
<ul>
551-
<li>The OutputUnit enum, including QgsSymbolV2::MM, QgsSymbolV2::MapUnit, QgsSymbolV2::Mixed, QgsSymbolV2::Pixel and QgsSymbolV2::Percentage has been moved to QgsUnitTypes
552-
and renamed to RenderUnit. QgsSymbolV2::OutputUnitList was renamed to QgsUnitTypes::RenderUnitList. All methods which previously accepted QgsSymbolV2::OutputUnit
553-
parameters or QgsSymbolV2::OutputUnitList parameters now take QgsUnitTypes::RenderUnit or QgsUnitTypes::RenderUnitList parameters respectively.</li>
557+
<li>The OutputUnit enum, including QgsSymbol::MM, QgsSymbol::MapUnit, QgsSymbol::Mixed, QgsSymbol::Pixel and QgsSymbol::Percentage has been moved to QgsUnitTypes
558+
and renamed to RenderUnit. QgsSymbol::OutputUnitList was renamed to QgsUnitTypes::RenderUnitList. All methods which previously accepted QgsSymbol::OutputUnit
559+
parameters or QgsSymbol::OutputUnitList parameters now take QgsUnitTypes::RenderUnit or QgsUnitTypes::RenderUnitList parameters respectively.</li>
554560
<li>startRender() now accepts a QgsFields reference, not a pointer.</li>
555561
</ul>
556562

557563
\subsection qgis_api_break_3_0_QgsSymbolLayer QgsSymbolLayer (renamed from QgsSymbolLayerV2)
558564

559565
<ul>
560566
<li>The deprecated prepareExpressions( const QgsFields* fields, double scale = -1.0 ) method has been removed. Use
561-
the variant which takes QgsSymbolV2RenderContext instead.</li>
567+
the variant which takes QgsSymbolRenderContext instead.</li>
562568
</ul>
563569

564-
\subsection qgis_api_break_3_0_QgsSymbolV2RenderContext QgsSymbolV2RenderContext
570+
\subsection qgis_api_break_3_0_QgsSymbolRenderContext QgsSymbolRenderContext (renamed from QgsSymbolV2RenderContext)
565571

566572
<ul>
567573
<li>The constructor now accepts a QgsFields reference, not a pointer.</li>

python/core/composer/qgscomposerlegenditem.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class QgsComposerSymbolV2Item: QgsComposerLegendItem
5959
virtual void readXml( const QDomElement& itemElem, bool xServerAvailable = true );
6060

6161
/** Set symbol (takes ownership)*/
62-
void setSymbolV2( QgsSymbolV2* s /Transfer/ );
63-
QgsSymbolV2* symbolV2();
62+
void setSymbolV2( QgsSymbol* s /Transfer/ );
63+
QgsSymbol* symbolV2();
6464

6565
ItemType itemType() const;
6666
};

python/core/composer/qgscomposerpolygon.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class QgsComposerPolygon: QgsComposerNodesItem
1212
/** Overridden to return shape name */
1313
virtual QString displayName() const;
1414

15-
/** Returns the QgsSymbolV2 used to draw the shape. */
15+
/** Returns the QgsSymbol used to draw the shape. */
1616
QgsFillSymbolV2* polygonStyleSymbol();
1717

18-
/** Set the QgsSymbolV2 used to draw the shape. */
18+
/** Set the QgsSymbol used to draw the shape. */
1919
void setPolygonStyleSymbol( QgsFillSymbolV2* symbol );
2020

2121
/** Return correct graphics item type. */

python/core/composer/qgscomposerpolyline.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class QgsComposerPolyline: QgsComposerNodesItem
1212
/** Overridden to return shape name */
1313
virtual QString displayName() const;
1414

15-
/** Returns the QgsSymbolV2 used to draw the shape. */
15+
/** Returns the QgsSymbol used to draw the shape. */
1616
QgsLineSymbolV2* polylineStyleSymbol();
1717

18-
/** Set the QgsSymbolV2 used to draw the shape. */
18+
/** Set the QgsSymbol used to draw the shape. */
1919
void setPolylineStyleSymbol( QgsLineSymbolV2* symbol );
2020

2121
/** Overridden to return shape type */

python/core/composer/qgslegendmodel.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class QgsLegendModel : QStandardItemModel
4141
/** Updates the whole symbology of a layer*/
4242
void updateLayer( QStandardItem* layerItem );
4343
/** Tries to update a single classification item*/
44-
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, const QString& itemText );
44+
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, const QString& itemText );
4545

4646
void updateRasterClassificationItem( QStandardItem* classificationItem );
4747

python/core/core.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
%Include symbology-ng/qgscptcityarchive.sip
292292
%Include symbology-ng/qgsstylev2.sip
293293
%Include symbology-ng/qgssvgcache.sip
294-
%Include symbology-ng/qgssymbolv2.sip
294+
%Include symbology-ng/qgssymbol.sip
295295
%Include symbology-ng/qgsvectorcolorrampv2.sip
296296

297297
%Include symbology-ng/qgs25drenderer.sip

python/core/layertree/qgslayertreemodellegendnode.sip

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class QgsLayerTreeModelLegendNode : QObject
2020
enum LegendNodeRoles
2121
{
2222
RuleKeyRole, //!< rule key of the node (QString)
23-
SymbolV2LegacyRuleKeyRole, //!< for QgsSymbolV2LegendNode only - legacy rule key (void ptr, to be cast to QgsSymbolV2 ptr)
23+
SymbolV2LegacyRuleKeyRole, //!< for QgsSymbolLegendNode only - legacy rule key (void ptr, to be cast to QgsSymbol ptr)
2424
ParentRuleKeyRole //!< rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2.8
2525
};
2626

@@ -112,14 +112,14 @@ class QgsLayerTreeModelLegendNode : QObject
112112
*
113113
* @note added in 2.6
114114
*/
115-
class QgsSymbolV2LegendNode : QgsLayerTreeModelLegendNode
115+
class QgsSymbolLegendNode : QgsLayerTreeModelLegendNode
116116
{
117117
%TypeHeaderCode
118118
#include <qgslayertreemodellegendnode.h>
119119
%End
120120
public:
121-
QgsSymbolV2LegendNode( QgsLayerTreeLayer* nodeLayer, const QgsLegendSymbolItemV2& item, QObject* parent /TransferThis/ = 0 );
122-
~QgsSymbolV2LegendNode();
121+
QgsSymbolLegendNode( QgsLayerTreeLayer* nodeLayer, const QgsLegendSymbolItemV2& item, QObject* parent /TransferThis/ = 0 );
122+
~QgsSymbolLegendNode();
123123

124124
virtual Qt::ItemFlags flags() const;
125125
virtual QVariant data( int role ) const;
@@ -149,15 +149,15 @@ class QgsSymbolV2LegendNode : QgsLayerTreeModelLegendNode
149149
* @see setSymbol()
150150
* @note added in QGIS 2.14
151151
*/
152-
const QgsSymbolV2* symbol() const;
152+
const QgsSymbol* symbol() const;
153153

154154
/** Sets the symbol to be used by the legend node. The symbol change is also propagated
155155
* to the associated vector layer's renderer.
156156
* @param symbol new symbol for node. Ownership is transferred.
157157
* @see symbol()
158158
* @note added in QGIS 2.14
159159
*/
160-
void setSymbol( QgsSymbolV2* symbol /Transfer/ );
160+
void setSymbol( QgsSymbol* symbol /Transfer/ );
161161

162162
public slots:
163163

python/core/qgsconditionalstyle.sip

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ class QgsConditionalStyle
107107

108108
/**
109109
* @brief Set the icon for the style. Icons are generated from symbols
110-
* @param value QgsSymbolV2 to be used when generating the icon
110+
* @param value QgsSymbol to be used when generating the icon
111111
*/
112-
void setSymbol( QgsSymbolV2* value );
112+
void setSymbol( QgsSymbol* value );
113113

114114
/**
115115
* @brief The name of the style.
@@ -131,9 +131,9 @@ class QgsConditionalStyle
131131

132132
/**
133133
* @brief The symbol used to generate the icon for the style
134-
* @return The QgsSymbolV2 used for the icon
134+
* @return The QgsSymbol used for the icon
135135
*/
136-
QgsSymbolV2* symbol() const;
136+
QgsSymbol* symbol() const;
137137

138138
/**
139139
* @brief The text color set for style

python/core/qgsdiagramrendererv2.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class QgsDiagramSettings
252252
%End
253253
public:
254254

255-
//! @deprecated use QgsSymbolV2::OutputUnit instead
255+
//! @deprecated use QgsSymbol::OutputUnit instead
256256
enum SizeType
257257
{
258258
MM,

python/core/qgsexpressioncontext.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,12 @@ class QgsExpressionContextUtils
549549
static QgsExpressionContextScope* mapSettingsScope( const QgsMapSettings &mapSettings ) /Factory/;
550550

551551
/**
552-
* Updates a symbol scope related to a QgsSymbolV2 to an expression context.
552+
* Updates a symbol scope related to a QgsSymbol to an expression context.
553553
* @param symbol symbol to extract properties from
554554
* @param symbolScope pointer to an existing scope to update
555555
* @note added in QGIS 2.14
556556
*/
557-
static QgsExpressionContextScope* updateSymbolScope( const QgsSymbolV2* symbol, QgsExpressionContextScope* symbolScope = nullptr );
557+
static QgsExpressionContextScope* updateSymbolScope( const QgsSymbol* symbol, QgsExpressionContextScope* symbolScope = nullptr );
558558

559559
/** Creates a new scope which contains variables and functions relating to a QgsComposition.
560560
* For instance, number of pages and page sizes.

python/core/qgsmaphittest.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class QgsMapHitTest
3131
* @note added in QGIS 2.12
3232
* @see legendKeyVisible()
3333
*/
34-
bool symbolVisible( QgsSymbolV2* symbol, QgsVectorLayer* layer ) const;
34+
bool symbolVisible( QgsSymbol* symbol, QgsVectorLayer* layer ) const;
3535

3636
/** Tests whether a given legend key is visible for a specified layer.
3737
* @param ruleKey legend rule key

python/core/qgsvectorlayer.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class QgsVectorLayer : QgsMapLayer
568568
* @param symbol the symbol
569569
* @return number of features rendered by symbol or -1 if failed or counts are not available
570570
*/
571-
long featureCount( QgsSymbolV2* symbol ) const;
571+
long featureCount( QgsSymbol* symbol ) const;
572572

573573
/**
574574
* Update the data source of the layer. The layer's renderer and legend will be preserved only
@@ -583,7 +583,7 @@ class QgsVectorLayer : QgsMapLayer
583583
void setDataSource( const QString& dataSource, const QString& baseName, const QString& provider, bool loadDefaultStyleFlag = false );
584584

585585
/**
586-
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbolV2*).
586+
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbol*).
587587
* @param showProgress show progress dialog
588588
* @return true if calculated, false if failed or was canceled by user
589589
*/

python/core/symbology-ng/qgs25drenderer.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class Qgs25DRenderer : QgsFeatureRendererV2
3636
QList<QString> usedAttributes();
3737
QgsFeatureRendererV2* clone() const;
3838

39-
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
40-
virtual QgsSymbolV2List symbols( QgsRenderContext& context );
39+
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
40+
virtual QgsSymbolList symbols( QgsRenderContext& context );
4141

4242
/**
4343
* Get the roof color

python/core/symbology-ng/qgsarrowsymbollayer.sip

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class QgsArrowSymbolLayer : public QgsLineSymbolLayerV2
2626
virtual QgsArrowSymbolLayer* clone() const /Factory/;
2727

2828
/** Get the sub symbol used for filling */
29-
virtual QgsSymbolV2* subSymbol();
29+
virtual QgsSymbol* subSymbol();
3030

3131
/** Set the sub symbol used for filling */
32-
virtual bool setSubSymbol( QgsSymbolV2* symbol /Transfer/ );
32+
virtual bool setSubSymbol( QgsSymbol* symbol /Transfer/ );
3333

3434
/** Return a list of attributes required to render this feature */
3535
virtual QSet<QString> usedAttributes() const;
@@ -136,13 +136,13 @@ class QgsArrowSymbolLayer : public QgsLineSymbolLayerV2
136136
QString layerType() const;
137137

138138
/** Prepare the rendering */
139-
void startRender( QgsSymbolV2RenderContext& context );
139+
void startRender( QgsSymbolRenderContext& context );
140140

141141
/** End of the rendering */
142-
void stopRender( QgsSymbolV2RenderContext& context );
142+
void stopRender( QgsSymbolRenderContext& context );
143143

144144
/** Main drawing method */
145-
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
145+
void renderPolyline( const QPolygonF& points, QgsSymbolRenderContext& context );
146146

147147
void setColor( const QColor& c );
148148
virtual QColor color() const;

python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ class QgsRendererCategoryV2
66
public:
77

88
//! takes ownership of symbol
9-
QgsRendererCategoryV2( const QVariant& value, QgsSymbolV2* symbol /Transfer/, const QString& label, bool render = true );
9+
QgsRendererCategoryV2( const QVariant& value, QgsSymbol* symbol /Transfer/, const QString& label, bool render = true );
1010

1111
//! copy constructor
1212
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat );
1313

1414
~QgsRendererCategoryV2();
1515

1616
QVariant value() const;
17-
QgsSymbolV2* symbol() const;
17+
QgsSymbol* symbol() const;
1818
QString label() const;
1919

2020
void setValue( const QVariant &value );
21-
void setSymbol( QgsSymbolV2* s /Transfer/ );
21+
void setSymbol( QgsSymbol* s /Transfer/ );
2222
void setLabel( const QString &label );
2323

2424
// @note added in 2.5
@@ -50,10 +50,10 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
5050
virtual ~QgsCategorizedSymbolRendererV2();
5151

5252
//! @note available in python as symbolForFeature2
53-
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
53+
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
5454

5555
//! @note available in python as originalSymbolForFeature2
56-
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
56+
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
5757

5858
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
5959

@@ -73,14 +73,14 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
7373
virtual QString filter( const QgsFields& fields = QgsFields() );
7474

7575
//! @note available in python as symbols2
76-
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
76+
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
7777

7878
/** Update all the symbols but leave categories and colors. This method also sets the source
7979
* symbol for the renderer.
8080
* @param sym source symbol to use for categories. Ownership is not transferred.
8181
* @see setSourceSymbol()
8282
*/
83-
void updateSymbols( QgsSymbolV2 * sym );
83+
void updateSymbols( QgsSymbol * sym );
8484

8585
const QgsCategoryList& categories() const;
8686

@@ -92,7 +92,7 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
9292
int categoryIndexForLabel( const QString& val );
9393

9494
bool updateCategoryValue( int catIndex, const QVariant &value );
95-
bool updateCategorySymbol( int catIndex, QgsSymbolV2* symbol /Transfer/ );
95+
bool updateCategorySymbol( int catIndex, QgsSymbol* symbol /Transfer/ );
9696
bool updateCategoryLabel( int catIndex, const QString& label );
9797

9898
//! @note added in 2.5
@@ -134,15 +134,15 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
134134
* @see setSourceSymbol()
135135
* @see sourceColorRamp()
136136
*/
137-
QgsSymbolV2* sourceSymbol();
137+
QgsSymbol* sourceSymbol();
138138

139139
/** Sets the source symbol for the renderer, which is the base symbol used for the each categories' symbol before applying
140140
* the categories' color.
141141
* @param sym source symbol, ownership is transferred to the renderer
142142
* @see sourceSymbol()
143143
* @see setSourceColorRamp()
144144
*/
145-
void setSourceSymbol( QgsSymbolV2* sym /Transfer/ );
145+
void setSourceSymbol( QgsSymbol* sym /Transfer/ );
146146

147147
/** Returns the source color ramp, from which each categories' color is derived.
148148
* @see setSourceColorRamp()
@@ -174,8 +174,8 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
174174
void setSizeScaleField( const QString& fieldOrExpression );
175175
QString sizeScaleField() const;
176176

177-
void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod );
178-
QgsSymbolV2::ScaleMethod scaleMethod() const;
177+
void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
178+
QgsSymbol::ScaleMethod scaleMethod() const;
179179

180180
//! items of symbology items in legend should be checkable
181181
//! @note added in 2.5
@@ -185,7 +185,7 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
185185
// @note added in 2.5
186186
virtual bool legendSymbolItemChecked( const QString& key );
187187

188-
virtual void setLegendSymbolItem( const QString& key, QgsSymbolV2* symbol /Transfer/ );
188+
virtual void setLegendSymbolItem( const QString& key, QgsSymbol* symbol /Transfer/ );
189189

190190
//! item in symbology was checked
191191
// @note added in 2.5
@@ -203,9 +203,9 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
203203
protected:
204204
void rebuildHash();
205205

206-
QgsSymbolV2* skipRender();
206+
QgsSymbol* skipRender();
207207

208-
QgsSymbolV2* symbolForValue( const QVariant& value );
208+
QgsSymbol* symbolForValue( const QVariant& value );
209209

210210
private:
211211
QgsCategorizedSymbolRendererV2( const QgsCategorizedSymbolRendererV2 & );

0 commit comments

Comments
 (0)