Skip to content

Commit 166f8fc

Browse files
committed
[composer] Small improvements to api docs
1 parent b7423cf commit 166f8fc

File tree

4 files changed

+46
-8
lines changed

4 files changed

+46
-8
lines changed

python/core/composer/qgscomposeritem.sip

+20-3
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,30 @@ class QgsComposerItem : QObject, QGraphicsRectItem
179179
@param y y-position of mouse cursor (in item coordinates)*/
180180
virtual void zoomContent( int delta, double x, double y );
181181

182-
/** gets the page the item is currently on */
182+
/**Gets the page the item is currently on.
183+
* @returns page number for item
184+
* @see pagePos
185+
* @see updatePagePos
186+
* @note this method was added in version 2.4
187+
*/
183188
int page() const;
184189

185-
/** Returns the position relative to the current page */
190+
/**Returns the item's position relative to its current page.
191+
* @returns position relative to the page's top left corner.
192+
* @see page
193+
* @see updatePagePos
194+
* @note this method was added in version 2.4
195+
*/
186196
QPointF pagePos() const;
187197

188-
/** Updates the page relative position for the new paper size */
198+
/**Moves the item so that it retains its relative position on the page
199+
* when the paper size changes.
200+
* @param newPageWidth new width of the page in mm
201+
* @param newPageHeight new height of the page in mm
202+
* @see page
203+
* @see pagePos
204+
* @note this method was added in version 2.4
205+
*/
189206
void updatePagePos( double newPageWidth, double newPageHeight );
190207

191208
/**Moves the item to a new position (in canvas coordinates)*/

python/core/composer/qgscomposition.sip

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class QgsComposition : QGraphicsScene
4848

4949
~QgsComposition();
5050

51-
/**Changes size of paper item*/
51+
/**Changes size of paper item. Also moves all items so that they retain
52+
* their same relative position to the top left corner of their current page.
53+
*/
5254
void setPaperSize( double width, double height );
5355

5456
/**Returns height of paper item*/

src/core/composer/qgscomposeritem.h

+20-3
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,30 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
133133
@param y y-position of mouse cursor (in item coordinates)*/
134134
virtual void zoomContent( int delta, double x, double y ) { Q_UNUSED( delta ); Q_UNUSED( x ); Q_UNUSED( y ); }
135135

136-
/** gets the page the item is currently on */
136+
/**Gets the page the item is currently on.
137+
* @returns page number for item
138+
* @see pagePos
139+
* @see updatePagePos
140+
* @note this method was added in version 2.4
141+
*/
137142
int page() const;
138143

139-
/** Returns the position relative to the current page */
144+
/**Returns the item's position relative to its current page.
145+
* @returns position relative to the page's top left corner.
146+
* @see page
147+
* @see updatePagePos
148+
* @note this method was added in version 2.4
149+
*/
140150
QPointF pagePos() const;
141151

142-
/** Updates the page relative position for the new paper size */
152+
/**Moves the item so that it retains its relative position on the page
153+
* when the paper size changes.
154+
* @param newPageWidth new width of the page in mm
155+
* @param newPageHeight new height of the page in mm
156+
* @see page
157+
* @see pagePos
158+
* @note this method was added in version 2.4
159+
*/
143160
void updatePagePos( double newPageWidth, double newPageHeight );
144161

145162
/**Moves the item to a new position (in canvas coordinates)*/

src/core/composer/qgscomposition.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
104104

105105
~QgsComposition();
106106

107-
/**Changes size of paper item*/
107+
/**Changes size of paper item. Also moves all items so that they retain
108+
* their same relative position to the top left corner of their current page.
109+
*/
108110
void setPaperSize( double width, double height );
109111

110112
/**Returns height of paper item*/

0 commit comments

Comments
 (0)