QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgscomposeritemgroup.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposeritemgroup.h
3  ----------------------
4  begin : 2nd June 2008
5  copyright : (C) 2008 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "qgscomposeritem.h"
19 #include <QSet>
20 
24 class CORE_EXPORT QgsComposerItemGroup: public QgsComposerItem
25 {
26  Q_OBJECT
27  public:
30 
32  virtual int type() const { return ComposerItemGroup; }
33 
36  void addItem( QgsComposerItem* item );
38  void removeItems();
40  void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
43  void setSceneRect( const QRectF& rectangle );
44 
49  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
50 
55  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
56 
57  QSet<QgsComposerItem*> items() { return mItems; }
58 
59  signals:
60  void childItemDeleted( QgsComposerItem* item );
61 
62  public slots:
63  void itemDestroyed();
64 
65  protected:
66  void drawFrame( QPainter* p );
67 
68  private:
69  QSet<QgsComposerItem*> mItems;
71 };
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)=0
sets state from Dom document
virtual void removeItems()
A item that forms part of a map composition.
A container for grouping several QgsComposerItems.
virtual void drawFrame(QPainter *p)
Draw black frame around item.
QSet< QgsComposerItem * > items()
Graphics scene for map printing.
virtual void addItem(QgsComposerItem *item)
Composite operations for item groups do nothing per default.
friend class QgsComposerItemGroup
virtual int type() const
return correct graphics item type.
virtual void setSceneRect(const QRectF &rectangle)
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
QSet< QgsComposerItem * > mItems
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const =0
stores state in Dom element