[Qgis-developer] Get composer item's size and position

Marco Hugentobler marco.hugentobler at sourcepole.ch
Thu Feb 23 15:22:02 EST 2012


Hi Alex

The methods to get width and height are defined in the parent class 
QGraphicsRectItem. Just use QgsGraphicsItem::rect().width() and 
QGraphicsRectItem::height().
To set width and height, you may use QgsComposerItem::setItemPosition()

Regards,
Marco

On 23.02.2012 17:52, Alexander Bruy wrote:
> Hi,
>
> I want to create simple print composition in run-time by placing
> composer items manually. But I found that there are no methods
> to get item width/height and position and so it is impossible to
> arrange items dynamically depending on their dimensions.
> Maybe I miss something?
>
> Thanks


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux&  Open Source Solutions
Churerstrasse 22, CH-8808 Pfäffikon SZ, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee



More information about the Qgis-developer mailing list