Skip to content

Commit

Permalink
[composer] Small improvements to api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 1, 2014
1 parent b7423cf commit 166f8fc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
23 changes: 20 additions & 3 deletions python/core/composer/qgscomposeritem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,30 @@ class QgsComposerItem : QObject, QGraphicsRectItem
@param y y-position of mouse cursor (in item coordinates)*/
virtual void zoomContent( int delta, double x, double y );

/** gets the page the item is currently on */
/**Gets the page the item is currently on.
* @returns page number for item
* @see pagePos
* @see updatePagePos
* @note this method was added in version 2.4
*/
int page() const;

/** Returns the position relative to the current page */
/**Returns the item's position relative to its current page.
* @returns position relative to the page's top left corner.
* @see page
* @see updatePagePos
* @note this method was added in version 2.4
*/
QPointF pagePos() const;

/** Updates the page relative position for the new paper size */
/**Moves the item so that it retains its relative position on the page
* when the paper size changes.
* @param newPageWidth new width of the page in mm
* @param newPageHeight new height of the page in mm
* @see page
* @see pagePos
* @note this method was added in version 2.4
*/
void updatePagePos( double newPageWidth, double newPageHeight );

/**Moves the item to a new position (in canvas coordinates)*/
Expand Down
4 changes: 3 additions & 1 deletion python/core/composer/qgscomposition.sip
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class QgsComposition : QGraphicsScene

~QgsComposition();

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

/**Returns height of paper item*/
Expand Down
23 changes: 20 additions & 3 deletions src/core/composer/qgscomposeritem.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,30 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
@param y y-position of mouse cursor (in item coordinates)*/
virtual void zoomContent( int delta, double x, double y ) { Q_UNUSED( delta ); Q_UNUSED( x ); Q_UNUSED( y ); }

/** gets the page the item is currently on */
/**Gets the page the item is currently on.
* @returns page number for item
* @see pagePos
* @see updatePagePos
* @note this method was added in version 2.4
*/
int page() const;

/** Returns the position relative to the current page */
/**Returns the item's position relative to its current page.
* @returns position relative to the page's top left corner.
* @see page
* @see updatePagePos
* @note this method was added in version 2.4
*/
QPointF pagePos() const;

/** Updates the page relative position for the new paper size */
/**Moves the item so that it retains its relative position on the page
* when the paper size changes.
* @param newPageWidth new width of the page in mm
* @param newPageHeight new height of the page in mm
* @see page
* @see pagePos
* @note this method was added in version 2.4
*/
void updatePagePos( double newPageWidth, double newPageHeight );

/**Moves the item to a new position (in canvas coordinates)*/
Expand Down
4 changes: 3 additions & 1 deletion src/core/composer/qgscomposition.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene

~QgsComposition();

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

/**Returns height of paper item*/
Expand Down

0 comments on commit 166f8fc

Please sign in to comment.