16 #ifndef QGSCOMPOSITIONCONVERTER_H
17 #define QGSCOMPOSITIONCONVERTER_H
20 #include <QDomDocument>
21 #include <QDomElement>
129 static std::unique_ptr<QgsPrintLayout> createLayoutFromCompositionXml(
const QDomElement &composerElement,
142 static QList<QgsLayoutObject *> addItemsFromCompositionXml(
QgsPrintLayout *layout,
143 const QDomElement &parentElement,
144 QPointF *position =
nullptr,
145 bool pasteInPlace =
false );
152 static bool isCompositionTemplate(
const QDomDocument &document );
161 static QDomDocument convertCompositionTemplate(
const QDomDocument
173 const QDomElement &itemElem,
177 const QDomElement &itemElem,
181 const QDomElement &itemElem,
186 template <
class T,
class T2>
static bool readPolyXml( T *layoutItem,
187 const QDomElement &itemElem,
191 const QDomElement &itemElem,
195 const QDomElement &itemElem,
200 const QDomElement &itemElem,
205 const QDomElement &itemElem,
210 const QDomElement &itemElem,
214 const QDomElement &itemElem,
218 const QDomElement &itemElem,
222 const QDomElement &itemElem,
224 const QList<QgsLayoutObject *> &items );
226 static bool readOldComposerObjectXml(
QgsLayoutObject *layoutItem,
const QDomElement &itemElem );
228 static void readOldDataDefinedPropertyMap(
const QDomElement &itemElem,
231 static QgsProperty readOldDataDefinedProperty( DataDefinedProperty property,
const QDomElement &ddElem );
233 static void initPropertyDefinitions();
238 static bool readXml(
QgsLayoutItem *layoutItem,
const QDomElement &itemElem );
241 static void adjustPos(
QgsPrintLayout *layout,
QgsLayoutItem *layoutItem, QPointF *position,
bool &pasteInPlace,
int zOrderOffset, QPointF &pasteShiftPos,
int &pageNumber );
244 static void restoreGeneralComposeItemProperties(
QgsLayoutItem *layoutItem,
const QDomElement &itemElem );
247 static QRectF itemPosition(
QgsLayoutItem *layoutItem,
const QDomElement &itemElem );
250 static QPointF minPointFromXml(
const QDomElement &elem );
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
DataDefinedProperty
Composition data defined properties for different item types.
@ LegendTitle
Legend title.
@ PaperOrientation
Paper orientation.
@ MapYMax
Map extent y maximum.
@ MapStylePreset
Layer and style map theme.
@ MapAtlasMargin
Map atlas margin.
@ FrameColor
Item frame color.
@ ItemWidth
Width of item.
@ MapYMin
Map extent y minimum.
@ ItemHeight
Height of item.
@ MapXMin
Map extent x minimum.
@ BlendMode
Item blend mode.
@ ScalebarFillColor2
Scalebar secondary fill color.
@ ExcludeFromExports
Exclude item from exports.
@ NumPages
Number of pages in composition.
@ PictureSvgBackgroundColor
SVG background color.
@ ItemRotation
Rotation of item.
@ MapRotation
Map rotation.
@ SourceUrl
Html source url.
@ LegendColumnCount
Legend column count.
@ PictureSvgStrokeWidth
SVG stroke width.
@ ScalebarFillColor
Scalebar fill color.
@ MapLayers
Map layer set.
@ PictureSvgStrokeColor
SVG stroke color.
@ PageNumber
Page number for item placement.
@ ScalebarLineColor
Scalebar line color.
@ Transparency
Item transparency (deprecated)
@ MapXMax
Map extent x maximum.
@ TestProperty
Dummy property with no effect on item.
@ AllProperties
All properties for item.
@ PresetPaperSize
Preset paper size for composition.
@ BackgroundColor
Item background color.
@ PositionY
Y position on page.
@ PaperHeight
Paper height.
@ PositionX
X position on page.
@ ScalebarLineWidth
Scalebar line width.
@ PictureSource
Picture source url.
MarkerMode
The MarkerMode enum is the old QGIS 2.x arrow marker mode.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
A layout table subclass that displays attributes from a vector layer.
A container for grouping several QgsLayoutItems.
A layout multiframe subclass for HTML content.
A layout item subclass for text labels.
A layout item subclass for map legends.
Layout graphical items for displaying a map.
A layout item subclass that displays SVG files or raster format images (jpg, png, ....
Layout item for node based polygon shapes.
Layout item for node based polyline shapes.
A layout item subclass for scale bars.
Layout item for basic filled shapes (e.g.
Base class for graphical items within a QgsLayout.
A base class for objects which belong to a layout.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A store for object properties.
The class is used as a container of context for various read/write operations on other objects.
QMap< QString, QString > QgsStringMap
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.