Skip to content

Commit aac7e9a

Browse files
authored
Merge pull request #3485 from nyalldawson/composer_dep
Remove deprecated methods from composer
2 parents da8fc02 + 6cfe562 commit aac7e9a

File tree

77 files changed

+175
-7893
lines changed

Some content is hidden

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

77 files changed

+175
-7893
lines changed

doc/api_break.dox

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ This page tries to maintain a list with incompatible changes that happened in pr
181181
<li>QgsColorbutton was removed. QgsColorButtonV2 has now been renamed to QgsColorButton. Hence, QgsColorButtonV2 does not exist anymore.</li>
182182
<li>QgsColorDialog was removed, and QgsColorDialogV2 was renamed to QgsColorDialog. Hence, QgsColorButtonV2 does not exist anymore.
183183
All the functionality from the old QgsColorDialog has been moved to the new class.</li>
184+
<li>QgsComposerAttributeTable and associated classes (eg QgsComposerAttributeTableCompare,
185+
QgsComposerAttributeTableColumnModel, QgsComposerTableSortColumnsProxyModel) were removed.
186+
Use QgsComposerAttributeTableV2 instead.</li>
187+
<li>QgsComposerTable was removed. Use QgsComposerAttributeTableV2 instead.</li>
188+
<li>ComposerTextTable was removed. Use ComposerTextTableV2 instead.</li>
184189
<li>QgsCRSCache was removed. QgsCoordinateReferenceSystem now internally uses a cache for CRS creation,
185190
so there is no longer a need for the separate cache class. Code which previously called QgsCRSCache::updateCRSCache()
186191
should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinateTransformCache::instance()->invalidateCrs( authid ).</li>
@@ -290,6 +295,15 @@ variant instead.</li>
290295

291296
<ul>
292297
<li>readXMLMapSettings() has been renamed to readXmlMapSettings()</li>
298+
<li>composerMap() and setComposerMap() were removed. Use QgsComposerMap::atlasDriven() and setAtlasDriven()
299+
instead</li>
300+
<li>fixedScale() and setFixedScale() were removed. Use QgsComposerMap::atlasScalingMode() and setAtlasScalingMode()
301+
instead</li>
302+
<li>margin() and setMargin() were removed. Use QgsComposerMap::atlasMargin() and setAtlasMargin()
303+
instead</li>
304+
<li>setSortKeyAttributeIndex() and sortKeyAttributeIndex() were removed. Use sortKeyAttributeName()
305+
and setSortKeyAttributeName() instead.</li>
306+
<li>currentFeature() was removed. Use feature() instead.</li>
293307
</ul>
294308

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

340+
\subsection qgis_api_break_3_0_QgsComposerArrow QgsComposerArrow
341+
342+
<ul>
343+
<li>setOutlineWidth(), outlineWidth(), arrowColor() and setArrowColor() were removed.
344+
Use setArrowHeadOutlineWidth(), arrowHeadOutlineWidth(), arrowHeadOutlineColor(),
345+
setArrowHeadOutlineColor(), arrowHeadFillColor(), setArrowHeadFillColor(),
346+
setLineSymbol() or lineSymbol() instead.</li>
347+
</ul>
348+
349+
\subsection qgis_api_break_3_0_QgsComposerAttributeTableV2 QgsComposerAttributeTableV2
350+
351+
<ul>
352+
<li>setDisplayAttributes() was removed. Use setDisplayedFields() instead.</li>
353+
</ul>
354+
355+
\subsection qgis_api_break_3_0_QgsComposerItem QgsComposerItem
356+
357+
<ul>
358+
<li>zoomContent( int delta, double x, double y ) was removed. Use zoomContent( double, QPointF, ZoomMode )
359+
instead.</li>
360+
<li>drawText(), textWidthMillimeters(), fontHeightCharacterMM(), fontAscentMillimeters(),
361+
fontDescentMillimeters(), fontHeightMillimeters(), pixelFontSize(), scaledFontPixelSize(),
362+
drawArrowHead(), angle(), largestRotatedRectWithinBounds(), and rotate() were removed.
363+
Use the corresponding methods in QgsComposerUtils instead.</li>
364+
<li>rotation() and setRotation() were removed. Use itemRotation() and setItemRotation()
365+
instead.</li>
366+
<li>lockSymbolSize(), imageSizeConsideringRotation(), cornerPointOnRotatedAndScaledRect(),
367+
sizeChangedByRotation() were removed. No replacement is offered for these methods.</li>
368+
</ul>
369+
326370
\subsection qgis_api_break_3_0_QgsComposerLabel QgsComposerLabel
327371

328372
<ul>
329373
<li>setExpressionContext() has been removed. Setup the composition using an atlas and with
330374
expression variables in the composer label item instead.</li>
331375
<li>setSubstitutions has been removed. Use expression context variables in the composer
332376
label item instead.</li>
377+
<li>margin() was removed. Use marginX() and marginY() instead.</li>
333378
</ul>
334379

335380
\subsection qgis_api_break_3_0_QgsComposerLegend QgsComposerLegend
@@ -350,6 +395,34 @@ label item instead.</li>
350395
<ul>
351396
<li>containsWMSLayer() has been renamed to containsWmsLayer()</li>
352397
<li>mapRenderer() has been removed. Use mapSettings() instead.</li>
398+
<li>All grid style and format enums were moved to QgsComposerMapGrid.</li>
399+
<li>All grid property getters and setters were moved to QgsComposerMapGrid,
400+
and should be accessed using QgsComposerMap::grid() or QgsComposerMap::grids().</li>
401+
<li>All overview property getters and setters were moved to QgsComposerMapOverview,
402+
and should be accessed using QgsComposerMap::overview() or QgsComposerMap::overviews().</li>
403+
<li>overviewExtentChanged() was moved to QgsComposerMapOverview.</li>
404+
<li>toggleAtlasPreview(), connectMapOverviewSignals() were no longer required and are removed.</li>
405+
<li>setRotation() and rotation() were removed. Use setMapRotation() and mapRotation()
406+
instead.</li>
407+
<li>atlasFixedScale() and setAtlasFixedScale() were removed. Use atlasScalingMode()
408+
and setAtlasScalingMode() instead.</li>
409+
</ul>
410+
411+
\subsection qgis_api_break_3_0_QgsComposerMapGrid QgsComposerMapGrid
412+
413+
<ul>
414+
<li>The annotation position Disabled was removed. QgsComposerMapGrid::HideAll
415+
should be used instead.</li>
416+
</ul>
417+
418+
\subsection qgis_api_break_3_0_QgsComposerMultiFrame QgsComposerMultiFrame
419+
420+
<ul>
421+
<li>render( QPainter* p, const QRectF& renderExtent ) was removed. Use
422+
render( QPainter* painter, const QRectF& renderExtent, const int frameIndex )
423+
instead.</li>
424+
<li>render( QPainter* painter, const QRectF& renderExtent, const int frameIndex )
425+
was made pure virtual.</li>
353426
</ul>
354427

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

435+
\subsection qgis_api_break_3_0_QgsComposerPicture QgsComposerPicture
436+
437+
<ul>
438+
<li>setPictureFile() and pictureFile() were removed. Use setPicturePath()
439+
and picturePath() instead.</li>
440+
<li>rotation() and setRotation() were removed. Use pictureRotation()
441+
and setPictureRotation() instead.</li>
442+
<li>usePictureExpression() and pictureExpression() were removed. Use
443+
QgsComposerObject::dataDefinedProperty instead.</li>
444+
<li>setUsePictureExpression() was removed. Use
445+
QgsComposerObject::setDataDefinedProperty() instead.</li>
446+
<li>updatePictureExpression() was removed.</li>
447+
</ul>
448+
362449
\subsection qgis_api_break_3_0_QgsComposerTable QgsComposerTable
363450

364451
<ul>
365452
<li>tableWriteXML() has been renamed to tableWriteXml()</li>
366453
<li>tableReadXML() has been renamed to tableReadXml()</li>
367454
</ul>
368455

456+
\subsection qgis_api_break_3_0_QgsComposerTableV2 QgsComposerTableV2
457+
458+
<ul>
459+
<li>rowsVisible(), rowRange(), drawHorizontalGridLines() and
460+
drawVerticalGridLines() were removed.</li>
461+
</ul>
369462

370463
\subsection qgis_api_break_3_0_QgsComposition QgsComposition
371464

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

378477
\subsection qgis_api_break_3_0_QgsCoordinateReferenceSystem QgsCoordinateReferenceSystem

doc/qgis3_user_changes.dox

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ be updated so that any expressions in use have the following changes:
2121
<li>$numfeatures has been replaced by \@atlas_totalfeatures</li>
2222
</ul>
2323

24+
\section qgis3_user_changes_composer Composer
25+
26+
Very old projects containing composer attribute tables will not restore the attribute
27+
tables when loaded into QGIS 3.0. These tables must be manually readded to the compositions.
28+
2429
*/

python/core/composer/qgsatlascomposition.sip

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -223,49 +223,6 @@ public:
223223
/** Recalculates the bounds of an atlas driven map */
224224
void prepareMap( QgsComposerMap* map );
225225

226-
227-
//deprecated methods
228-
229-
/** Returns the map used by the atlas
230-
* @deprecated Use QgsComposerMap::atlasDriven() instead
231-
*/
232-
QgsComposerMap* composerMap() const /Deprecated/;
233-
234-
/** Sets the map used by the atlas
235-
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
236-
*/
237-
void setComposerMap( QgsComposerMap* map ) /Deprecated/;
238-
239-
/** Returns whether the atlas map uses a fixed scale
240-
* @deprecated since 2.4 Use QgsComposerMap::atlasScalingMode() instead
241-
*/
242-
bool fixedScale() const /Deprecated/;
243-
244-
/** Sets whether the atlas map should use a fixed scale
245-
* @deprecated since 2.4 Use QgsComposerMap::setAtlasScalingMode() instead
246-
*/
247-
void setFixedScale( bool fixed ) /Deprecated/;
248-
249-
/** Returns the margin for the atlas map
250-
* @deprecated Use QgsComposerMap::atlasMargin() instead
251-
*/
252-
float margin() const /Deprecated/;
253-
254-
/** Sets the margin for the atlas map
255-
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
256-
*/
257-
void setMargin( float margin ) /Deprecated/;
258-
259-
//! @deprecated use sortKeyAttributeName instead
260-
int sortKeyAttributeIndex() const /Deprecated/;
261-
//! @deprecated use setSortKeyAttributeName instead
262-
void setSortKeyAttributeIndex( int idx ) /Deprecated/;
263-
264-
/** Returns the current atlas feature. Must be called after prepareForFeature( i ).
265-
* @deprecated use feature() instead
266-
*/
267-
QgsFeature* currentFeature() /Deprecated/;
268-
269226
/** Returns the current atlas geometry in the given projection system (default to the coverage layer's CRS) */
270227
QgsGeometry currentGeometry( const QgsCoordinateReferenceSystem& projectedTo = QgsCoordinateReferenceSystem() ) const;
271228

python/core/composer/qgscomposerarrow.sip

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,6 @@ class QgsComposerArrow: QgsComposerItem
4848
*/
4949
double arrowHeadWidth() const;
5050

51-
/** Sets the pen width for drawing the line and arrow head
52-
* @deprecated use setArrowHeadOutlineWidth or setLineSymbol instead
53-
*/
54-
void setOutlineWidth( double width ) /Deprecated/;
55-
56-
/** Returns the pen width for drawing the line and arrow head
57-
* @deprecated use arrowHeadOutlineWidth or lineSymbol instead
58-
*/
59-
double outlineWidth() const /Deprecated/;
60-
6151
/** Sets the marker to draw at the start of the line
6252
* @param svgPath file path for svg marker graphic to draw
6353
* @see startMarker
@@ -86,16 +76,6 @@ class QgsComposerArrow: QgsComposerItem
8676
*/
8777
QString endMarker() const;
8878

89-
/** Returns the color for the line and arrow head
90-
* @deprecated use arrowHeadOutlineColor, arrowHeadFillColor or lineStyle instead
91-
*/
92-
QColor arrowColor() const /Deprecated/;
93-
94-
/** Sets the color for the line and arrow head
95-
* @deprecated use setArrowHeadOutlineColor, setArrowHeadFillColor or setLineStyle instead
96-
*/
97-
void setArrowColor( const QColor& c ) /Deprecated/;
98-
9979
/** Returns the color used to draw outline around the the arrow head.
10080
* @returns arrow head outline color
10181
* @see arrowHeadFillColor

0 commit comments

Comments
 (0)