QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 
45  //overridden to also hide grouped items
46  virtual void setVisibility( const bool visible );
47 
52  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
53 
58  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
59 
60  QSet<QgsComposerItem*> items() { return mItems; }
61 
62  signals:
63  void childItemDeleted( QgsComposerItem* item );
64 
65  public slots:
66  void itemDestroyed();
67 
68  protected:
69  void drawFrame( QPainter* p );
70 
71  private:
72  QSet<QgsComposerItem*> mItems;
74 };
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
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.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
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 void setVisibility(const bool visible)
Sets visibility for item.