Skip to content

Commit 8c340f7

Browse files
authoredJan 6, 2017
Make composition associated with QgsProject (#3957)
... rather than using project singleton within compositions
1 parent 062de6a commit 8c340f7

File tree

60 files changed

+188
-139
lines changed

Some content is hidden

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

60 files changed

+188
-139
lines changed
 

‎doc/api_break.dox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ QgsComposerTableV2 {#qgis_api_break_3_0_QgsComposerTableV2}
615615
QgsComposition {#qgis_api_break_3_0_QgsComposition}
616616
--------------
617617

618+
- constructor requires QgsProject instance as the second argument
618619
- addItemsFromXML() has been renamed to addItemsFromXml()
619620
- Constructor with QgsMapRenderer parameter has been removed. Use the variant with QgsMapSettings parameter.
620621
- mapRenderer() has been removed. Use mapSettings() instead.

‎python/core/composer/qgscomposition.sip

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QgsComposition : QGraphicsScene, QgsExpressionContextGenerator
4040
Landscape
4141
};
4242

43-
explicit QgsComposition( const QgsMapSettings& mapSettings );
43+
explicit QgsComposition( const QgsMapSettings& mapSettings, QgsProject* project );
4444

4545
/** Composition atlas modes*/
4646
enum AtlasMode
@@ -52,6 +52,14 @@ class QgsComposition : QGraphicsScene, QgsExpressionContextGenerator
5252

5353
~QgsComposition();
5454

55+
/**
56+
* The project associated with the composition. Used to get access to layers, map themes,
57+
* relations and various other bits. It is never null.
58+
*
59+
* \note Added in QGIS 3.0
60+
*/
61+
QgsProject* project() const;
62+
5563
/** Changes size of paper item.
5664
* @param width page width in mm
5765
* @param height page height in mm

0 commit comments

Comments
 (0)