Skip to content

Commit

Permalink
Merge pull request #3355 from 3nids/V2removal
Browse files Browse the repository at this point in the history
remove V2 in some classes
  • Loading branch information
3nids committed Aug 5, 2016
2 parents 19ab72c + acbf5cd commit ab57541
Show file tree
Hide file tree
Showing 289 changed files with 4,554 additions and 4,532 deletions.
38 changes: 30 additions & 8 deletions doc/api_break.dox
Expand Up @@ -18,6 +18,28 @@ This page tries to maintain a list with incompatible changes that happened in pr

\section qgis_api_break_3_0 QGIS 3.0

\subsection qgis_api_break_3_0_renamed_classes Renamed Classes

<table>
<caption id="renamed_classes">Renamed classes</caption>
<tr><th>API 2.x <th>API 3.X
<tr><td>QgsColorButtonV2 <td>QgsColorButton
<tr><td>QgsSymbolLayerV2 <td>QgsSymbolLayer
<tr><td>QgsSymbolLayerV2AbstractMetadata <td>QgsSymbolLayerAbstractMetadata
<tr><td>QgsSymbolLayerV2Metadata <td>QgsSymbolLayerMetadata
<tr><td>QgsSymbolLayerV2Registry <td>QgsSymbolLayerRegistry
<tr><td>QgsSymbolLayerV2Utils <td>QgsSymbolLayerUtils
<tr><td>QgsSymbolLayerV2Widget <td>QgsSymbolLayerWidget
<tr><td>QgsSymbolLevelsV2Dialog <td>QgsSymbolLevelsDialog
<tr><td>QgsSymbologyV2Conversion <td>QgsSymbologyConversion
<tr><th>QgsSymbolV2 <th>QgsSymbol
<tr><td>QgsSymbolV2LegendNode <td>QgsSymbolLegendNode
<tr><td>QgsSymbolV2LevelItem <td>QgsSymbolLevelItem
<tr><td>QgsSymbolV2RenderContext <td>QgsSymbolRenderContext
<tr><td>QgsSymbolV2SelectorDialog <td>QgsSymbolSelectorDialog
<tr><td>QgsSymbolV2SelectorWidget <td>QgsSymbolSelectorWidget
</table>

\subsection qgis_api_break_3_0_removed_classes Removed Classes

<ul>
Expand Down Expand Up @@ -531,30 +553,30 @@ be returned instead of a null pointer if no transformation is required.</li>
<li>Constructor variant with QgsMapRenderer has been removed. Use the variant with QgsMapSettings.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbolV2 QgsSymbolV2
\subsection qgis_api_break_3_0_QgsSymbol QgsSymbol (renamed from QgsSymbolV2)

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

\subsection qgis_api_break_3_0_QgsSymbolLayerV2 QgsSymbolLayerV2
\subsection qgis_api_break_3_0_QgsSymbolLayer QgsSymbolLayer (renamed from QgsSymbolLayerV2)

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

\subsection qgis_api_break_3_0_QgsSymbolV2RenderContext QgsSymbolV2RenderContext
\subsection qgis_api_break_3_0_QgsSymbolRenderContext QgsSymbolRenderContext (renamed from QgsSymbolV2RenderContext)

<ul>
<li>The constructor now accepts a QgsFields reference, not a pointer.</li>
<li>fields() now returns a QgsFields value, not a pointer.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbolLayerV2Utils QgsSymbolLayerV2Utils
\subsection qgis_api_break_3_0_QgsSymbolLayerUtils QgsSymbolLayerUtils (renamed from QgsSymbolLayerUtilsV2)

<ul>
<li>encodeOutputUnit() and decodeOutputUnit() were removed. QgsUnitTypes::encodeUnit() and QgsUnitTypes::decodeRenderUnit() should be used instead.</li>
Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposerlegenditem.sip
Expand Up @@ -59,8 +59,8 @@ class QgsComposerSymbolV2Item: QgsComposerLegendItem
virtual void readXml( const QDomElement& itemElem, bool xServerAvailable = true );

/** Set symbol (takes ownership)*/
void setSymbolV2( QgsSymbolV2* s /Transfer/ );
QgsSymbolV2* symbolV2();
void setSymbolV2( QgsSymbol* s /Transfer/ );
QgsSymbol* symbolV2();

ItemType itemType() const;
};
Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposerpolygon.sip
Expand Up @@ -12,10 +12,10 @@ class QgsComposerPolygon: QgsComposerNodesItem
/** Overridden to return shape name */
virtual QString displayName() const;

/** Returns the QgsSymbolV2 used to draw the shape. */
/** Returns the QgsSymbol used to draw the shape. */
QgsFillSymbolV2* polygonStyleSymbol();

/** Set the QgsSymbolV2 used to draw the shape. */
/** Set the QgsSymbol used to draw the shape. */
void setPolygonStyleSymbol( QgsFillSymbolV2* symbol );

/** Return correct graphics item type. */
Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposerpolyline.sip
Expand Up @@ -12,10 +12,10 @@ class QgsComposerPolyline: QgsComposerNodesItem
/** Overridden to return shape name */
virtual QString displayName() const;

/** Returns the QgsSymbolV2 used to draw the shape. */
/** Returns the QgsSymbol used to draw the shape. */
QgsLineSymbolV2* polylineStyleSymbol();

/** Set the QgsSymbolV2 used to draw the shape. */
/** Set the QgsSymbol used to draw the shape. */
void setPolylineStyleSymbol( QgsLineSymbolV2* symbol );

/** Overridden to return shape type */
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgslegendmodel.sip
Expand Up @@ -41,7 +41,7 @@ class QgsLegendModel : QStandardItemModel
/** Updates the whole symbology of a layer*/
void updateLayer( QStandardItem* layerItem );
/** Tries to update a single classification item*/
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, const QString& itemText );
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, const QString& itemText );

void updateRasterClassificationItem( QStandardItem* classificationItem );

Expand Down
10 changes: 5 additions & 5 deletions python/core/core.sip
Expand Up @@ -291,7 +291,7 @@
%Include symbology-ng/qgscptcityarchive.sip
%Include symbology-ng/qgsstylev2.sip
%Include symbology-ng/qgssvgcache.sip
%Include symbology-ng/qgssymbolv2.sip
%Include symbology-ng/qgssymbol.sip
%Include symbology-ng/qgsvectorcolorrampv2.sip

%Include symbology-ng/qgs25drenderer.sip
Expand All @@ -312,13 +312,13 @@
%Include symbology-ng/qgsgeometrygeneratorsymbollayerv2.sip
%Include symbology-ng/qgslinesymbollayerv2.sip
%Include symbology-ng/qgsmarkersymbollayerv2.sip
%Include symbology-ng/qgssymbollayerv2.sip
%Include symbology-ng/qgssymbollayerv2registry.sip
%Include symbology-ng/qgssymbollayerv2utils.sip
%Include symbology-ng/qgssymbollayer.sip
%Include symbology-ng/qgssymbollayerregistry.sip
%Include symbology-ng/qgssymbollayerutils.sip
%Include symbology-ng/qgsvectorfieldsymbollayer.sip
%Include symbology-ng/qgsarrowsymbollayer.sip

%Include symbology-ng/qgssymbologyv2conversion.sip
%Include symbology-ng/qgssymbologyconversion.sip

%Include dxf/qgsdxfexport.sip

Expand Down
12 changes: 6 additions & 6 deletions python/core/layertree/qgslayertreemodellegendnode.sip
Expand Up @@ -20,7 +20,7 @@ class QgsLayerTreeModelLegendNode : QObject
enum LegendNodeRoles
{
RuleKeyRole, //!< rule key of the node (QString)
SymbolV2LegacyRuleKeyRole, //!< for QgsSymbolV2LegendNode only - legacy rule key (void ptr, to be cast to QgsSymbolV2 ptr)
SymbolV2LegacyRuleKeyRole, //!< for QgsSymbolLegendNode only - legacy rule key (void ptr, to be cast to QgsSymbol ptr)
ParentRuleKeyRole //!< rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2.8
};

Expand Down Expand Up @@ -112,14 +112,14 @@ class QgsLayerTreeModelLegendNode : QObject
*
* @note added in 2.6
*/
class QgsSymbolV2LegendNode : QgsLayerTreeModelLegendNode
class QgsSymbolLegendNode : QgsLayerTreeModelLegendNode
{
%TypeHeaderCode
#include <qgslayertreemodellegendnode.h>
%End
public:
QgsSymbolV2LegendNode( QgsLayerTreeLayer* nodeLayer, const QgsLegendSymbolItemV2& item, QObject* parent /TransferThis/ = 0 );
~QgsSymbolV2LegendNode();
QgsSymbolLegendNode( QgsLayerTreeLayer* nodeLayer, const QgsLegendSymbolItemV2& item, QObject* parent /TransferThis/ = 0 );
~QgsSymbolLegendNode();

virtual Qt::ItemFlags flags() const;
virtual QVariant data( int role ) const;
Expand Down Expand Up @@ -149,15 +149,15 @@ class QgsSymbolV2LegendNode : QgsLayerTreeModelLegendNode
* @see setSymbol()
* @note added in QGIS 2.14
*/
const QgsSymbolV2* symbol() const;
const QgsSymbol* symbol() const;

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

public slots:

Expand Down
8 changes: 4 additions & 4 deletions python/core/qgsconditionalstyle.sip
Expand Up @@ -107,9 +107,9 @@ class QgsConditionalStyle

/**
* @brief Set the icon for the style. Icons are generated from symbols
* @param value QgsSymbolV2 to be used when generating the icon
* @param value QgsSymbol to be used when generating the icon
*/
void setSymbol( QgsSymbolV2* value );
void setSymbol( QgsSymbol* value );

/**
* @brief The name of the style.
Expand All @@ -131,9 +131,9 @@ class QgsConditionalStyle

/**
* @brief The symbol used to generate the icon for the style
* @return The QgsSymbolV2 used for the icon
* @return The QgsSymbol used for the icon
*/
QgsSymbolV2* symbol() const;
QgsSymbol* symbol() const;

/**
* @brief The text color set for style
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsdiagramrendererv2.sip
Expand Up @@ -252,7 +252,7 @@ class QgsDiagramSettings
%End
public:

//! @deprecated use QgsSymbolV2::OutputUnit instead
//! @deprecated use QgsSymbol::OutputUnit instead
enum SizeType
{
MM,
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsexpressioncontext.sip
Expand Up @@ -549,12 +549,12 @@ class QgsExpressionContextUtils
static QgsExpressionContextScope* mapSettingsScope( const QgsMapSettings &mapSettings ) /Factory/;

/**
* Updates a symbol scope related to a QgsSymbolV2 to an expression context.
* Updates a symbol scope related to a QgsSymbol to an expression context.
* @param symbol symbol to extract properties from
* @param symbolScope pointer to an existing scope to update
* @note added in QGIS 2.14
*/
static QgsExpressionContextScope* updateSymbolScope( const QgsSymbolV2* symbol, QgsExpressionContextScope* symbolScope = nullptr );
static QgsExpressionContextScope* updateSymbolScope( const QgsSymbol* symbol, QgsExpressionContextScope* symbolScope = nullptr );

/** Creates a new scope which contains variables and functions relating to a QgsComposition.
* For instance, number of pages and page sizes.
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmaphittest.sip
Expand Up @@ -31,7 +31,7 @@ class QgsMapHitTest
* @note added in QGIS 2.12
* @see legendKeyVisible()
*/
bool symbolVisible( QgsSymbolV2* symbol, QgsVectorLayer* layer ) const;
bool symbolVisible( QgsSymbol* symbol, QgsVectorLayer* layer ) const;

/** Tests whether a given legend key is visible for a specified layer.
* @param ruleKey legend rule key
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -568,7 +568,7 @@ class QgsVectorLayer : QgsMapLayer
* @param symbol the symbol
* @return number of features rendered by symbol or -1 if failed or counts are not available
*/
long featureCount( QgsSymbolV2* symbol ) const;
long featureCount( QgsSymbol* symbol ) const;

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

/**
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbolV2*).
* Count features for symbols. Feature counts may be get by featureCount( QgsSymbol*).
* @param showProgress show progress dialog
* @return true if calculated, false if failed or was canceled by user
*/
Expand Down
4 changes: 2 additions & 2 deletions python/core/symbology-ng/qgs25drenderer.sip
Expand Up @@ -36,8 +36,8 @@ class Qgs25DRenderer : QgsFeatureRendererV2
QList<QString> usedAttributes();
QgsFeatureRendererV2* clone() const;

virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
virtual QgsSymbolV2List symbols( QgsRenderContext& context );
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
virtual QgsSymbolList symbols( QgsRenderContext& context );

/**
* Get the roof color
Expand Down
12 changes: 6 additions & 6 deletions python/core/symbology-ng/qgsarrowsymbollayer.sip
Expand Up @@ -20,16 +20,16 @@ class QgsArrowSymbolLayer : public QgsLineSymbolLayerV2
*
* @return A new QgsArrowSymbolLayer
*/
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;

/** Virtual constructor */
virtual QgsArrowSymbolLayer* clone() const /Factory/;

/** Get the sub symbol used for filling */
virtual QgsSymbolV2* subSymbol();
virtual QgsSymbol* subSymbol();

/** Set the sub symbol used for filling */
virtual bool setSubSymbol( QgsSymbolV2* symbol /Transfer/ );
virtual bool setSubSymbol( QgsSymbol* symbol /Transfer/ );

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

/** Prepare the rendering */
void startRender( QgsSymbolV2RenderContext& context );
void startRender( QgsSymbolRenderContext& context );

/** End of the rendering */
void stopRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolRenderContext& context );

/** Main drawing method */
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolRenderContext& context );

void setColor( const QColor& c );
virtual QColor color() const;
Expand Down

0 comments on commit ab57541

Please sign in to comment.