34 QSet<QgsComposerItem*>::iterator itemIt =
mItems.begin();
35 for ( ; itemIt !=
mItems.end(); ++itemIt )
40 ( *itemIt )->setFlag( QGraphicsItem::ItemIsSelectable,
true );
52 if (
mItems.contains( item ) )
57 connect( item, SIGNAL( destroyed() ),
this, SLOT(
itemDestroyed() ) );
61 item->setFlag( QGraphicsItem::ItemIsSelectable,
false );
91 mBoundingRectangle = QRectF( 0, 0, mBoundingRectangle.width(), mBoundingRectangle.height() );
100 QSet<QgsComposerItem*>::iterator item_it =
mItems.begin();
101 for ( ; item_it !=
mItems.end(); ++item_it )
103 ( *item_it )->setFlag( QGraphicsItem::ItemIsSelectable,
true );
104 ( *item_it )->setSelected(
true );
111 mItems.remove( static_cast<QgsComposerItem*>( sender() ) );
129 QPointF newOrigin = mapFromScene( rectangle.topLeft() );
130 QRectF newRect = QRectF( newOrigin.x(), newOrigin.y(), rectangle.width(), rectangle.height() );
132 QSet<QgsComposerItem*>::iterator item_it =
mItems.begin();
133 for ( ; item_it !=
mItems.end(); ++item_it )
136 QRectF itemRect = mapRectFromItem(( *item_it ), ( *item_it )->rect() );
139 QPointF newPos = mapToScene( itemRect.topLeft() );
140 ( *item_it )->setSceneRect( QRectF( newPos.x(), newPos.y(), itemRect.width(), itemRect.height() ) );
155 QPen newPen( pen() );
156 newPen.setStyle( Qt::DashLine );
157 newPen.setColor( QColor( 128, 128, 128, 128 ) );
159 p->setRenderHint( QPainter::Antialiasing,
true );
160 p->drawRect( QRectF( 0, 0, rect().width(), rect().height() ) );
166 QDomElement group = doc.createElement(
"ComposerItemGroup" );
168 QSet<QgsComposerItem*>::const_iterator itemIt =
mItems.begin();
169 for ( ; itemIt !=
mItems.end(); ++itemIt )
171 QDomElement item = doc.createElement(
"ComposerItemGroupElement" );
172 item.setAttribute(
"uuid", ( *itemIt )->uuid() );
173 group.appendChild( item );
176 elem.appendChild( group );
184 QDomNodeList composerItemList = itemElem.elementsByTagName(
"ComposerItem" );
185 if ( composerItemList.size() > 0 )
187 QDomElement composerItemElem = composerItemList.at( 0 ).toElement();
193 QDomNodeList elementNodes = itemElem.elementsByTagName(
"ComposerItemGroupElement" );
194 for (
int i = 0; i < elementNodes.count(); ++i )
196 QDomNode elementNode = elementNodes.at( i );
197 if ( !elementNode.isElement() )
200 QString
uuid = elementNode.toElement().attribute(
"uuid" );
202 for ( QList<QGraphicsItem *>::iterator it = items.begin(); it != items.end(); ++it )