Skip to content

Commit b52f7c2

Browse files
committedJun 20, 2017
sipify core composer part 2
1 parent 01ffc4e commit b52f7c2

16 files changed

+3149
-2180
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
core/conversions.sip
22
core/qgsexception.sip
3-
core/composer/qgscomposereffect.sip
4-
core/composer/qgscomposerframe.sip
5-
core/composer/qgscomposerhtml.sip
6-
core/composer/qgscomposeritem.sip
7-
core/composer/qgscomposeritemcommand.sip
8-
core/composer/qgscomposeritemgroup.sip
9-
core/composer/qgscomposerlabel.sip
10-
core/composer/qgscomposerlegend.sip
11-
core/composer/qgscomposermapgrid.sip
12-
core/composer/qgscomposermapitem.sip
13-
core/composer/qgscomposermapoverview.sip
14-
core/composer/qgscomposermodel.sip
15-
core/composer/qgscomposermultiframe.sip
163
core/composer/qgscomposermultiframecommand.sip
174
core/composer/qgscomposerobject.sip
185
core/composer/qgscomposerpicture.sip
Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/composer/qgscomposereffect.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
113
class QgsComposerEffect : QGraphicsEffect
214
{
15+
316
%TypeHeaderCode
4-
#include <qgscomposereffect.h>
17+
#include "qgscomposereffect.h"
518
%End
619
public:
720
QgsComposerEffect();
8-
~QgsComposerEffect();
921

10-
void setCompositionMode( const QPainter::CompositionMode &compositionMode );
22+
void setCompositionMode( QPainter::CompositionMode compositionMode );
1123

1224
protected:
13-
/** Called whenever source needs to be drawn */
1425
virtual void draw( QPainter *painter );
26+
%Docstring
27+
Called whenever source needs to be drawn
28+
%End
29+
1530
};
31+
32+
33+
/************************************************************************
34+
* This file has been generated automatically from *
35+
* *
36+
* src/core/composer/qgscomposereffect.h *
37+
* *
38+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
39+
************************************************************************/
Lines changed: 91 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,119 @@
1-
/** Frame item for a composer multiframe item*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/composer/qgscomposerframe.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
212
class QgsComposerFrame: QgsComposerItem
313
{
14+
%Docstring
15+
Frame item for a composer multiframe item.
16+
%End
17+
418
%TypeHeaderCode
519
#include "qgscomposerframe.h"
620
%End
7-
821
public:
922
QgsComposerFrame( QgsComposition *c /TransferThis/, QgsComposerMultiFrame *mf, qreal x, qreal y, qreal width, qreal height );
1023

11-
~QgsComposerFrame();
12-
13-
/** Sets the visible part of the multiframe's content which is visible within
14-
* this frame (relative to the total multiframe extent in mm).
15-
* @param section visible portion of content
16-
* @see extent
17-
*/
1824
void setContentSection( const QRectF &section );
25+
%Docstring
26+
Sets the visible part of the multiframe's content which is visible within
27+
this frame (relative to the total multiframe extent in mm).
28+
\param section visible portion of content
29+
.. seealso:: extent
30+
%End
1931

20-
/** Returns the parent multiframe for the frame.
21-
* @returns parent multiframe
22-
*/
2332
QgsComposerMultiFrame *multiFrame() const;
33+
%Docstring
34+
Returns the parent multiframe for the frame.
35+
:return: parent multiframe
36+
:rtype: QgsComposerMultiFrame
37+
%End
2438

25-
//Overridden to allow multiframe to set display name
2639
virtual QString displayName() const;
2740

28-
//Overridden to handle fixed frame sizes set by multi frame
29-
void setSceneRect( const QRectF &rectangle );
30-
31-
void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
32-
void beginItemCommand( const QString &text );
33-
void endItemCommand();
34-
bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
35-
bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
36-
int type() const;
37-
38-
/** Returns the visible portion of the multi frame's content which
39-
* is shown in this frame.
40-
* @returns extent of visible portion
41-
* @note added in QGIS 2.5
42-
* @see setContentSection
43-
*/
41+
virtual void setSceneRect( const QRectF &rectangle );
42+
43+
44+
virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
45+
46+
virtual void beginItemCommand( const QString &text );
47+
48+
virtual void endItemCommand();
49+
50+
virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
51+
52+
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
53+
54+
virtual int type() const;
55+
4456
QRectF extent() const;
57+
%Docstring
58+
Returns the visible portion of the multi frame's content which
59+
is shown in this frame.
60+
:return: extent of visible portion
61+
.. versionadded:: 2.5
62+
.. seealso:: setContentSection
63+
:rtype: QRectF
64+
%End
4565

46-
/** Returns whether the page should be hidden (ie, not included in composer exports) if this frame is empty
47-
* @returns true if page should be hidden if frame is empty
48-
* @note added in QGIS 2.5
49-
* @see setHidePageIfEmpty
50-
*/
5166
bool hidePageIfEmpty() const;
67+
%Docstring
68+
Returns whether the page should be hidden (ie, not included in composer exports) if this frame is empty
69+
:return: true if page should be hidden if frame is empty
70+
.. versionadded:: 2.5
71+
.. seealso:: setHidePageIfEmpty
72+
:rtype: bool
73+
%End
5274

53-
/** Sets whether the page should be hidden (ie, not included in composer exports) if this frame is empty
54-
* @param hidePageIfEmpty set to true if page should be hidden if frame is empty
55-
* @note added in QGIS 2.5
56-
* @see hidePageIfEmpty
57-
*/
5875
void setHidePageIfEmpty( const bool hidePageIfEmpty );
76+
%Docstring
77+
Sets whether the page should be hidden (ie, not included in composer exports) if this frame is empty
78+
\param hidePageIfEmpty set to true if page should be hidden if frame is empty
79+
.. versionadded:: 2.5
80+
.. seealso:: hidePageIfEmpty
81+
%End
5982

60-
/** Returns whether the background and frame border should be hidden if this frame is empty
61-
* @returns true if background and border should be hidden if frame is empty
62-
* @note added in QGIS 2.5
63-
* @see setHideBackgroundIfEmpty
64-
*/
6583
bool hideBackgroundIfEmpty() const;
84+
%Docstring
85+
Returns whether the background and frame stroke should be hidden if this frame is empty
86+
:return: true if background and stroke should be hidden if frame is empty
87+
.. versionadded:: 2.5
88+
.. seealso:: setHideBackgroundIfEmpty
89+
:rtype: bool
90+
%End
6691

67-
/** Sets whether the background and frame border should be hidden if this frame is empty
68-
* @param hideBackgroundIfEmpty set to true if background and border should be hidden if frame is empty
69-
* @note added in QGIS 2.5
70-
* @see hideBackgroundIfEmpty
71-
*/
7292
void setHideBackgroundIfEmpty( const bool hideBackgroundIfEmpty );
93+
%Docstring
94+
Sets whether the background and frame stroke should be hidden if this frame is empty
95+
\param hideBackgroundIfEmpty set to true if background and stroke should be hidden if frame is empty
96+
.. versionadded:: 2.5
97+
.. seealso:: hideBackgroundIfEmpty
98+
%End
7399

74-
/** Returns whether the frame is empty
75-
* @returns true if frame is empty
76-
* @note added in QGIS 2.5
77-
* @see hidePageIfEmpty
78-
*/
79100
bool isEmpty() const;
101+
%Docstring
102+
Returns whether the frame is empty
103+
:return: true if frame is empty
104+
.. versionadded:: 2.5
105+
.. seealso:: hidePageIfEmpty
106+
:rtype: bool
107+
%End
80108

81109
virtual QgsExpressionContext createExpressionContext() const;
110+
82111
};
112+
113+
/************************************************************************
114+
* This file has been generated automatically from *
115+
* *
116+
* src/core/composer/qgscomposerframe.h *
117+
* *
118+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
119+
************************************************************************/
Lines changed: 193 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,200 +1,250 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/composer/qgscomposerhtml.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
112
class QgsComposerHtml: QgsComposerMultiFrame
213
{
14+
315
%TypeHeaderCode
416
#include "qgscomposerhtml.h"
517
%End
18+
public:
619

7-
public:
8-
9-
/** Source modes for the HTML content to render in the item
10-
*/
1120
enum ContentMode
1221
{
13-
Url, /*!< Using this mode item fetches its content via a url*/
14-
ManualHtml /*!< HTML content is manually set for the item*/
22+
Url,
23+
ManualHtml
1524
};
1625

1726
QgsComposerHtml( QgsComposition *c /TransferThis/, bool createUndoCommands );
1827

1928
~QgsComposerHtml();
2029

21-
/** Sets the source mode for item's HTML content.
22-
* @param mode ContentMode for the item's source
23-
* @see contentMode
24-
* @see setUrl
25-
* @see setHtml
26-
* @note added in 2.5
27-
*/
2830
void setContentMode( ContentMode mode );
31+
%Docstring
32+
Sets the source mode for item's HTML content.
33+
\param mode ContentMode for the item's source
34+
.. seealso:: contentMode
35+
.. seealso:: setUrl
36+
.. seealso:: setHtml
37+
.. versionadded:: 2.5
38+
%End
2939

30-
/** Returns the source mode for item's HTML content.
31-
* @returns ContentMode for the item's source
32-
* @see setContentMode
33-
* @see url
34-
* @see html
35-
* @note added in 2.5
36-
*/
3740
ContentMode contentMode() const;
41+
%Docstring
42+
Returns the source mode for item's HTML content.
43+
:return: ContentMode for the item's source
44+
.. seealso:: setContentMode
45+
.. seealso:: url
46+
.. seealso:: html
47+
.. versionadded:: 2.5
48+
:rtype: ContentMode
49+
%End
3850

39-
/** Sets the URL for content to display in the item when the item is using
40-
* the QgsComposerHtml::Url mode. Content is automatically fetched and the
41-
* HTML item refreshed after calling this function.
42-
* @param url URL of content to display in the item
43-
* @see url
44-
* @see contentMode
45-
*/
4651
void setUrl( const QUrl &url );
52+
%Docstring
53+
Sets the URL for content to display in the item when the item is using
54+
the QgsComposerHtml.Url mode. Content is automatically fetched and the
55+
HTML item refreshed after calling this function.
56+
\param url URL of content to display in the item
57+
.. seealso:: url
58+
.. seealso:: contentMode
59+
%End
4760

48-
/** Returns the URL of the content displayed in the item if the item is using
49-
* the QgsComposerHtml::Url mode.
50-
* @returns url for content displayed in item
51-
* @see setUrl
52-
* @see contentMode
53-
*/
5461
QUrl url() const;
62+
%Docstring
63+
Returns the URL of the content displayed in the item if the item is using
64+
the QgsComposerHtml.Url mode.
65+
:return: url for content displayed in item
66+
.. seealso:: setUrl
67+
.. seealso:: contentMode
68+
:rtype: QUrl
69+
%End
5570

56-
/** Sets the HTML to display in the item when the item is using
57-
* the QgsComposerHtml::ManualHtml mode. Setting the HTML using this function
58-
* does not automatically refresh the item's contents. Call loadHtml to trigger
59-
* a refresh of the item after setting the HTML content.
60-
* @param html HTML to display in item
61-
* @see html
62-
* @see contentMode
63-
* @see loadHtml
64-
* @note added in 2.5
65-
*/
6671
void setHtml( const QString &html );
72+
%Docstring
73+
Sets the HTML to display in the item when the item is using
74+
the QgsComposerHtml.ManualHtml mode. Setting the HTML using this function
75+
does not automatically refresh the item's contents. Call loadHtml to trigger
76+
a refresh of the item after setting the HTML content.
77+
\param html HTML to display in item
78+
.. seealso:: html
79+
.. seealso:: contentMode
80+
.. seealso:: loadHtml
81+
.. versionadded:: 2.5
82+
%End
6783

68-
/** Returns the HTML source displayed in the item if the item is using
69-
* the QgsComposerHtml::ManualHtml mode.
70-
* @returns HTML displayed in item
71-
* @see setHtml
72-
* @see contentMode
73-
* @note added in 2.5
74-
*/
7584
QString html() const;
85+
%Docstring
86+
Returns the HTML source displayed in the item if the item is using
87+
the QgsComposerHtml.ManualHtml mode.
88+
:return: HTML displayed in item
89+
.. seealso:: setHtml
90+
.. seealso:: contentMode
91+
.. versionadded:: 2.5
92+
:rtype: str
93+
%End
7694

77-
/** Returns whether html item will evaluate QGIS expressions prior to rendering
78-
* the HTML content. If set, any content inside [% %] tags will be
79-
* treated as a QGIS expression and evaluated against the current atlas
80-
* feature.
81-
* @returns true if html item will evaluate expressions in the content
82-
* @see setEvaluateExpressions
83-
* @note added in QGIS 2.5
84-
*/
8595
bool evaluateExpressions() const;
96+
%Docstring
97+
Returns whether html item will evaluate QGIS expressions prior to rendering
98+
the HTML content. If set, any content inside [% %] tags will be
99+
treated as a QGIS expression and evaluated against the current atlas
100+
feature.
101+
:return: true if html item will evaluate expressions in the content
102+
.. seealso:: setEvaluateExpressions
103+
.. versionadded:: 2.5
104+
:rtype: bool
105+
%End
86106

87-
/** Sets whether the html item will evaluate QGIS expressions prior to rendering
88-
* the HTML content. If set, any content inside [% %] tags will be
89-
* treated as a QGIS expression and evaluated against the current atlas
90-
* feature.
91-
* @param evaluateExpressions set to true to evaluate expressions in the HTML content
92-
* @see evaluateExpressions
93-
* @note added in QGIS 2.5
94-
*/
95107
void setEvaluateExpressions( bool evaluateExpressions );
108+
%Docstring
109+
Sets whether the html item will evaluate QGIS expressions prior to rendering
110+
the HTML content. If set, any content inside [% %] tags will be
111+
treated as a QGIS expression and evaluated against the current atlas
112+
feature.
113+
\param evaluateExpressions set to true to evaluate expressions in the HTML content
114+
.. seealso:: evaluateExpressions
115+
.. versionadded:: 2.5
116+
%End
96117

97-
/** Returns whether html item is using smart breaks. Smart breaks prevent
98-
* the html frame contents from breaking mid-way though a line of text.
99-
* @returns true if html item is using smart breaks
100-
* @see setUseSmartBreaks
101-
*/
102118
bool useSmartBreaks() const;
119+
%Docstring
120+
Returns whether html item is using smart breaks. Smart breaks prevent
121+
the html frame contents from breaking mid-way though a line of text.
122+
:return: true if html item is using smart breaks
123+
.. seealso:: setUseSmartBreaks
124+
:rtype: bool
125+
%End
103126

104-
/** Sets whether the html item should use smart breaks. Smart breaks prevent
105-
* the html frame contents from breaking mid-way though a line of text.
106-
* @param useSmartBreaks set to true to prevent content from breaking
107-
* mid-way through a line of text
108-
* @see useSmartBreaks
109-
*/
110127
void setUseSmartBreaks( bool useSmartBreaks );
128+
%Docstring
129+
Sets whether the html item should use smart breaks. Smart breaks prevent
130+
the html frame contents from breaking mid-way though a line of text.
131+
\param useSmartBreaks set to true to prevent content from breaking
132+
mid-way through a line of text
133+
.. seealso:: useSmartBreaks
134+
%End
111135

112-
/** Sets the maximum distance allowed when calculating where to place page breaks
113-
* in the html. This distance is the maximum amount of empty space allowed
114-
* at the bottom of a frame after calculating the optimum break location. Setting
115-
* a larger value will result in better choice of page break location, but more
116-
* wasted space at the bottom of frames. This setting is only effective if
117-
* useSmartBreaks is true.
118-
* @param maxBreakDistance maximum amount of empty space to leave when calculating
119-
* page break locations
120-
* @note added in 2.3
121-
* @see maxBreakDistance
122-
* @see setUseSmartBreaks
123-
*/
124136
void setMaxBreakDistance( double maxBreakDistance );
137+
%Docstring
138+
Sets the maximum distance allowed when calculating where to place page breaks
139+
in the html. This distance is the maximum amount of empty space allowed
140+
at the bottom of a frame after calculating the optimum break location. Setting
141+
a larger value will result in better choice of page break location, but more
142+
wasted space at the bottom of frames. This setting is only effective if
143+
useSmartBreaks is true.
144+
\param maxBreakDistance maximum amount of empty space to leave when calculating
145+
page break locations
146+
.. versionadded:: 2.3
147+
.. seealso:: maxBreakDistance
148+
.. seealso:: setUseSmartBreaks
149+
%End
125150

126-
/** Returns the maximum distance allowed when calculating where to place page breaks
127-
* in the html. This distance is the maximum amount of empty space allowed
128-
* at the bottom of a frame after calculating the optimum break location. This setting
129-
* is only effective if useSmartBreaks is true.
130-
* @returns maximum amount of empty space to leave when calculating page break locations
131-
* @note added in 2.3
132-
* @see setMaxBreakDistance
133-
* @see useSmartBreaks
134-
*/
135151
double maxBreakDistance() const;
152+
%Docstring
153+
Returns the maximum distance allowed when calculating where to place page breaks
154+
in the html. This distance is the maximum amount of empty space allowed
155+
at the bottom of a frame after calculating the optimum break location. This setting
156+
is only effective if useSmartBreaks is true.
157+
:return: maximum amount of empty space to leave when calculating page break locations
158+
.. versionadded:: 2.3
159+
.. seealso:: setMaxBreakDistance
160+
.. seealso:: useSmartBreaks
161+
:rtype: float
162+
%End
136163

137-
/** Sets the user stylesheet CSS rules to use while rendering the HTML content. These
138-
* allow for overriding the styles specified within the HTML source. Setting the stylesheet
139-
* using this function does not automatically refresh the item's contents. Call loadHtml
140-
* to trigger a refresh of the item after setting the stylesheet rules.
141-
* @param stylesheet CSS rules for user stylesheet
142-
* @see userStylesheet
143-
* @see setUserStylesheetEnabled
144-
* @see loadHtml
145-
* @note added in 2.5
146-
*/
147164
void setUserStylesheet( const QString &stylesheet );
165+
%Docstring
166+
Sets the user stylesheet CSS rules to use while rendering the HTML content. These
167+
allow for overriding the styles specified within the HTML source. Setting the stylesheet
168+
using this function does not automatically refresh the item's contents. Call loadHtml
169+
to trigger a refresh of the item after setting the stylesheet rules.
170+
\param stylesheet CSS rules for user stylesheet
171+
.. seealso:: userStylesheet
172+
.. seealso:: setUserStylesheetEnabled
173+
.. seealso:: loadHtml
174+
.. versionadded:: 2.5
175+
%End
148176

149-
/** Returns the user stylesheet CSS rules used while rendering the HTML content. These
150-
* overriding the styles specified within the HTML source.
151-
* @returns CSS rules for user stylesheet
152-
* @see setUserStylesheet
153-
* @see userStylesheetEnabled
154-
* @note added in 2.5
155-
*/
156177
QString userStylesheet() const;
178+
%Docstring
179+
Returns the user stylesheet CSS rules used while rendering the HTML content. These
180+
overriding the styles specified within the HTML source.
181+
:return: CSS rules for user stylesheet
182+
.. seealso:: setUserStylesheet
183+
.. seealso:: userStylesheetEnabled
184+
.. versionadded:: 2.5
185+
:rtype: str
186+
%End
157187

158-
/** Sets whether user stylesheets are enabled for the HTML content.
159-
* @param stylesheetEnabled set to true to enable user stylesheets
160-
* @see userStylesheetEnabled
161-
* @see setUserStylesheet
162-
* @note added in 2.5
163-
*/
164188
void setUserStylesheetEnabled( const bool stylesheetEnabled );
189+
%Docstring
190+
Sets whether user stylesheets are enabled for the HTML content.
191+
\param stylesheetEnabled set to true to enable user stylesheets
192+
.. seealso:: userStylesheetEnabled
193+
.. seealso:: setUserStylesheet
194+
.. versionadded:: 2.5
195+
%End
165196

166-
/** Returns whether user stylesheets are enabled for the HTML content.
167-
* @returns true if user stylesheets are enabled
168-
* @see setUserStylesheetEnabled
169-
* @see userStylesheet
170-
* @note added in 2.5
171-
*/
172197
bool userStylesheetEnabled() const;
198+
%Docstring
199+
Returns whether user stylesheets are enabled for the HTML content.
200+
:return: true if user stylesheets are enabled
201+
.. seealso:: setUserStylesheetEnabled
202+
.. seealso:: userStylesheet
203+
.. versionadded:: 2.5
204+
:rtype: bool
205+
%End
173206

174207
virtual QString displayName() const;
175-
QSizeF totalSize() const;
176-
void render( QPainter *p, const QRectF &renderExtent, const int frameIndex );
177-
bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const;
178-
bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false );
179-
void addFrame( QgsComposerFrame *frame /Transfer/, bool recalcFrameSizes = true );
180-
//overridden to break frames without dividing lines of text
181-
double findNearbyPageBreak( double yPos );
208+
virtual QSizeF totalSize() const;
209+
210+
virtual void render( QPainter *p, const QRectF &renderExtent, const int frameIndex );
211+
212+
virtual bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const;
213+
214+
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false );
215+
216+
virtual void addFrame( QgsComposerFrame *frame /Transfer/, bool recalcFrameSizes = true );
217+
218+
virtual double findNearbyPageBreak( double yPos );
219+
182220

183221
public slots:
184222

185-
/** Reloads the html source from the url and redraws the item.
186-
* @param useCache set to true to use a cached copy of remote html
187-
* content
188-
* @param context expression context for evaluating data defined urls and expressions in html
189-
* @see setUrl
190-
* @see url
191-
*/
192223
void loadHtml( const bool useCache = false, const QgsExpressionContext *context = 0 );
224+
%Docstring
225+
Reloads the html source from the url and redraws the item.
226+
\param useCache set to true to use a cached copy of remote html
227+
content
228+
\param context expression context for evaluating data defined urls and expressions in html
229+
.. seealso:: setUrl
230+
.. seealso:: url
231+
%End
232+
233+
virtual void recalculateFrameSizes();
193234

194-
/** Recalculates the frame sizes for the current viewport dimensions*/
195-
void recalculateFrameSizes();
235+
%Docstring
236+
Recalculates the frame sizes for the current viewport dimensions
237+
%End
196238
void refreshExpressionContext();
197239

198240
virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );
199241

200242
};
243+
244+
/************************************************************************
245+
* This file has been generated automatically from *
246+
* *
247+
* src/core/composer/qgscomposerhtml.h *
248+
* *
249+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
250+
************************************************************************/

‎python/core/composer/qgscomposeritem.sip

Lines changed: 611 additions & 420 deletions
Large diffs are not rendered by default.
Lines changed: 84 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,107 @@
1-
/** \ingroup core
2-
Undo command to undo/redo all composer item related changes*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/composer/qgscomposeritemcommand.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
314
class QgsComposerItemCommand: QUndoCommand
415
{
16+
%Docstring
17+
Undo command to undo/redo all composer item related changes
18+
%End
19+
520
%TypeHeaderCode
6-
#include "qgscomposeritemcommand.h"
21+
#include "qgscomposeritemcommand.h"
722
%End
823
public:
924
QgsComposerItemCommand( QgsComposerItem *item, const QString &text, QUndoCommand *parent /TransferThis/ = 0 );
10-
virtual ~QgsComposerItemCommand();
1125

12-
/** Reverses the command*/
13-
void undo();
14-
/** Replays the command*/
15-
void redo();
26+
virtual void undo();
27+
28+
%Docstring
29+
Reverses the command
30+
%End
31+
virtual void redo();
32+
33+
%Docstring
34+
Replays the command
35+
%End
1636

17-
/** Saves current item state as previous state*/
1837
void savePreviousState();
19-
/** Saves current item state as after state*/
38+
%Docstring
39+
Saves current item state as previous state
40+
%End
2041
void saveAfterState();
42+
%Docstring
43+
Saves current item state as after state
44+
%End
2145

2246
QDomDocument previousState() const;
47+
%Docstring
48+
:rtype: QDomDocument
49+
%End
2350
QDomDocument afterState() const;
51+
%Docstring
52+
:rtype: QDomDocument
53+
%End
2454

25-
/** Returns true if previous state and after state are valid and different*/
2655
bool containsChange() const;
56+
%Docstring
57+
Returns true if previous state and after state are valid and different
58+
:rtype: bool
59+
%End
2760

28-
/** Returns the target item the command applies to.
29-
* @returns target composer item
30-
*/
3161
QgsComposerItem *item() const;
62+
%Docstring
63+
Returns the target item the command applies to.
64+
:return: target composer item
65+
:rtype: QgsComposerItem
66+
%End
3267

3368
protected:
69+
70+
71+
3472
void saveState( QDomDocument &stateDoc ) const;
73+
%Docstring
74+
Flag to prevent the first redo() if the command is pushed to the undo stack
75+
%End
3576
void restoreState( QDomDocument &stateDoc ) const;
3677
};
3778

38-
/** A composer command that merges together with other commands having the same context (=id). Keeps the oldest previous state and uses the
39-
newest after state. The purpose is to avoid too many micro changes in the history*/
40-
class QgsComposerMergeCommand : QgsComposerItemCommand
79+
class QgsComposerMergeCommand: QgsComposerItemCommand
4180
{
81+
%Docstring
82+
A composer command that merges together with other commands having the same context (=id). Keeps the oldest previous state and uses the
83+
newest after state. The purpose is to avoid too many micro changes in the history
84+
%End
85+
4286
%TypeHeaderCode
43-
#include "qgscomposeritemcommand.h"
87+
#include "qgscomposeritemcommand.h"
4488
%End
4589
public:
4690
enum Context
4791
{
4892
Unknown,
49-
//composer label
93+
//composer
5094
ComposerLabelSetText,
5195
ComposerLabelSetId,
5296
ComposerLabelFontColor,
53-
//composer map
97+
//composer
5498
ComposerMapRotation,
5599
ComposerMapAnnotationDistance,
56100
ComposerMapGridFramePenColor,
57101
ComposerMapGridFrameFill1Color,
58102
ComposerMapGridFrameFill2Color,
59103
ComposerMapGridAnnotationFontColor,
60-
//composer legend
104+
//composer
61105
ComposerLegendText,
62106
LegendColumnCount,
63107
LegendSplitLayer,
@@ -73,14 +117,16 @@ class QgsComposerMergeCommand : QgsComposerItemCommand
73117
LegendIconSymbolSpace,
74118
LegendBoxSpace,
75119
LegendColumnSpace,
120+
LegendLineSpacing,
76121
LegendRasterStrokeWidth,
77122
LegendFontColor,
78123
LegendRasterStrokeColor,
79-
//composer picture
124+
//composer
80125
ComposerPictureRotation,
81126
ComposerPictureFillColor,
82127
ComposerPictureStrokeColor,
83-
// composer scalebar
128+
ComposerPictureNorthOffset,
129+
// composer
84130
ScaleBarLineWidth,
85131
ScaleBarHeight,
86132
ScaleBarSegmentSize,
@@ -94,14 +140,14 @@ class QgsComposerMergeCommand : QgsComposerItemCommand
94140
ScaleBarFillColor,
95141
ScaleBarFill2Color,
96142
ScaleBarStrokeColor,
97-
// composer table
143+
// composer
98144
TableMaximumFeatures,
99145
TableMargin,
100146
TableGridStrokeWidth,
101-
//composer shape
147+
//composer
102148
ShapeCornerRadius,
103149
ShapeStrokeWidth,
104-
//composer arrow
150+
//composer
105151
ArrowStrokeWidth,
106152
ArrowHeadFillColor,
107153
ArrowHeadStrokeColor,
@@ -117,8 +163,17 @@ class QgsComposerMergeCommand : QgsComposerItemCommand
117163
};
118164

119165
QgsComposerMergeCommand( Context c, QgsComposerItem *item, const QString &text );
120-
~QgsComposerMergeCommand();
121166

122-
bool mergeWith( const QUndoCommand *command );
123-
int id() const;
167+
virtual bool mergeWith( const QUndoCommand *command );
168+
169+
virtual int id() const;
170+
124171
};
172+
173+
/************************************************************************
174+
* This file has been generated automatically from *
175+
* *
176+
* src/core/composer/qgscomposeritemcommand.h *
177+
* *
178+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
179+
************************************************************************/
Lines changed: 74 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,80 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/composer/qgscomposeritemgroup.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111
class QgsComposerItemGroup: QgsComposerItem
212
{
13+
%Docstring
14+
A container for grouping several QgsComposerItems
15+
%End
16+
317
%TypeHeaderCode
4-
#include <qgscomposeritemgroup.h>
18+
#include "qgscomposeritemgroup.h"
519
%End
620
public:
721
QgsComposerItemGroup( QgsComposition *c /TransferThis/ );
822
~QgsComposerItemGroup();
923

10-
/** Return correct graphics item type. */
1124
virtual int type() const;
25+
%Docstring
26+
Return correct graphics item type.
27+
:rtype: int
28+
%End
29+
30+
virtual void addItem( QgsComposerItem *item );
31+
32+
%Docstring
33+
Adds an item to the group. All the group members are deleted
34+
if the group is deleted*
35+
%End
36+
virtual void removeItems();
37+
38+
%Docstring
39+
Removes the items but does not delete them
40+
%End
41+
virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
42+
43+
%Docstring
44+
Draw stroke and ev. selection handles
45+
%End
46+
47+
virtual void setSceneRect( const QRectF &rectangle );
48+
49+
%Docstring
50+
Sets this items bound in scene coordinates such that 1 item size units
51+
corresponds to 1 scene size unit*
52+
%End
1253

13-
/** Adds an item to the group. All the group members are deleted
14-
if the group is deleted*/
15-
void addItem( QgsComposerItem *item );
16-
/** Removes the items but does not delete them*/
17-
void removeItems();
18-
/** Draw outline and ev. selection handles*/
19-
void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
20-
/** Sets this items bound in scene coordinates such that 1 item size units
21-
corresponds to 1 scene size unit*/
22-
void setSceneRect( const QRectF &rectangle );
23-
24-
//overridden to also hide grouped items
2554
virtual void setVisibility( const bool visible );
2655

27-
/** Stores state in Dom node
28-
* @param elem is Dom element corresponding to 'Composer' tag
29-
* @param doc is the Dom document
30-
*/
31-
bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
56+
virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
57+
58+
%Docstring
59+
Stores state in Dom node
60+
\param elem is Dom element corresponding to 'Composer' tag
61+
\param doc is the Dom document
62+
:rtype: bool
63+
%End
64+
65+
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
3266

33-
/** Sets state from Dom document
34-
* @param itemElem is Dom node corresponding to item tag
35-
* @param doc is the Dom document
36-
*/
37-
bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
67+
%Docstring
68+
Sets state from Dom document
69+
\param itemElem is Dom node corresponding to item tag
70+
\param doc is the Dom document
71+
:rtype: bool
72+
%End
3873

39-
QSet<QgsComposerItem*> items();
74+
QSet<QgsComposerItem *> items();
75+
%Docstring
76+
:rtype: set of QgsComposerItem
77+
%End
4078

4179
signals:
4280
void childItemDeleted( QgsComposerItem *item );
@@ -45,5 +83,15 @@ class QgsComposerItemGroup: QgsComposerItem
4583
void itemDestroyed();
4684

4785
protected:
48-
void drawFrame( QPainter *p );
86+
virtual void drawFrame( QPainter *p );
87+
88+
4989
};
90+
91+
/************************************************************************
92+
* This file has been generated automatically from *
93+
* *
94+
* src/core/composer/qgscomposeritemgroup.h *
95+
* *
96+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
97+
************************************************************************/
Lines changed: 151 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,203 @@
1-
/** \ingroup core
2-
* A label that can be placed onto a map composition.
3-
*/
4-
class QgsComposerLabel : QgsComposerItem
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/composer/qgscomposerlabel.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsComposerLabel: QgsComposerItem
513
{
14+
%Docstring
15+
A label that can be placed onto a map composition.
16+
%End
17+
618
%TypeHeaderCode
719
#include "qgscomposerlabel.h"
820
%End
921
public:
10-
QgsComposerLabel( QgsComposition *composition /TransferThis/);
22+
QgsComposerLabel( QgsComposition *composition );
1123
~QgsComposerLabel();
1224

13-
/** Return correct graphics item type. */
1425
virtual int type() const;
26+
%Docstring
27+
Return correct graphics item type.
28+
:rtype: int
29+
%End
1530

16-
/** \brief Reimplementation of QCanvasItem::paint*/
17-
void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
31+
virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
32+
33+
%Docstring
34+
Reimplementation of QCanvasItem.paint
35+
%End
1836

19-
/** Resizes the widget such that the text fits to the item. Keeps top left point*/
2037
void adjustSizeToText();
38+
%Docstring
39+
Resizes the widget such that the text fits to the item. Keeps top left point
40+
%End
2141

2242
QString text();
43+
%Docstring
44+
:rtype: str
45+
%End
2346
void setText( const QString &text );
2447

2548
int htmlState();
49+
%Docstring
50+
:rtype: int
51+
%End
2652
void setHtmlState( int state );
2753

28-
/** Returns the text as it appears on screen (with replaced data field) */
2954
QString displayText() const;
55+
%Docstring
56+
Returns the text as it appears on screen (with replaced data field)
57+
:rtype: str
58+
%End
3059

3160
QFont font() const;
61+
%Docstring
62+
:rtype: QFont
63+
%End
3264
void setFont( const QFont &f );
33-
/** Accessor for the vertical alignment of the label
34-
* @returns Qt::AlignmentFlag
35-
*/
65+
3666
Qt::AlignmentFlag vAlign() const;
37-
/** Accessor for the horizontal alignment of the label
38-
* @returns Qt::AlignmentFlag
39-
*/
67+
%Docstring
68+
Accessor for the vertical alignment of the label
69+
:return: Qt.AlignmentFlag
70+
:rtype: Qt.AlignmentFlag
71+
%End
72+
4073
Qt::AlignmentFlag hAlign() const;
41-
/** Mutator for the horizontal alignment of the label
42-
* @param a alignment
43-
* @returns void
44-
*/
74+
%Docstring
75+
Accessor for the horizontal alignment of the label
76+
:return: Qt.AlignmentFlag
77+
:rtype: Qt.AlignmentFlag
78+
%End
79+
4580
void setHAlign( Qt::AlignmentFlag a );
46-
/** Mutator for the vertical alignment of the label
47-
* @param a alignment
48-
* @returns void
49-
*/
81+
%Docstring
82+
Mutator for the horizontal alignment of the label
83+
\param a alignment
84+
:return: void
85+
%End
86+
5087
void setVAlign( Qt::AlignmentFlag a );
88+
%Docstring
89+
Mutator for the vertical alignment of the label
90+
\param a alignment
91+
:return: void
92+
%End
5193

52-
/** Returns the horizontal margin between the edge of the frame and the label
53-
* contents.
54-
* @returns horizontal margin in mm
55-
* @note added in QGIS 2.7
56-
*/
5794
double marginX() const;
95+
%Docstring
96+
Returns the horizontal margin between the edge of the frame and the label
97+
contents.
98+
:return: horizontal margin in mm
99+
.. versionadded:: 2.7
100+
:rtype: float
101+
%End
58102

59-
/** Returns the vertical margin between the edge of the frame and the label
60-
* contents.
61-
* @returns vertical margin in mm
62-
* @note added in QGIS 2.7
63-
*/
64103
double marginY() const;
104+
%Docstring
105+
Returns the vertical margin between the edge of the frame and the label
106+
contents.
107+
:return: vertical margin in mm
108+
.. versionadded:: 2.7
109+
:rtype: float
110+
%End
65111

66-
/** Sets the margin between the edge of the frame and the label contents.
67-
* This method sets both the horizontal and vertical margins to the same
68-
* value. The margins can be individually controlled using the setMarginX
69-
* and setMarginY methods.
70-
* @param m margin in mm
71-
* @see setMarginX
72-
* @see setMarginY
73-
*/
74112
void setMargin( const double m );
113+
%Docstring
114+
Sets the margin between the edge of the frame and the label contents.
115+
This method sets both the horizontal and vertical margins to the same
116+
value. The margins can be individually controlled using the setMarginX
117+
and setMarginY methods.
118+
\param m margin in mm
119+
.. seealso:: setMarginX
120+
.. seealso:: setMarginY
121+
%End
75122

76-
/** Sets the horizontal margin between the edge of the frame and the label
77-
* contents.
78-
* @param margin horizontal margin in mm
79-
* @see setMargin
80-
* @see setMarginY
81-
* @note added in QGIS 2.7
82-
*/
83123
void setMarginX( const double margin );
124+
%Docstring
125+
Sets the horizontal margin between the edge of the frame and the label
126+
contents.
127+
\param margin horizontal margin in mm
128+
.. seealso:: setMargin
129+
.. seealso:: setMarginY
130+
.. versionadded:: 2.7
131+
%End
84132

85-
/** Sets the vertical margin between the edge of the frame and the label
86-
* contents.
87-
* @param margin vertical margin in mm
88-
* @see setMargin
89-
* @see setMarginX
90-
* @note added in QGIS 2.7
91-
*/
92133
void setMarginY( const double margin );
134+
%Docstring
135+
Sets the vertical margin between the edge of the frame and the label
136+
contents.
137+
\param margin vertical margin in mm
138+
.. seealso:: setMargin
139+
.. seealso:: setMarginX
140+
.. versionadded:: 2.7
141+
%End
93142

94-
/** Sets text color */
95143
void setFontColor( const QColor &c );
96-
/** Get font color */
144+
%Docstring
145+
Sets text color
146+
%End
97147
QColor fontColor() const;
148+
%Docstring
149+
Get font color
150+
:rtype: QColor
151+
%End
152+
153+
virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
98154

99-
/** Stores state in Dom element
100-
* @param elem is Dom element corresponding to 'Composer' tag
101-
* @param doc document
102-
*/
103-
bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
155+
%Docstring
156+
Stores state in Dom element
157+
\param elem is Dom element corresponding to 'Composer' tag
158+
\param doc document
159+
:rtype: bool
160+
%End
161+
162+
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
104163

105-
/** Sets state from Dom document
106-
* @param itemElem is Dom element corresponding to 'ComposerLabel' tag
107-
* @param doc document
108-
*/
109-
bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
164+
%Docstring
165+
Sets state from Dom document
166+
\param itemElem is Dom element corresponding to 'ComposerLabel' tag
167+
\param doc document
168+
:rtype: bool
169+
%End
110170

111-
//Overridden to contain part of label's text
112171
virtual QString displayName() const;
113172

114-
/** In case of negative margins, the bounding rect may be larger than the
115-
* label's frame
116-
*/
117-
QRectF boundingRect() const;
173+
virtual QRectF boundingRect() const;
174+
175+
%Docstring
176+
In case of negative margins, the bounding rect may be larger than the
177+
label's frame
178+
:rtype: QRectF
179+
%End
118180

119-
/** Reimplemented to call prepareGeometryChange after toggling frame
120-
*/
121181
virtual void setFrameEnabled( const bool drawFrame );
182+
%Docstring
183+
Reimplemented to call prepareGeometryChange after toggling frame
184+
%End
122185

123-
/** Reimplemented to call prepareGeometryChange after changing stroke width
124-
*/
125186
virtual void setFrameStrokeWidth( const double strokeWidth );
187+
%Docstring
188+
Reimplemented to call prepareGeometryChange after changing stroke width
189+
%End
126190

127191
public slots:
128192
void refreshExpressionContext();
193+
194+
129195
};
196+
197+
/************************************************************************
198+
* This file has been generated automatically from *
199+
* *
200+
* src/core/composer/qgscomposerlabel.h *
201+
* *
202+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
203+
************************************************************************/

‎python/core/composer/qgscomposerlegend.sip

Lines changed: 269 additions & 132 deletions
Large diffs are not rendered by default.

‎python/core/composer/qgscomposermapgrid.sip

Lines changed: 678 additions & 583 deletions
Large diffs are not rendered by default.

‎python/core/composer/qgscomposermapitem.sip

Lines changed: 213 additions & 148 deletions
Large diffs are not rendered by default.

‎python/core/composer/qgscomposermapoverview.sip

Lines changed: 215 additions & 159 deletions
Large diffs are not rendered by default.

‎python/core/composer/qgscomposermodel.sip

Lines changed: 281 additions & 207 deletions
Large diffs are not rendered by default.

‎python/core/composer/qgscomposermultiframe.sip

Lines changed: 250 additions & 184 deletions
Large diffs are not rendered by default.

‎src/core/composer/qgscomposeritem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class QgsComposerEffect;
3838
* A item that forms part of a map composition.
3939
*/
4040
class CORE_EXPORT QgsComposerItem: public QgsComposerObject, public QGraphicsRectItem
41+
{
4142
#ifdef SIP_RUN
4243
#include <qgscomposerarrow.h>
4344
#include <qgscomposerframe.h>
@@ -53,7 +54,7 @@ class CORE_EXPORT QgsComposerItem: public QgsComposerObject, public QGraphicsRec
5354
#include <qgscomposerpolyline.h>
5455
#include <qgscomposertexttable.h>
5556
#endif
56-
{
57+
5758

5859
#ifdef SIP_RUN
5960
SIP_CONVERT_TO_SUBCLASS_CODE

‎src/core/composer/qgscomposermultiframe.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ class QDomElement;
3131
class QRectF;
3232
class QPainter;
3333

34+
35+
#ifdef SIP_RUN
36+
% ModuleHeaderCode
37+
#include <qgscomposerhtml.h>
38+
#include <qgscomposertablev2.h>
39+
#include <qgscomposerattributetablev2.h>
40+
% End
41+
#endif
42+
3443
/**
3544
* \ingroup core
3645
* \class QgsComposerMultiFrame

0 commit comments

Comments
 (0)
Please sign in to comment.