Skip to content

Commit

Permalink
Merge pull request #3485 from nyalldawson/composer_dep
Browse files Browse the repository at this point in the history
Remove deprecated methods from composer
  • Loading branch information
nyalldawson committed Sep 14, 2016
2 parents da8fc02 + 6cfe562 commit aac7e9a
Show file tree
Hide file tree
Showing 77 changed files with 175 additions and 7,893 deletions.
99 changes: 99 additions & 0 deletions doc/api_break.dox
Expand Up @@ -181,6 +181,11 @@ This page tries to maintain a list with incompatible changes that happened in pr
<li>QgsColorbutton was removed. QgsColorButtonV2 has now been renamed to QgsColorButton. Hence, QgsColorButtonV2 does not exist anymore.</li>
<li>QgsColorDialog was removed, and QgsColorDialogV2 was renamed to QgsColorDialog. Hence, QgsColorButtonV2 does not exist anymore.
All the functionality from the old QgsColorDialog has been moved to the new class.</li>
<li>QgsComposerAttributeTable and associated classes (eg QgsComposerAttributeTableCompare,
QgsComposerAttributeTableColumnModel, QgsComposerTableSortColumnsProxyModel) were removed.
Use QgsComposerAttributeTableV2 instead.</li>
<li>QgsComposerTable was removed. Use QgsComposerAttributeTableV2 instead.</li>
<li>ComposerTextTable was removed. Use ComposerTextTableV2 instead.</li>
<li>QgsCRSCache was removed. QgsCoordinateReferenceSystem now internally uses a cache for CRS creation,
so there is no longer a need for the separate cache class. Code which previously called QgsCRSCache::updateCRSCache()
should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinateTransformCache::instance()->invalidateCrs( authid ).</li>
Expand Down Expand Up @@ -290,6 +295,15 @@ variant instead.</li>

<ul>
<li>readXMLMapSettings() has been renamed to readXmlMapSettings()</li>
<li>composerMap() and setComposerMap() were removed. Use QgsComposerMap::atlasDriven() and setAtlasDriven()
instead</li>
<li>fixedScale() and setFixedScale() were removed. Use QgsComposerMap::atlasScalingMode() and setAtlasScalingMode()
instead</li>
<li>margin() and setMargin() were removed. Use QgsComposerMap::atlasMargin() and setAtlasMargin()
instead</li>
<li>setSortKeyAttributeIndex() and sortKeyAttributeIndex() were removed. Use sortKeyAttributeName()
and setSortKeyAttributeName() instead.</li>
<li>currentFeature() was removed. Use feature() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsAuthConfigUriEdit QgsAuthConfigUriEdit
Expand Down Expand Up @@ -323,13 +337,44 @@ and the new ramp can be retrieved after executing the dialog by calling ramp().<
<li>Some internal methods which were previously public or protected were made private.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerArrow QgsComposerArrow

<ul>
<li>setOutlineWidth(), outlineWidth(), arrowColor() and setArrowColor() were removed.
Use setArrowHeadOutlineWidth(), arrowHeadOutlineWidth(), arrowHeadOutlineColor(),
setArrowHeadOutlineColor(), arrowHeadFillColor(), setArrowHeadFillColor(),
setLineSymbol() or lineSymbol() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerAttributeTableV2 QgsComposerAttributeTableV2

<ul>
<li>setDisplayAttributes() was removed. Use setDisplayedFields() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerItem QgsComposerItem

<ul>
<li>zoomContent( int delta, double x, double y ) was removed. Use zoomContent( double, QPointF, ZoomMode )
instead.</li>
<li>drawText(), textWidthMillimeters(), fontHeightCharacterMM(), fontAscentMillimeters(),
fontDescentMillimeters(), fontHeightMillimeters(), pixelFontSize(), scaledFontPixelSize(),
drawArrowHead(), angle(), largestRotatedRectWithinBounds(), and rotate() were removed.
Use the corresponding methods in QgsComposerUtils instead.</li>
<li>rotation() and setRotation() were removed. Use itemRotation() and setItemRotation()
instead.</li>
<li>lockSymbolSize(), imageSizeConsideringRotation(), cornerPointOnRotatedAndScaledRect(),
sizeChangedByRotation() were removed. No replacement is offered for these methods.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerLabel QgsComposerLabel

<ul>
<li>setExpressionContext() has been removed. Setup the composition using an atlas and with
expression variables in the composer label item instead.</li>
<li>setSubstitutions has been removed. Use expression context variables in the composer
label item instead.</li>
<li>margin() was removed. Use marginX() and marginY() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerLegend QgsComposerLegend
Expand All @@ -350,6 +395,34 @@ label item instead.</li>
<ul>
<li>containsWMSLayer() has been renamed to containsWmsLayer()</li>
<li>mapRenderer() has been removed. Use mapSettings() instead.</li>
<li>All grid style and format enums were moved to QgsComposerMapGrid.</li>
<li>All grid property getters and setters were moved to QgsComposerMapGrid,
and should be accessed using QgsComposerMap::grid() or QgsComposerMap::grids().</li>
<li>All overview property getters and setters were moved to QgsComposerMapOverview,
and should be accessed using QgsComposerMap::overview() or QgsComposerMap::overviews().</li>
<li>overviewExtentChanged() was moved to QgsComposerMapOverview.</li>
<li>toggleAtlasPreview(), connectMapOverviewSignals() were no longer required and are removed.</li>
<li>setRotation() and rotation() were removed. Use setMapRotation() and mapRotation()
instead.</li>
<li>atlasFixedScale() and setAtlasFixedScale() were removed. Use atlasScalingMode()
and setAtlasScalingMode() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerMapGrid QgsComposerMapGrid

<ul>
<li>The annotation position Disabled was removed. QgsComposerMapGrid::HideAll
should be used instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerMultiFrame QgsComposerMultiFrame

<ul>
<li>render( QPainter* p, const QRectF& renderExtent ) was removed. Use
render( QPainter* painter, const QRectF& renderExtent, const int frameIndex )
instead.</li>
<li>render( QPainter* painter, const QRectF& renderExtent, const int frameIndex )
was made pure virtual.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerNodesItem QgsComposerNodesItem
Expand All @@ -359,20 +432,46 @@ label item instead.</li>
<li>_writeXMLStyle() has been renamed to _writeXMLStyle()</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerPicture QgsComposerPicture

<ul>
<li>setPictureFile() and pictureFile() were removed. Use setPicturePath()
and picturePath() instead.</li>
<li>rotation() and setRotation() were removed. Use pictureRotation()
and setPictureRotation() instead.</li>
<li>usePictureExpression() and pictureExpression() were removed. Use
QgsComposerObject::dataDefinedProperty instead.</li>
<li>setUsePictureExpression() was removed. Use
QgsComposerObject::setDataDefinedProperty() instead.</li>
<li>updatePictureExpression() was removed.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerTable QgsComposerTable

<ul>
<li>tableWriteXML() has been renamed to tableWriteXml()</li>
<li>tableReadXML() has been renamed to tableReadXml()</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerTableV2 QgsComposerTableV2

<ul>
<li>rowsVisible(), rowRange(), drawHorizontalGridLines() and
drawVerticalGridLines() were removed.</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposition QgsComposition

<ul>
<li>addItemsFromXML() has been renamed to addItemsFromXml()</li>
<li>Constructor with QgsMapRenderer parameter has been removed. Use the variant with QgsMapSettings parameter.</li>
<li>mapRenderer() has been removed. Use mapSettings() instead.</li>
<li>setSnapGridTolerance(), setAlignmentSnapTolerance(), alignmentSnapTolerance() and snapGridTolerance()
were removed. Use setSnapTolerance() and snapTolerance() instead.</li>
<li>getComposerHtmlByItem() was removed. Use QgsComposerFrame::multiFrame() instead.</li>
<li>pixelFontSize(), pointFontSize(), relativeResizeRect(), relativePosition() were removed. Use the corresponding methods in QgsComposerUtils instead.</li>
<li>sortZList() was removed. Use refreshZList() instead.</li>
<li>addComposerTable(), composerTableAdded() were removed.</li>
</ul>

\subsection qgis_api_break_3_0_QgsCoordinateReferenceSystem QgsCoordinateReferenceSystem
Expand Down
5 changes: 5 additions & 0 deletions doc/qgis3_user_changes.dox
Expand Up @@ -21,4 +21,9 @@ be updated so that any expressions in use have the following changes:
<li>$numfeatures has been replaced by \@atlas_totalfeatures</li>
</ul>

\section qgis3_user_changes_composer Composer

Very old projects containing composer attribute tables will not restore the attribute
tables when loaded into QGIS 3.0. These tables must be manually readded to the compositions.

*/
43 changes: 0 additions & 43 deletions python/core/composer/qgsatlascomposition.sip
Expand Up @@ -223,49 +223,6 @@ public:
/** Recalculates the bounds of an atlas driven map */
void prepareMap( QgsComposerMap* map );


//deprecated methods

/** Returns the map used by the atlas
* @deprecated Use QgsComposerMap::atlasDriven() instead
*/
QgsComposerMap* composerMap() const /Deprecated/;

/** Sets the map used by the atlas
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
*/
void setComposerMap( QgsComposerMap* map ) /Deprecated/;

/** Returns whether the atlas map uses a fixed scale
* @deprecated since 2.4 Use QgsComposerMap::atlasScalingMode() instead
*/
bool fixedScale() const /Deprecated/;

/** Sets whether the atlas map should use a fixed scale
* @deprecated since 2.4 Use QgsComposerMap::setAtlasScalingMode() instead
*/
void setFixedScale( bool fixed ) /Deprecated/;

/** Returns the margin for the atlas map
* @deprecated Use QgsComposerMap::atlasMargin() instead
*/
float margin() const /Deprecated/;

/** Sets the margin for the atlas map
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
*/
void setMargin( float margin ) /Deprecated/;

//! @deprecated use sortKeyAttributeName instead
int sortKeyAttributeIndex() const /Deprecated/;
//! @deprecated use setSortKeyAttributeName instead
void setSortKeyAttributeIndex( int idx ) /Deprecated/;

/** Returns the current atlas feature. Must be called after prepareForFeature( i ).
* @deprecated use feature() instead
*/
QgsFeature* currentFeature() /Deprecated/;

/** Returns the current atlas geometry in the given projection system (default to the coverage layer's CRS) */
QgsGeometry currentGeometry( const QgsCoordinateReferenceSystem& projectedTo = QgsCoordinateReferenceSystem() ) const;

Expand Down
20 changes: 0 additions & 20 deletions python/core/composer/qgscomposerarrow.sip
Expand Up @@ -48,16 +48,6 @@ class QgsComposerArrow: QgsComposerItem
*/
double arrowHeadWidth() const;

/** Sets the pen width for drawing the line and arrow head
* @deprecated use setArrowHeadOutlineWidth or setLineSymbol instead
*/
void setOutlineWidth( double width ) /Deprecated/;

/** Returns the pen width for drawing the line and arrow head
* @deprecated use arrowHeadOutlineWidth or lineSymbol instead
*/
double outlineWidth() const /Deprecated/;

/** Sets the marker to draw at the start of the line
* @param svgPath file path for svg marker graphic to draw
* @see startMarker
Expand Down Expand Up @@ -86,16 +76,6 @@ class QgsComposerArrow: QgsComposerItem
*/
QString endMarker() const;

/** Returns the color for the line and arrow head
* @deprecated use arrowHeadOutlineColor, arrowHeadFillColor or lineStyle instead
*/
QColor arrowColor() const /Deprecated/;

/** Sets the color for the line and arrow head
* @deprecated use setArrowHeadOutlineColor, setArrowHeadFillColor or setLineStyle instead
*/
void setArrowColor( const QColor& c ) /Deprecated/;

/** Returns the color used to draw outline around the the arrow head.
* @returns arrow head outline color
* @see arrowHeadFillColor
Expand Down

0 comments on commit aac7e9a

Please sign in to comment.