Skip to content
Permalink
Browse files

Merge pull request #5966 from nyalldawson/layout_next

[layouts] Atlas and reporting framework
  • Loading branch information
nyalldawson committed Jan 5, 2018
2 parents 63cc124 + bf6c95d commit 421ef88de0aea758a4fc901d3b3dc4e0c95579fa
Showing with 14,274 additions and 1,265 deletions.
  1. +1 −0 images/images.qrc
  2. +192 −0 images/themes/default/mActionExport.svg
  3. +8 −8 python/core/composer/qgslayoutmanager.sip
  4. +10 −1 python/core/core_auto.sip
  5. +71 −0 python/core/layout/qgsabstractlayoutiterator.sip
  6. +394 −0 python/core/layout/qgsabstractreportsection.sip
  7. +29 −26 python/core/layout/qgslayout.sip
  8. +409 −0 python/core/layout/qgslayoutatlas.sip
  9. +113 −3 python/core/layout/qgslayoutexporter.sip
  10. +3 −0 python/core/layout/qgslayoutitem.sip
  11. +1 −0 python/core/layout/qgslayoutitemhtml.sip
  12. +2 −0 python/core/layout/qgslayoutitemlegend.sip
  13. +3 −1 python/core/layout/qgslayoutitemmap.sip
  14. +0 −5 python/core/layout/qgslayoutitemregistry.sip
  15. +1 −0 python/core/layout/qgslayoutpagecollection.sip
  16. +20 −43 python/core/layout/{qgslayoutcontext.sip → qgslayoutrendercontext.sip}
  17. +117 −0 python/core/layout/qgslayoutreportcontext.sip
  18. +92 −0 python/core/layout/qgsmasterlayoutinterface.sip
  19. +76 −0 python/core/layout/qgsprintlayout.sip
  20. +76 −0 python/core/layout/qgsreport.sip
  21. +163 −0 python/core/layout/qgsreportsectionfieldgroup.sip
  22. +109 −0 python/core/layout/qgsreportsectionlayout.sip
  23. +17 −1 python/core/qgsexpressioncontext.sip
  24. +7 −1 python/gui/layout/qgslayoutdesignerinterface.sip
  25. +16 −1 python/gui/layout/qgslayoutitemwidget.sip
  26. +0 −1 python/gui/layout/qgslayoutview.sip
  27. +1 −1 python/gui/qgisinterface.sip
  28. +12 −0 src/app/CMakeLists.txt
  29. +1 −1 src/app/layout/qgslayoutaddpagesdialog.cpp
  30. +373 −0 src/app/layout/qgslayoutatlaswidget.cpp
  31. +59 −0 src/app/layout/qgslayoutatlaswidget.h
  32. +19 −21 src/app/layout/qgslayoutattributetablewidget.cpp
  33. +2 −0 src/app/layout/qgslayoutattributetablewidget.h
  34. +2,193 −228 src/app/layout/qgslayoutdesignerdialog.cpp
  35. +102 −0 src/app/layout/qgslayoutdesignerdialog.h
  36. +2 −5 src/app/layout/qgslayouthtmlwidget.cpp
  37. +2 −5 src/app/layout/qgslayoutlabelwidget.cpp
  38. +17 −14 src/app/layout/qgslayoutlegendwidget.cpp
  39. +1 −0 src/app/layout/qgslayoutlegendwidget.h
  40. +82 −25 src/app/layout/qgslayoutmanagerdialog.cpp
  41. +17 −3 src/app/layout/qgslayoutmanagerdialog.h
  42. +11 −0 src/app/layout/qgslayoutmapgridwidget.cpp
  43. +36 −50 src/app/layout/qgslayoutmapwidget.cpp
  44. +2 −0 src/app/layout/qgslayoutmapwidget.h
  45. +10 −1 src/app/layout/qgslayoutpagepropertieswidget.cpp
  46. +6 −0 src/app/layout/qgslayoutpagepropertieswidget.h
  47. +7 −3 src/app/layout/qgslayoutpolygonwidget.cpp
  48. +6 −3 src/app/layout/qgslayoutpolylinewidget.cpp
  49. +3 −3 src/app/layout/qgslayoutpropertieswidget.cpp
  50. +6 −4 src/app/layout/qgslayoutshapewidget.cpp
  51. +141 −0 src/app/layout/qgsreportfieldgroupsectionwidget.cpp
  52. +52 −0 src/app/layout/qgsreportfieldgroupsectionwidget.h
  53. +105 −0 src/app/layout/qgsreportlayoutsectionwidget.cpp
  54. +49 −0 src/app/layout/qgsreportlayoutsectionwidget.h
  55. +147 −0 src/app/layout/qgsreportorganizerwidget.cpp
  56. +58 −0 src/app/layout/qgsreportorganizerwidget.h
  57. +294 −0 src/app/layout/qgsreportsectionmodel.cpp
  58. +69 −0 src/app/layout/qgsreportsectionmodel.h
  59. +84 −0 src/app/layout/qgsreportsectionwidget.cpp
  60. +47 −0 src/app/layout/qgsreportsectionwidget.h
  61. +86 −48 src/app/qgisapp.cpp
  62. +12 −6 src/app/qgisapp.h
  63. +1 −1 src/app/qgisappinterface.cpp
  64. +1 −1 src/app/qgisappinterface.h
  65. +2 −2 src/app/qgsdiagramproperties.cpp
  66. +1 −1 src/app/qgslabelinggui.cpp
  67. +1 −1 src/app/qgslabelpropertydialog.cpp
  68. +1 −1 src/app/qgspointmarkeritem.cpp
  69. +1 −1 src/app/qgsrulebasedlabelingwidget.cpp
  70. +1 −1 src/app/qgsvectorlayerproperties.cpp
  71. +18 −2 src/core/CMakeLists.txt
  72. +1 −1 src/core/composer/qgsatlascomposition.cpp
  73. +1 −1 src/core/composer/qgscomposition.cpp
  74. +68 −31 src/core/composer/qgslayoutmanager.cpp
  75. +10 −10 src/core/composer/qgslayoutmanager.h
  76. +75 −0 src/core/layout/qgsabstractlayoutiterator.h
  77. +419 −0 src/core/layout/qgsabstractreportsection.cpp
  78. +368 −0 src/core/layout/qgsabstractreportsection.h
  79. +63 −22 src/core/layout/qgslayout.cpp
  80. +40 −31 src/core/layout/qgslayout.h
  81. +544 −0 src/core/layout/qgslayoutatlas.cpp
  82. +398 −0 src/core/layout/qgslayoutatlas.h
  83. +391 −48 src/core/layout/qgslayoutexporter.cpp
  84. +121 −10 src/core/layout/qgslayoutexporter.h
  85. +17 −10 src/core/layout/qgslayoutitem.cpp
  86. +2 −0 src/core/layout/qgslayoutitem.h
  87. +8 −44 src/core/layout/qgslayoutitemattributetable.cpp
  88. +50 −36 src/core/layout/qgslayoutitemhtml.cpp
  89. +18 −0 src/core/layout/qgslayoutitemhtml.h
  90. +7 −24 src/core/layout/qgslayoutitemlabel.cpp
  91. +12 −9 src/core/layout/qgslayoutitemlegend.cpp
  92. +2 −1 src/core/layout/qgslayoutitemlegend.h
  93. +167 −33 src/core/layout/qgslayoutitemmap.cpp
  94. +6 −9 src/core/layout/qgslayoutitemmap.h
  95. +1 −1 src/core/layout/qgslayoutitemnodeitem.cpp
  96. +5 −5 src/core/layout/qgslayoutitempage.cpp
  97. +12 −13 src/core/layout/qgslayoutitempicture.cpp
  98. +2 −2 src/core/layout/qgslayoutitempolygon.cpp
  99. +2 −2 src/core/layout/qgslayoutitempolyline.cpp
  100. +15 −15 src/core/layout/qgslayoutitemregistry.cpp
  101. +2 −13 src/core/layout/qgslayoutitemregistry.h
  102. +1 −1 src/core/layout/qgslayoutitemscalebar.cpp
  103. +2 −11 src/core/layout/qgslayoutitemshape.cpp
  104. +3 −0 src/core/layout/qgslayoutobject.cpp
  105. +5 −0 src/core/layout/qgslayoutpagecollection.cpp
  106. +10 −0 src/core/layout/qgslayoutpagecollection.h
  107. +22 −26 src/core/layout/{qgslayoutcontext.cpp → qgslayoutrendercontext.cpp}
  108. +26 −49 src/core/layout/{qgslayoutcontext.h → qgslayoutrendercontext.h}
  109. +82 −0 src/core/layout/qgslayoutreportcontext.cpp
  110. +135 −0 src/core/layout/qgslayoutreportcontext.h
  111. +1 −1 src/core/layout/qgslayouttable.cpp
  112. +2 −2 src/core/layout/qgslayoututils.cpp
  113. +95 −0 src/core/layout/qgsmasterlayoutinterface.h
  114. +113 −0 src/core/layout/qgsprintlayout.cpp
  115. +78 −0 src/core/layout/qgsprintlayout.h
  116. +69 −0 src/core/layout/qgsreport.cpp
  117. +83 −0 src/core/layout/qgsreport.h
  118. +267 −0 src/core/layout/qgsreportsectionfieldgroup.cpp
  119. +161 −0 src/core/layout/qgsreportsectionfieldgroup.h
  120. +96 −0 src/core/layout/qgsreportsectionlayout.cpp
  121. +99 −0 src/core/layout/qgsreportsectionlayout.h
  122. +2 −2 src/core/qgsapplication.cpp
  123. +153 −11 src/core/qgsexpressioncontext.cpp
  124. +17 −1 src/core/qgsexpressioncontext.h
  125. +7 −1 src/gui/layout/qgslayoutdesignerinterface.h
  126. +28 −28 src/gui/layout/qgslayoutitemwidget.cpp
  127. +12 −9 src/gui/layout/qgslayoutitemwidget.h
  128. +3 −3 src/gui/layout/qgslayoutmousehandles.cpp
  129. +2 −2 src/gui/layout/qgslayoutnewitempropertiesdialog.cpp
  130. +3 −0 src/gui/layout/qgslayoutruler.cpp
  131. +85 −0 src/gui/layout/qgslayoutview.cpp
  132. +1 −1 src/gui/layout/qgslayoutview.h
  133. +2 −1 src/gui/qgisinterface.h
  134. +0 −3 src/gui/qgsdockwidget.cpp
  135. +1 −0 src/gui/qgsmapcanvas.cpp
  136. +2 −2 src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
  137. +1 −1 src/gui/symbology/qgsdatadefinedsizelegendwidget.cpp
  138. +1 −1 src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp
  139. +1 −1 src/gui/symbology/qgsheatmaprendererwidget.cpp
  140. +1 −1 src/gui/symbology/qgslayerpropertieswidget.cpp
  141. +1 −1 src/gui/symbology/qgsrendererwidget.cpp
  142. +1 −1 src/gui/symbology/qgssymbolwidgetcontext.cpp
  143. +398 −0 src/ui/layout/qgslayoutatlaswidgetbase.ui
  144. +7 −7 src/ui/layout/qgslayoutattributetablewidgetbase.ui
  145. +278 −4 src/ui/layout/qgslayoutdesignerbase.ui
  146. +163 −0 src/ui/layout/qgsreportorganizerwidgetbase.ui
  147. +132 −0 src/ui/layout/qgsreportwidgetfieldgroupsectionbase.ui
  148. +93 −0 src/ui/layout/qgsreportwidgetlayoutsectionbase.ui
  149. +79 −0 src/ui/layout/qgsreportwidgetsectionbase.ui
  150. +1 −0 tests/src/app/CMakeLists.txt
  151. +1 −0 tests/src/core/CMakeLists.txt
  152. +69 −6 tests/src/core/testqgslayout.cpp
  153. +428 −0 tests/src/core/testqgslayoutatlas.cpp
  154. +89 −23 tests/src/core/testqgslayoutcontext.cpp
  155. +8 −12 tests/src/core/testqgslayouthtml.cpp
  156. +56 −20 tests/src/core/testqgslayoutitem.cpp
  157. +56 −27 tests/src/core/testqgslayoutlabel.cpp
  158. +33 −10 tests/src/core/testqgslayoutmap.cpp
  159. +1 −1 tests/src/core/testqgslayoutmultiframe.cpp
  160. +2 −1 tests/src/core/testqgslayoutobject.cpp
  161. +1 −1 tests/src/core/testqgslayoutpage.cpp
  162. +38 −43 tests/src/core/testqgslayouttable.cpp
  163. +6 −6 tests/src/core/testqgslayoututils.cpp
  164. +1 −1 tests/src/gui/testqgslayoutview.cpp
  165. +2 −0 tests/src/python/CMakeLists.txt
  166. +3 −2 tests/src/python/test_qgslayout.py
  167. +617 −0 tests/src/python/test_qgslayoutatlas.py
  168. +293 −3 tests/src/python/test_qgslayoutexporter.py
  169. +24 −21 tests/src/python/test_qgslayoutlabel.py
  170. +34 −23 tests/src/python/test_qgslayoutmanager.py
  171. +789 −0 tests/src/python/test_qgsreport.py
  172. BIN tests/testdata/control_images/atlas/expected_atlas_autoscale1/expected_atlas_autoscale1_mask.png
  173. BIN tests/testdata/control_images/atlas/expected_atlas_autoscale2/expected_atlas_autoscale2_mask.png
  174. BIN tests/testdata/control_images/atlas/expected_atlas_filtering1/expected_atlas_filtering1_mask.png
  175. BIN tests/testdata/control_images/atlas/expected_atlas_fixedscale1/expected_atlas_fixedscale1_mask.png
  176. BIN tests/testdata/control_images/atlas/expected_atlas_fixedscale2/expected_atlas_fixedscale2_mask.png
  177. BIN tests/testdata/control_images/atlas/expected_atlas_hiding1/expected_atlas_hiding1_mask.png
  178. BIN tests/testdata/control_images/atlas/expected_atlas_hiding2/expected_atlas_hiding2_mask.png
  179. BIN ...a/control_images/atlas/expected_atlas_predefinedscales1/expected_atlas_predefinedscales1_mask.png
  180. BIN ...a/control_images/atlas/expected_atlas_predefinedscales2/expected_atlas_predefinedscales2_mask.png
  181. BIN tests/testdata/control_images/atlas/expected_atlas_sorting1/expected_atlas_sorting1_mask.png
  182. BIN tests/testdata/control_images/atlas/expected_atlas_sorting2/expected_atlas_sorting2_mask.png
  183. BIN tests/testdata/control_images/atlas/expected_atlas_two_maps1/expected_atlas_two_maps1_mask.png
  184. BIN tests/testdata/control_images/atlas/expected_atlas_two_maps2/expected_atlas_two_maps2_mask.png
  185. BIN ...s/composer_html/expected_composerhtml_setfeature/travis/expected_composerhtml_setfeature_mask.png
  186. BIN ...ut_exporter/expected_layoutexporter_iteratortoimage1/expected_layoutexporter_iteratortoimage1.png
  187. BIN ...porter/expected_layoutexporter_iteratortoimage1/expected_layoutexporter_iteratortoimage1_mask.png
  188. BIN ...ut_exporter/expected_layoutexporter_iteratortoimage2/expected_layoutexporter_iteratortoimage2.png
  189. BIN ...porter/expected_layoutexporter_iteratortoimage2/expected_layoutexporter_iteratortoimage2_mask.png
  190. BIN ...ges/layout_exporter/expected_layoutexporter_report_page1/expected_layoutexporter_report_page1.png
  191. BIN ...ges/layout_exporter/expected_layoutexporter_report_page2/expected_layoutexporter_report_page2.png
@@ -636,6 +636,7 @@
<file>themes/default/mIconPythonFile.svg</file>
<file>themes/default/mIconQptFile.svg</file>
<file>themes/default/mActionNewPage.svg</file>
<file>themes/default/mActionExport.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>

Large diffs are not rendered by default.

@@ -50,7 +50,7 @@ as a result of a duplicate composition name).
.. seealso:: :py:func:`compositionAdded()`
%End

bool addLayout( QgsLayout *layout /Transfer/ );
bool addLayout( QgsMasterLayoutInterface *layout /Transfer/ );
%Docstring
Adds a ``layout`` to the manager. Ownership of the layout is transferred to the manager.
Returns true if the addition was successful, or false if the layout could not be added (eg
@@ -76,7 +76,7 @@ of removing a composition which is not contained in the manager).
.. seealso:: :py:func:`clear()`
%End

bool removeLayout( QgsLayout *layout );
bool removeLayout( QgsMasterLayoutInterface *layout );
%Docstring
Removes a ``layout`` from the manager. The layout is deleted.
Returns true if the removal was successful, or false if the removal failed (eg as a result
@@ -103,7 +103,7 @@ Removes and deletes all layouts from the manager.
Returns a list of all compositions contained in the manager.
%End

QList< QgsLayout * > layouts() const;
QList< QgsMasterLayoutInterface * > layouts() const;
%Docstring
Returns a list of all layouts contained in the manager.
%End
@@ -114,7 +114,7 @@ Returns the composition with a matching name, or None if no matching composition
were found.
%End

QgsLayout *layoutByName( const QString &name ) const;
QgsMasterLayoutInterface *layoutByName( const QString &name ) const;
%Docstring
Returns the layout with a matching name, or None if no matching layouts
were found.
@@ -148,7 +148,7 @@ composition will automatically be stored in the manager.
Returns new composition if duplication was successful.
%End

QgsLayout *duplicateLayout( const QgsLayout *layout, const QString &newName );
QgsMasterLayoutInterface *duplicateLayout( const QgsMasterLayoutInterface *layout, const QString &newName );
%Docstring
Duplicates an existing ``layout`` from the manager. The new
layout will automatically be stored in the manager.
@@ -161,9 +161,9 @@ Generates a unique title for a new composition, which does not
clash with any already contained by the manager.
%End

QString generateUniqueTitle() const;
QString generateUniqueTitle( QgsMasterLayoutInterface::Type type = QgsMasterLayoutInterface::PrintLayout ) const;
%Docstring
Generates a unique title for a new layout, which does not
Generates a unique title for a new layout of the specified ``type``, which does not
clash with any already contained by the manager.
%End

@@ -214,7 +214,7 @@ Emitted when a layout is about to be removed from the manager
Emitted when a composition is renamed
%End

void layoutRenamed( QgsLayout *layout, const QString &newName );
void layoutRenamed( QgsMasterLayoutInterface *layout, const QString &newName );
%Docstring
Emitted when a layout is renamed
%End
@@ -161,6 +161,9 @@
%Include composer/qgscomposermultiframecommand.sip
%Include composer/qgscomposertexttable.sip
%Include composer/qgspaperitem.sip
%Include layout/qgsabstractlayoutiterator.sip
%Include layout/qgsabstractreportsection.sip
%Include layout/qgsmasterlayoutinterface.sip
%Include layout/qgslayoutaligner.sip
%Include layout/qgslayoutexporter.sip
%Include layout/qgslayoutgridsettings.sip
@@ -173,6 +176,8 @@
%Include layout/qgslayoutsnapper.sip
%Include layout/qgslayoutundocommand.sip
%Include layout/qgslayoututils.sip
%Include layout/qgsreportsectionfieldgroup.sip
%Include layout/qgsreportsectionlayout.sip
%Include metadata/qgslayermetadata.sip
%Include metadata/qgslayermetadatavalidator.sip
%Include metadata/qgslayermetadataformatter.sip
@@ -406,7 +411,7 @@
%Include gps/qgsnmeaconnection.sip
%Include gps/qgsgpsdconnection.sip
%Include layout/qgslayout.sip
%Include layout/qgslayoutcontext.sip
%Include layout/qgslayoutatlas.sip
%Include layout/qgslayouteffect.sip
%Include layout/qgslayoutguidecollection.sip
%Include layout/qgslayoutframe.sip
@@ -433,9 +438,13 @@
%Include layout/qgslayoutmultiframe.sip
%Include layout/qgslayoutpagecollection.sip
%Include layout/qgslayoutobject.sip
%Include layout/qgslayoutrendercontext.sip
%Include layout/qgslayoutreportcontext.sip
%Include layout/qgslayouttable.sip
%Include layout/qgslayouttablecolumn.sip
%Include layout/qgslayoutundostack.sip
%Include layout/qgsprintlayout.sip
%Include layout/qgsreport.sip
%Include symbology/qgscptcityarchive.sip
%Include symbology/qgssvgcache.sip
%Include symbology/qgsstyle.sip
@@ -0,0 +1,71 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgsabstractlayoutiterator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsAbstractLayoutIterator
{
%Docstring
An abstract base class for QgsLayout based classes which can be exported by QgsLayoutExporter.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsabstractlayoutiterator.h"
%End
public:

virtual ~QgsAbstractLayoutIterator();

virtual QgsLayout *layout() = 0;
%Docstring
Returns the layout associated with the iterator.
%End

virtual bool beginRender() = 0;
%Docstring
Called when rendering begins, before iteration commences. Returns true if successful, false if no iteration
is available or required.

.. seealso:: :py:func:`endRender()`
%End

virtual bool endRender() = 0;
%Docstring
Ends the render, performing any required cleanup tasks.
%End

virtual int count() = 0;
%Docstring
Returns the number of features to iterate over.
%End

virtual bool next() = 0;
%Docstring
Iterates to next feature, returning false if no more features exist to iterate over.
%End

virtual QString filePath( const QString &baseFilePath, const QString &extension ) = 0;
%Docstring
Returns the file path for the current feature, based on a
specified base file path and extension.
%End

};




/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgsabstractlayoutiterator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit 421ef88

Please sign in to comment.
You can’t perform that action at this time.