QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 #ifndef QGSCOMPOSERITEMGROUP_H
18 #define QGSCOMPOSERITEMGROUP_H
19 
20 #include "qgscomposeritem.h"
21 #include <QSet>
22 
26 class CORE_EXPORT QgsComposerItemGroup: public QgsComposerItem
27 {
28  Q_OBJECT
29  public:
32 
34  virtual int type() const { return ComposerItemGroup; }
35 
38  void addItem( QgsComposerItem* item );
40  void removeItems();
42  void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
45  void setSceneRect( const QRectF& rectangle );
46 
47  //overridden to also hide grouped items
48  virtual void setVisibility( const bool visible );
49 
54  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
55 
60  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
61 
62  QSet<QgsComposerItem*> items() { return mItems; }
63 
64  signals:
65  void childItemDeleted( QgsComposerItem* item );
66 
67  public slots:
68  void itemDestroyed();
69 
70  protected:
71  void drawFrame( QPainter* p );
72 
73  private:
74  QSet<QgsComposerItem*> mItems;
75  QRectF mBoundingRectangle;
76 };
77 
78 #endif
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...
virtual void setVisibility(const bool visible)
Sets visibility for item.