Skip to content
Permalink
Browse files

Cleanup item xml read/write, save shape properties

  • Loading branch information
nyalldawson committed Oct 16, 2017
1 parent 26dcf79 commit 7674bd746b1adfb8859f9d7ea27b0ed55d7935ca
@@ -293,29 +293,23 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
:rtype: float
%End

virtual bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Stores the item state in a DOM element.
\param parentElement parent DOM element (e.g. 'Layout' element)
\param document DOM document
\param context read write context
.. seealso:: readXml()
.. note::

Subclasses should ensure that they call writePropertiesToElement() in their implementation.
:rtype: bool
%End

virtual bool readXml( const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context );
bool readXml( const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context );
%Docstring
Sets the item state from a DOM element.
\param itemElement is the DOM node corresponding to item (e.g. 'LayoutItem' element)
\param document DOM document
\param context read write context
.. seealso:: writeXml()
.. note::

Subclasses should ensure that they call readPropertiesFromElement() in their implementation.
:rtype: bool
%End

@@ -687,9 +681,6 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
\param context read write context
.. seealso:: writeXml()
.. seealso:: readPropertiesFromElement()
.. note::

derived classes must call this base implementation when overriding this method
:rtype: bool
%End

@@ -701,9 +692,6 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
\param context read write context
.. seealso:: writePropertiesToElement()
.. seealso:: readXml()
.. note::

derived classes must call this base implementation when overriding this method
:rtype: bool
%End

@@ -67,17 +67,16 @@ class QgsLayoutItemGroup: QgsLayoutItem
virtual void attemptResize( const QgsLayoutSize &size, bool includesFrame = false );


virtual bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;

virtual bool readXml( const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context );


virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );


protected:
virtual void draw( QgsRenderContext &context, const QStyleOptionGraphicsItem *itemStyle = 0 );

virtual bool writePropertiesToElement( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;

virtual bool readPropertiesFromElement( const QDomElement &itemElement, const QDomDocument &document, const QgsReadWriteContext &context );


};

@@ -86,6 +86,11 @@ class QgsLayoutItemShape : QgsLayoutItem
virtual void draw( QgsRenderContext &context, const QStyleOptionGraphicsItem *itemStyle = 0 );


virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;

virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );


};


0 comments on commit 7674bd7

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