37 QSet<QgsComposerItem*>::iterator itemIt = mItems.begin();
38 for ( ; itemIt != mItems.end(); ++itemIt )
45 ( *itemIt )->setIsGroupMember(
false );
57 if ( mItems.contains( item ) )
62 connect( item, SIGNAL( destroyed() ),
this, SLOT(
itemDestroyed() ) );
64 mItems.insert( item );
69 if ( mBoundingRectangle.isEmpty() )
71 mBoundingRectangle = QRectF( 0, 0, item->rect().width(), item->rect().height() );
85 mBoundingRectangle = mapRectToScene( mBoundingRectangle );
87 mBoundingRectangle = mBoundingRectangle.united( item->mapRectToScene( item->rect() ) );
94 mBoundingRectangle = mBoundingRectangle.united( mapRectFromItem( item, item->rect() ) );
95 QPointF newPos = mapToScene( mBoundingRectangle.topLeft().x(), mBoundingRectangle.topLeft().y() );
96 mBoundingRectangle = QRectF( 0, 0, mBoundingRectangle.width(), mBoundingRectangle.height() );
105 QSet<QgsComposerItem*>::iterator item_it = mItems.begin();
106 for ( ; item_it != mItems.end(); ++item_it )
108 ( *item_it )->setIsGroupMember(
false );
109 ( *item_it )->setSelected(
true );
116 mItems.remove( static_cast<QgsComposerItem*>( sender() ) );
134 QPointF newOrigin = mapFromScene( rectangle.topLeft() );
135 QRectF newRect = QRectF( newOrigin.x(), newOrigin.y(), rectangle.width(), rectangle.height() );
137 QSet<QgsComposerItem*>::iterator item_it = mItems.begin();
138 for ( ; item_it != mItems.end(); ++item_it )
141 QRectF itemRect = mapRectFromItem(( *item_it ), ( *item_it )->rect() );
144 QPointF newPos = mapToScene( itemRect.topLeft() );
145 ( *item_it )->setSceneRect( QRectF( newPos.x(), newPos.y(), itemRect.width(), itemRect.height() ) );
154 QSet<QgsComposerItem*>::iterator item_it = mItems.begin();
155 for ( ; item_it != mItems.end(); ++item_it )
157 ( *item_it )->setVisibility( visible );
172 QPen newPen( pen() );
173 newPen.setStyle( Qt::DashLine );
174 newPen.setColor( QColor( 128, 128, 128, 128 ) );
176 p->setRenderHint( QPainter::Antialiasing,
true );
177 p->drawRect( QRectF( 0, 0, rect().width(), rect().height() ) );
183 QDomElement group = doc.createElement(
"ComposerItemGroup" );
185 QSet<QgsComposerItem*>::const_iterator itemIt = mItems.begin();
186 for ( ; itemIt != mItems.end(); ++itemIt )
188 QDomElement item = doc.createElement(
"ComposerItemGroupElement" );
189 item.setAttribute(
"uuid", ( *itemIt )->uuid() );
190 group.appendChild( item );
193 elem.appendChild( group );
201 QDomNodeList composerItemList = itemElem.elementsByTagName(
"ComposerItem" );
202 if ( composerItemList.size() > 0 )
204 QDomElement composerItemElem = composerItemList.at( 0 ).toElement();
210 QDomNodeList elementNodes = itemElem.elementsByTagName(
"ComposerItemGroupElement" );
211 for (
int i = 0; i < elementNodes.count(); ++i )
213 QDomNode elementNode = elementNodes.at( i );
214 if ( !elementNode.isElement() )
217 QString
uuid = elementNode.toElement().attribute(
"uuid" );
219 for ( QList<QGraphicsItem *>::iterator it = items.begin(); it != items.end(); ++it )
222 if ( item && ( item->mUuid == uuid || item->mTemplateUuid == uuid ) )