2014-01-27 09:22:24 +01:00
|
|
|
/**Item representing a grid. This is drawn separately to the underlying paper item since the grid needs to be
|
|
|
|
* drawn above all other composer items, while the paper item is drawn below all others.*/
|
|
|
|
class QgsPaperGrid : QGraphicsRectItem
|
|
|
|
{
|
2014-03-21 12:50:50 +11:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgspaperitem.h>
|
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
public:
|
|
|
|
QgsPaperGrid( double x, double y, double width, double height, QgsComposition* composition );
|
|
|
|
~QgsPaperGrid();
|
|
|
|
|
|
|
|
/** \brief Reimplementation of QCanvasItem::paint*/
|
|
|
|
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**Item representing the paper.*/
|
|
|
|
class QgsPaperItem : QgsComposerItem
|
2009-02-27 13:57:26 +00:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgspaperitem.h>
|
|
|
|
%End
|
|
|
|
public:
|
2010-11-25 21:45:52 +00:00
|
|
|
QgsPaperItem( QgsComposition* c /TransferThis/ );
|
|
|
|
QgsPaperItem( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition /TransferThis/ );
|
2009-02-27 13:57:26 +00:00
|
|
|
~QgsPaperItem();
|
|
|
|
|
2010-11-25 21:45:52 +00:00
|
|
|
/** return correct graphics item type. Added in v1.7 */
|
|
|
|
virtual int type() const;
|
|
|
|
|
2009-02-27 13:57:26 +00:00
|
|
|
/** \brief Reimplementation of QCanvasItem::paint*/
|
|
|
|
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** stores state in Dom element
|
|
|
|
* @param elem is Dom element corresponding to 'Composer' tag
|
|
|
|
* @param doc Dom document
|
2009-02-27 13:57:26 +00:00
|
|
|
*/
|
|
|
|
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
|
|
|
|
|
|
|
|
/** sets state from Dom document
|
|
|
|
* @param itemElem is Dom node corresponding to item tag
|
2012-09-24 02:28:15 +02:00
|
|
|
* @param doc is the Dom document
|
2009-02-27 13:57:26 +00:00
|
|
|
*/
|
|
|
|
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
|
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
virtual void setSceneRect( const QRectF& rectangle );
|
|
|
|
|
2009-02-27 13:57:26 +00:00
|
|
|
private:
|
|
|
|
QgsPaperItem();
|
2012-09-24 02:28:15 +02:00
|
|
|
/**Set flags and z-value*/
|
|
|
|
void initialize();
|
2010-11-25 21:45:52 +00:00
|
|
|
};
|