Skip to content

Commit 03400dd

Browse files
authored
Merge pull request #5913 from elpaso/layouts-import-from-2
[layouts] import from 2.x
2 parents 5babec5 + 6332fc6 commit 03400dd

File tree

68 files changed

+6336
-35
lines changed

Some content is hidden

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

68 files changed

+6336
-35
lines changed

.ci/travis/linux/blacklist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ PyQgsLocator
3737
PyQgsAuthManagerPKIPostgresTest
3838
PyQgsAuthManagerPasswordPostgresTest
3939
PyQgsAuthManagerOgrPostgresTest
40+
41+
# temporary disable for composition -> layout transition
42+
PyQgsServerWMS
43+
PyQgsServerWMSGetPrint

python/core/layout/qgslayout.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Returns the items model attached to the layout.
8787
%End
8888

8989

90+
9091
QList<QgsLayoutItem *> selectedLayoutItems( const bool includeLockedItems = true );
9192
%Docstring
9293
Returns list of selected layout items.

python/core/layout/qgslayoutitemattributetable.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Returns the source for attributes shown in the table body.
6363
.. seealso:: :py:func:`setSource()`
6464
%End
6565

66-
QgsVectorLayer *sourceLayer();
66+
QgsVectorLayer *sourceLayer() const;
6767
%Docstring
6868
Returns the source layer for the table, considering the table source mode. For example,
6969
if the table is set to atlas feature mode, then the source layer will be the

python/core/layout/qgslayoutitemlabel.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Returns the required item size (in layout units) for the label's text to fill th
6161
.. seealso:: :py:func:`adjustSizeToText()`
6262
%End
6363

64-
QString text();
64+
QString text() const;
6565
%Docstring
6666
Returns the label's preset text.
6767

python/core/layout/qgslayoutitemshape.sip

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ class QgsLayoutItemShape : QgsLayoutItem
3434
Constructor for QgsLayoutItemShape, with the specified parent ``layout``.
3535
%End
3636

37+
static QgsLayoutItemShape *create( QgsLayout *layout ) /Factory/;
38+
%Docstring
39+
Returns a new shape item for the specified ``layout``.
40+
41+
The caller takes responsibility for deleting the returned object.
42+
%End
43+
44+
3745
virtual int type() const;
3846

3947
virtual QIcon icon() const;

python/core/qgsmultirenderchecker.sip

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,16 @@ Constructor for QgsLayoutChecker.
163163
Sets the output (reference) image ``size``.
164164
%End
165165

166-
bool testLayout( QString &report, int page = 0, int pixelDiff = 0 );
166+
bool testLayout( QString &report, int page = 0, int pixelDiff = 0, bool createReferenceImage = false );
167167
%Docstring
168168
Runs a render check on the layout, adding results to the specified ``report``.
169169

170170
The maximum number of allowable pixels differing from the reference image is
171171
specified via the ``pixelDiff`` argument.
172172

173+
A reference image can be created by setting ``createReferenceImage`` to true
174+
in this case the test will always return true.
175+
173176
The page number is specified via ``page``, where 0 corresponds to the first
174177
page in the layout.
175178

scripts/spell_check/.agignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ src/server/qgis_wms.xmi
6262
tests/testdata/qgis_server_accesscontrol/Hello.qml
6363
tests/testdata/qgis_server_accesscontrol/project.qgs
6464
tests/testdata/qgis_server/ets-wms13/project.qgs
65+
tests/testdata/layouts/sample_project.qgs
66+
tests/testdata/layouts/2x_template_attributetable.qpt
67+

src/core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ SET(QGIS_CORE_SRCS
418418
layout/qgsreport.cpp
419419
layout/qgsreportsectionfieldgroup.cpp
420420
layout/qgsreportsectionlayout.cpp
421+
layout/qgscompositionconverter.cpp
421422

422423
pal/costcalculator.cpp
423424
pal/feature.cpp
@@ -1052,6 +1053,7 @@ SET(QGIS_CORE_HDRS
10521053
layout/qgslayoututils.h
10531054
layout/qgsreportsectionfieldgroup.h
10541055
layout/qgsreportsectionlayout.h
1056+
layout/qgscompositionconverter.h
10551057

10561058
metadata/qgslayermetadata.h
10571059
metadata/qgslayermetadatavalidator.h

src/core/composer/qgscomposerlegend.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
350350

351351
//! Will be true if the legend should be resized automatically to fit contents
352352
bool mSizeToContents = true;
353+
353354
};
354355

355356
#endif

src/core/layout/qgscompositionconverter.cpp

Lines changed: 1676 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)