Skip to content

Commit 51a4607

Browse files
committedJan 9, 2018
[layout] Disable ref images generation and added docs
1 parent dd0cce2 commit 51a4607

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed
 

‎src/core/layout/qgscompositionconverter.h

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
#ifndef QGSCOMPOSITIONCONVERTER_H
1717
#define QGSCOMPOSITIONCONVERTER_H
1818

19+
1920
#include <QDomDocument>
2021
#include <QDomElement>
2122

22-
2323
#include "qgis.h"
24+
#include "qgis_sip.h"
25+
26+
#define SIP_NO_FILE
27+
2428
#include "qgspropertycollection.h"
2529

2630
class QgsLayout;
@@ -38,6 +42,13 @@ class QgsLayoutItemMap;
3842
class QgsLayoutItemScaleBar;
3943
class QgsLayoutItemLegend;
4044

45+
46+
/**
47+
* QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout
48+
* \since QGIS 3.0
49+
* \note Not available in Python bindings.
50+
* \ingroup core
51+
*/
4152
class CORE_EXPORT QgsCompositionConverter
4253
{
4354
public:
@@ -97,7 +108,7 @@ class CORE_EXPORT QgsCompositionConverter
97108
};
98109

99110
/**
100-
* The MarkerMode enum is the old 2.x arrow marker mode
111+
* The MarkerMode enum is the old QGIS 2.x arrow marker mode
101112
*/
102113
enum MarkerMode
103114
{
@@ -109,16 +120,28 @@ class CORE_EXPORT QgsCompositionConverter
109120

110121
/**
111122
* \brief createLayoutFromCompositionXml is a factory that creates layout instances from a
112-
* QGIS 2.x XML composition \a document
123+
* QGIS 2.x XML composition \a document
113124
* \param parentElement is the Composition element
114-
* \param document
115-
* \param context
125+
* \param project the QGIS project
116126
* \return a QgsLayout instance
127+
* \since QGIS 3.0
128+
* \note Not available in Python bindings.
117129
*/
118130
static QgsLayout *createLayoutFromCompositionXml( const QDomElement &parentElement,
119131
QgsProject *project ) SIP_FACTORY;
120132

121133

134+
/**
135+
* addItemsFromCompositionXml parse a QGIS 2.x composition XML in the \a parentElement,
136+
* converts the 2.x items to the new layout elements and add them to the \a layout
137+
* \param layout the lay
138+
* \param parentElement
139+
* \param position for pasting
140+
* \param pasteInPlace if true element position is translated to \a position
141+
* \return a list of layout items
142+
* \since QGIS 3.0
143+
* \note Not available in Python bindings.
144+
*/
122145
static QList<QgsLayoutItem *> addItemsFromCompositionXml( QgsLayout *layout,
123146
const QDomElement &parentElement,
124147
QPointF *position = nullptr,

‎tests/src/core/testqgscompositionconverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ void TestQgsCompositionConverter::checkRenderedImage( QgsLayout *layout, const Q
402402
QSize size( layout->pageCollection()->page( pageNumber )->sizeWithUnits().width() * 3.77, layout->pageCollection()->page( pageNumber )->sizeWithUnits().height() * 3.77 );
403403
checker.setSize( size );
404404
checker.setControlPathPrefix( QStringLiteral( "compositionconverter" ) );
405-
QVERIFY( checker.testLayout( mReport, pageNumber, 0, true ) );
405+
QVERIFY( checker.testLayout( mReport, pageNumber ) );
406406
}
407407

408408
void TestQgsCompositionConverter::exportLayout( QgsLayout *layout, const QString testName )

0 commit comments

Comments
 (0)
Please sign in to comment.