/*! \page api_break Backwards Incompatible Changes
\tableofcontents
The API of QGIS libraries is allowed to be changed just between major versions of QGIS. For example, there
are various planned backwards incompatible changes between QGIS 1.8 and 2.0 because the version 2.0 is a new
major version. After a release of a major version of QGIS (e.g. 2.0) the developer team is committed to maintain
stable API for all subsequent minor releases (2.2, 2.4, ...). That roughly means we do not rename classes and methods,
remove them nor change their semantics. Existing code should keep working when the user updates QGIS
to another minor version (e.g. from 2.0 to 2.2), so all extensions of existing classes should be done in a manner that
third party developers do not need to adjust their code to work properly with newer QGIS releases.
Sometimes, however, we need to break the API as a result of code changes. These cases are exceptions
and they happen only after consideration and agreement of the development team.
Backwards incompatible changes with large impact are postponed to the next major release and tracked in
https://github.com/qgis/qgis4.0_api/issues
This page maintains a list of incompatible changes that happened in previous releases.
QGIS 3.38 {#qgis_api_break_3_38}
=========
Enabling GDAL Python exceptions
-------------------------------
- QGIS now turns on exceptions in the osgeo.gdal, osgeo.ogr and osgeo.osr modules.
This may affect plugins that use the GDAL Python API. Typically gdal.Open,
gdal.OpenEx or ogr.Open() (non exclusive list) will now throw an exception
if the dataset cannot be opened.
QGIS 3.24 {#qgis_api_break_3_24}
=========
Additional geometry attributes
------------------------------
- If a postgis layer has more than one geometry, the additional geometry attributes are exposed as
QgsReferencedGeometry. Previously, they were exposed as EWKT strings. EWKT strings are still supported
for inserting and updating features.
QGIS 3.22 {#qgis_api_break_3_22}
=========
QgsApplication {#qgis_api_break_3_22_qgsapplication}
--------------
- QgsApplication::shortNameRegExp function was removed as part of a general code migration away from the deprecated
QRegExp class. It has been replaced with QgsApplication::shortNameRegularExpression which returns a
QRegularExpression object.
QgsNewNameDialog {#qgis_api_break_3_22_qgsnewnamedialog}
----------------
- The `regexp` argument in the QgsNewNameDialog constructor has been removed as part of a general code migration
away from the deprecated QRegExp class. It has been replaced with QgsNewNameDialog::setRegularExpression which
accepts a string argument.
QgsVectorLayerServerProperties {#qgis_api_break_3_22_qgsvectorlayerserverproperties}
------------------------------
- The content of QgsVectorLayerServerProperties has been moved in QgsMapLayerServerProperties. But the member
in QgsVectorLayer::serverProperties() is still existing.
QGIS 3.20 {#qgis_api_break_3_20}
=========
QgsMapRendererJob {#qgis_api_break_3_20_qgsmaprendererjob}
-----------------
- QgsMapRendererJob::start is no longer virtual. It has been replaced with QgsMapRendererJob::startPrivate. The method QgsMapRendererJob::start checks if the map can be rendered before calling QgsMapRendererJob::startPrivate.
Subclasses have to implement the virtual method startPrivate to start the rendering of the map. For the actual subclasses (QgsMapRendererParallelJob, QgsMapRendererSequentialJob, ...), the start method
is replaced by startPrivate method without change.
QgsMapLayer {#qgis_api_break_3_20_qgsmaplayer}
-------------
- QgsMapLayer::setDataSource is no longer virtual. It has been replaced with QgsMapLayer::setDataSourcePrivate. This is only relevant for subclassing QgsMapLayer, for code that only uses the subclasses (QgsVectorLayer, QgsRasterLayer, ...) this has no effect.
- QgsVectorLayerFeatureIterator::FetchJoinInfo::joinLayer was removed. This layer pointer was dangerous and not safe to access in any situation.
QGIS 3.4 {#qgis_api_break_3_4}
========
QgsMapToPixel {#qgis_api_break_3_4_qgsmaptopixel}
-------------
- toMapCoordinatesF have been renamed to toMapCoordinates (as a double overload) for C++ only (Python keeps toMapCoordinatesF).
- toMapPoint has been deprecated in favor of toMapCoordinates.
QGIS 3.0 {#qgis_api_break_3_0}
========
Version 3.0 brings changes to many underlying dependencies which QGIS is built upon. Any existing PyQGIS code will
need to be updated to address the changes made within these libraries.
Python 3.0
----------
QGIS 3.0 introduces a move to Python 3. This version brings many changes to both the Python language and individual Python
libraries. A good place to start learning about the changes involved, and how to port your code to Python 3, is available
in the official Python documentation: [Porting Python 2 Code to Python 3](https://docs.python.org/3/howto/pyporting.html).
Qt 5
----
QGIS 3.0 is based off version 5 of the underlying Qt libraries. Many changes and API breaks were introduced in Qt5. While
it is c++ specific, a good place to read about the major changes introduced in Qt5 is at the Qt docs:
[C++ API changes](http://doc.qt.io/qt-5/sourcebreaks.html)
PyQt 5
------
Together with the Python and Qt version changes, the PyQt libraries which expose Qt classes to Python have also had their
version bumped to PyQt 5. The changes introduced in PyQt 5 and the steps required to upgrade existing code are summarised at:
[Differences Between PyQt4 and PyQt5](http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html)
Moved Classes {#qgis_api_break_3_0_moved_classes}
-------------
API 2.x | API 3.X
|
---|
QgisGui | QgsGuiUtils
|
QgsAbstractGeometryV2 | QgsAbstractGeometry
|
QgsArcProperter | QgsStrategy
|
QgsAttributeAction | QgsActionManager
|
QgsCategorizedSymbolRendererV2 | QgsCategorizedSymbolRenderer
|
QgsCategorizedSymbolRendererV2Model | QgsCategorizedSymbolRendererModel
|
QgsCategorizedSymbolRendererV2ViewStyle | QgsCategorizedSymbolRendererViewStyle
|
QgsCategorizedSymbolRendererV2Widget | QgsCategorizedSymbolRendererWidget
|
QgsCentroidFillSymbolLayerV2 | QgsCentroidFillSymbolLayer
|
QgsCentroidFillSymbolLayerV2Widget | QgsCentroidFillSymbolLayerWidget
|
QgsCircularStringV2 | QgsCircularString
|
QgsColorButtonV2 | QgsColorButton
|
QgsCompoundCurveV2 | QgsCompoundCurve
|
QgsCoordinateSequenceV2 | QgsCoordinateSequence
|
QgsCptCityColorRampV2 | QgsCptCityColorRamp
|
QgsCptCityColorRampV2Dialog | QgsCptCityColorRampDialog
|
QgsCptCityColorRampV2DialogBase | QgsCptCityColorRampDialogBase
|
QgsCurvePolygonV2 | QgsCurvePolygon
|
QgsCurveV2 | QgsCurve
|
QgsDbFilterProxyModel | QgsDatabaseFilterProxyModel
|
QgsDiagramRendererV2 | QgsDiagramRenderer
|
QgsDistanceArcProperter | QgsDistanceStrategy
|
QgsDoubleBoxBarStyle | QgsDoubleBoxScaleBarRenderer
|
QgsEditorWidgetV2 | QgsEditorWidget
|
QgsEllipseSymbolLayerV2 | QgsEllipseSymbolLayer
|
QgsEllipseSymbolLayerV2Widget | QgsEllipseSymbolLayerWidget
|
QgsFavouritesItem | QgsFavoritesItem
|
QgsFeatureRendererV2 | QgsFeatureRenderer
|
QgsFillSymbolLayerV2 | QgsFillSymbolLayer
|
QgsFillSymbolV2 | QgsFillSymbol
|
QgsFontMarkerSymbolLayerV2 | QgsFontMarkerSymbolLayer
|
QgsFontMarkerSymbolLayerV2Widget | QgsFontMarkerSymbolLayerWidget
|
QgsGeometryCollectionV2 | QgsGeometryCollection
|
QgsGeometryGeneratorSymbolLayerV2 | QgsGeometryGeneratorSymbolLayer
|
QgsGPSConnection | QgsGpsConnection
|
QgsGPSConnectionRegistry | QgsGpsConnectionRegistry
|
QgsGPSDetector | QgsGpsDetector
|
QgsGPSInformation | QgsGpsInformation
|
QgsGradientFillSymbolLayerV2 | QgsGradientFillSymbolLayer
|
QgsGradientFillSymbolLayerV2Widget | QgsGradientFillSymbolLayerWidget
|
QgsGraduatedSymbolRendererV2 | QgsGraduatedSymbolRenderer
|
QgsGraduatedSymbolRendererV2Model | QgsGraduatedSymbolRendererModel
|
QgsGraduatedSymbolRendererV2ViewStyle | QgsGraduatedSymbolRendererViewStyle
|
QgsGraduatedSymbolRendererV2Widget | QgsGraduatedSymbolRendererWidget
|
QgsGraphArc | QgsGraphEdge
|
QgsJSONExporter | QgsJsonExporter
|
QgsJSONUtils | QgsJsonUtils
|
QgsLabelingEngineV2 | QgsLabelingEngine
|
QgsLegendModelV2 | QgsLegendModel
|
QgsLegendSymbolItemV2 | QgsLegendSymbolItem
|
QgsLineStringV2 | QgsLineString
|
QgsLineSymbolLayerV2 | QgsLineSymbolLayer
|
QgsLineSymbolV2 | QgsLineSymbol
|
QgsMarkerLineSymbolLayerV2 | QgsMarkerLineSymbolLayer
|
QgsMarkerLineSymbolLayerV2Widget | QgsMarkerLineSymbolLayerWidget
|
QgsMarkerSymbolLayerV2 | QgsMarkerSymbolLayer
|
QgsMarkerSymbolV2 | QgsMarkerSymbol
|
QgsMultiCurveV2 | QgsMultiCurve
|
QgsMultiLineStringV2 | QgsMultiLineString
|
QgsMultiPoint | QgsMultiPointXY
|
QgsMultiPointV2 | QgsMultiPoint
|
QgsMultiPolygon | QgsPolygonXY
|
QgsMultiPolygonV2 | QgsPolygon
|
QgsMultiPolyline | QgsPolylineXY
|
QgsMultiPolylineV2 | QgsPolyline
|
QgsMultiSurfaceV2 | QgsMultiSurface
|
QgsNMEAConnection | QgsNmeaConnection
|
QgsNodeEditor | QgsVertexEditor
|
QgsNodeTool | QgsVertexTool
|
QgsNumericScaleBarStyle | QgsNumericScaleBarRenderer
|
QgsPoint | QgsPointXY
|
QgsPointSequenceV2 | QgsPointSequence
|
QgsPointV2 | QgsPoint
|
QgsPolygon | QgsPolygonXY
|
QgsPolygonV2 | QgsPolygon
|
QgsPolyline | QgsPolylineXY
|
QgsPolylineV2 | QgsPolyline
|
QgsProperty | QgsProjectProperty
|
QgsPropertyKey | QgsProjectPropertyKey
|
QgsPropertyValue | QgsProjectPropertyValue
|
QgsRandomColorsV2 | QgsRandomColorRamp
|
QgsRendererCategoryV2 | QgsRendererCategory
|
QgsRendererRangeV2 | QgsRendererRange
|
QgsRendererRangeV2LabelFomat | QgsRendererRangeLabelFomat
|
QgsRendererRangeV2LabelFormat | QgsRendererRangeLabelFormat
|
QgsRendererV2 | QgsRenderer
|
QgsRendererV2AbstractMetadata | QgsRendererAbstractMetadata
|
QgsRendererV2CreateFromSldFunc | QgsRendererCreateFromSldFunc
|
QgsRendererV2CreateFunc | QgsRendererCreateFunc
|
QgsRendererV2DataDefinedMenus | QgsRendererDataDefinedMenus
|
QgsRendererV2Metadata | QgsRendererMetadata
|
QgsRendererV2PropertiesDialog | QgsRendererPropertiesDialog
|
QgsRendererV2PropsDialogBase | QgsRendererPropsDialogBase
|
QgsRendererV2Registry | QgsRendererRegistry
|
QgsRendererV2Widget | QgsRendererWidget
|
QgsRendererV2WidgetFunc | QgsRendererWidgetFunc
|
QgsRingSequenceV2 | QgsRingSequence
|
QgsRuleBasedRendererV2 | QgsRuleBasedRenderer
|
QgsRuleBasedRendererV2Count | QgsRuleBasedRendererCount
|
QgsRuleBasedRendererV2Model | QgsRuleBasedRendererModel
|
QgsRuleBasedRendererV2Widget | QgsRuleBasedRendererWidget
|
QgsScaleBarStyle | QgsScaleBarRenderer
|
QgsShapeburstFillSymbolLayerV2 | QgsShapeburstFillSymbolLayer
|
QgsShapeburstFillSymbolLayerV2Widget | QgsShapeburstFillSymbolLayerWidget
|
QgsSimpleFillSymbolLayerV2 | QgsSimpleFillSymbolLayer
|
QgsSimpleFillSymbolLayerV2Widget | QgsSimpleFillSymbolLayerWidget
|
QgsSimpleLineSymbolLayerV2 | QgsSimpleLineSymbolLayer
|
QgsSimpleLineSymbolLayerV2Widget | QgsSimpleLineSymbolLayerWidget
|
QgsSimpleMarkerSymbolLayerV2 | QgsSimpleMarkerSymbolLayer
|
QgsSimpleMarkerSymbolLayerV2Widget | QgsSimpleMarkerSymbolLayerWidget
|
QgsSingleBoxScaleBarStyle | QgsSingleBoxScaleBarRenderer
|
QgsSingleSymbolRendererV2 | QgsSingleSymbolRenderer
|
QgsSingleSymbolRendererV2Widget | QgsSingleSymbolRendererWidget
|
QgsStyleV2 | QgsStyle
|
QgsStyleV2ExportImportDialog | QgsStyleExportImportDialog
|
QgsStyleV2ExportImportDialogBase | QgsStyleExportImportDialogBase
|
QgsStyleV2GroupSelectionDialog | QgsStyleGroupSelectionDialog
|
QgsStyleV2ManagerDialog | QgsStyleManagerDialog
|
QgsStyleV2ManagerDialogBase | QgsStyleManagerDialogBase
|
QgsSurfaceV2 | QgsSurface
|
QgsSvgMarkerSymbolLayerV2 | QgsSvgMarkerSymbolLayer
|
QgsSvgMarkerSymbolLayerV2Widget | QgsSvgMarkerSymbolLayerWidget
|
QgsSymbolLayerV2 | QgsSymbolLayer
|
QgsSymbolLayerV2AbstractMetadata | QgsSymbolLayerAbstractMetadata
|
QgsSymbolLayerV2Metadata | QgsSymbolLayerMetadata
|
QgsSymbolLayerV2Registry | QgsSymbolLayerRegistry
|
QgsSymbolLayerV2Utils | QgsSymbolLayerUtils
|
QgsSymbolLayerV2Widget | QgsSymbolLayerWidget
|
QgsSymbolLevelsV2Dialog | QgsSymbolLevelsDialog
|
QgsSymbolV2 | QgsSymbol
|
QgsSymbolV2LegendNode | QgsSymbolLegendNode
|
QgsSymbolV2LevelItem | QgsSymbolLevelItem
|
QgsSymbolV2RenderContext | QgsSymbolRenderContext
|
QgsSymbolV2SelectorDialog | QgsSymbolSelectorDialog
|
QgsSymbolV2SelectorWidget | QgsSymbolSelectorWidget
|
QgsTicksScaleBarStyle | QgsTicksScaleBarRenderer
|
QgsTINInterpolator | QgsTinInterpolator
|
QgsUserInputDockWidget | QgsUserInputWidget
|
QgsVectorColorBrewerColorRampV2 | QgsColorBrewerColorRamp
|
QgsVectorColorBrewerColorRampV2Dialog | QgsColorBrewerColorRampDialog
|
QgsVectorColorBrewerColorRampV2DialogBase | QgsColorBrewerColorRampDialogBase
|
QgsVectorColorRampV2 | QgsColorRamp
|
QgsVectorColorRampV2Map | QgsVectorColorRampMap
|
QgsVectorGradientColorRampV2 | QgsGradientColorRamp
|
QgsVectorGradientColorRampV2Dialog | QgsGradientColorRampDialog
|
QgsVectorGradientColorRampV2DialogBase | QgsGradientColorRampDialogBase
|
QgsVectorGradientRampV2 | QgsVectorGradientRamp
|
QgsVectorJoinInfo | QgsVectorLayerJoinInfo
|
QgsVectorLayerImport | QgsVectorLayerExporter
|
QgsVectorLayersetRendererV2 | QgsVectorLayersetRenderer
|
QgsVectorRandomColorRampV2 | QgsLimitedRandomColorRamp
|
QgsVectorRandomColorRampV2Dialog | QgsLimitedRandomColorRampDialog
|
QgsVectorRandomColorRampV2DialogBase | QgsLimitedRandomColorRampDialogBase
|
vertexData | QgsInterpolatorVertexData
|
Renamed Enum Values {#qgis_api_break_3_0_renamed_enum_values}
-------------------