[QGIS Commit] r8578 - in branches/advanced_printing_branch/src: app app/composer ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jun 3 08:54:07 EDT 2008


Author: mhugent
Date: 2008-06-03 08:54:07 -0400 (Tue, 03 Jun 2008)
New Revision: 8578

Added:
   branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.h
Modified:
   branches/advanced_printing_branch/src/app/CMakeLists.txt
   branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposer.h
   branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposeritem.h
   branches/advanced_printing_branch/src/app/composer/qgscomposerview.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposerview.h
   branches/advanced_printing_branch/src/app/composer/qgscomposition.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposition.h
   branches/advanced_printing_branch/src/ui/qgscomposerbase.ui
Log:
First tries to add group/ungroup item support

Modified: branches/advanced_printing_branch/src/app/CMakeLists.txt
===================================================================
--- branches/advanced_printing_branch/src/app/CMakeLists.txt	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/CMakeLists.txt	2008-06-03 12:54:07 UTC (rev 8578)
@@ -66,6 +66,7 @@
 
   composer/qgscomposer.cpp
   composer/qgscomposeritem.cpp
+  composer/qgscomposeritemgroup.cpp
   composer/qgscomposerlabel.cpp
   composer/qgscomposerpicture.cpp
   composer/qgscomposermap.cpp

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp	2008-06-03 12:54:07 UTC (rev 8578)
@@ -65,7 +65,10 @@
 #ifdef QGISDEBUG
   std::cout << "QgsComposer::QgsComposer" << std::endl;
 #endif
-
+ 
+  setMouseTracking(true);
+  mSplitter->setMouseTracking(true);
+  mViewFrame->setMouseTracking(true);
   mView = new QgsComposerView ( this, mViewFrame);
   mPrinter = 0;
 
@@ -172,6 +175,7 @@
       return;
     }
 
+  mItemStackedWidget->removeWidget(currentWidget);
   mItemStackedWidget->addWidget(newWidget);
 }
 
@@ -873,7 +877,23 @@
   mActionAddImage->setOn ( true );
   mView->setCursor(QCursor(cross_hair_cursor));
 }
+ 
+void QgsComposer::on_mActionGroupItems_activated(void)
+{
+  if(mComposition)
+    {
+      mComposition->groupItems();
+    }
+}
 
+void QgsComposer::on_mActionUngroupItems_activated(void)
+{
+  if(mComposition)
+    {
+      mComposition->ungroupItems();
+    }
+}
+
 void QgsComposer::moveEvent ( QMoveEvent *e ) { saveWindowState(); }
 
 void QgsComposer::resizeEvent ( QResizeEvent *e )

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposer.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposer.h	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposer.h	2008-06-03 12:54:07 UTC (rev 8578)
@@ -149,6 +149,12 @@
     //! Add new picture
     void on_mActionAddImage_activated(void);
 
+    //! Group selected items 
+    void on_mActionGroupItems_activated(void);
+
+    //! Ungroup selected item group
+    void on_mActionUngroupItems_activated(void);
+
     //! read project
     void projectRead();
 

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp	2008-06-03 12:54:07 UTC (rev 8578)
@@ -74,6 +74,7 @@
 
 void QgsComposerItem::mouseMoveEvent ( QGraphicsSceneMouseEvent * event )
 {
+  qWarning("QgsComposerItem::mouseMoveEvent");
   if(mBoundingResizeRectangle)
     {
       double diffX = event->lastPos().x() - mLastMouseEventPos.x();
@@ -151,17 +152,6 @@
   setCursor(Qt::ArrowCursor);
 }
 
-void QgsComposerItem::hoverEnterEvent ( QGraphicsSceneHoverEvent * event )
-{
-  qWarning("QgsComposerItem::hoverEnterEvent");
-}
-
-void QgsComposerItem::hoverMoveEvent( QGraphicsSceneHoverEvent * event )
-{
-  qWarning("QgsComposerItem::hoverMoveEvent");
-  setCursor(QCursor(cursorForPosition(event->pos())));
-}
-
 Qt::CursorShape QgsComposerItem::cursorForPosition(const QPointF& itemCoordPos)
 {
   QgsComposerItem::mouseMoveAction mouseAction = mouseMoveActionForPosition(itemCoordPos);
@@ -317,6 +307,13 @@
     }
 }
 
+void QgsComposerItem::move(double dx, double dy)
+{
+  QTransform newTransform;
+  newTransform.translate(transform().dx() + dx, transform().dy() + dy);
+  setTransform(newTransform);
+}
+
 void QgsComposerItem::setSceneRect(const QRectF& rectangle)
 {
   //setRect in item coordinates

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposeritem.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposeritem.h	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposeritem.h	2008-06-03 12:54:07 UTC (rev 8578)
@@ -73,9 +73,12 @@
     /** delete settings from project file  */
     virtual bool removeSettings( void );
 
-    /** resizes an item in x- and y direction (canvas coordinates)*/
+    /** resizes an item in x- and y direction (scene coordinates)*/
     virtual void resize(double dx, double dy){}
 
+    /** moves the whole item in scene coordinates*/
+    virtual void move(double dx, double dy);
+
     /**Sets this items bound in scene coordinates such that 1 item size units
      corresponds to 1 scene size unit*/
     virtual void setSceneRect(const QRectF& rectangle);
@@ -94,6 +97,10 @@
     bool frame() const {return mFrame;}
     void setFrame(bool drawFrame){mFrame = drawFrame;}
 
+    /**Composite operations for item groups do nothing per default*/
+    virtual void addItem(QgsComposerItem* item) {}
+    virtual void removeItems() {}
+
 protected:
     QgsComposition::PlotStyle mPlotStyle;
     int mId;
@@ -114,9 +121,6 @@
     virtual void mouseMoveEvent ( QGraphicsSceneMouseEvent * event );
     virtual void mousePressEvent ( QGraphicsSceneMouseEvent * event );
     virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
-    
-    virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event );
-    virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
 
     /**Finds out the appropriate cursor for the current mouse position in the widget (e.g. move in the middle, resize at border)*/
     Qt::CursorShape cursorForPosition(const QPointF& itemCoordPos);
@@ -134,13 +138,13 @@
     void rectangleChange(double dx, double dy, double& mx, double& my, double& rx, double& ry) const;
 
     /**Draw selection boxes around item*/
-    void drawSelectionBoxes(QPainter* p);
+    virtual void drawSelectionBoxes(QPainter* p);
 
     /**Draw black frame around item*/
-    void drawFrame(QPainter* p);
+    virtual void drawFrame(QPainter* p);
 
     /**Draw background*/
-    void drawBackground(QPainter* p);
+    virtual void drawBackground(QPainter* p);
 };
 
 #endif

Added: branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.cpp	                        (rev 0)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.cpp	2008-06-03 12:54:07 UTC (rev 8578)
@@ -0,0 +1,140 @@
+/***************************************************************************
+                         qgscomposeritemgroup.cpp
+                         ------------------------
+    begin                : 2nd June 2008
+    copyright            : (C) 2008 by Marco Hugentobler
+    email                : marco dot hugentobler at karto dot baug dot ethz dot ch
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "qgscomposeritemgroup.h"
+#include "qgscomposition.h"
+#include "qgscomposer.h" //probably use other approach to delete items because including this in a composer class is ugly
+#include <QPen>
+#include <QPainter>
+
+QgsComposerItemGroup::QgsComposerItemGroup(QgsComposition* c, QGraphicsItem* parent): QgsComposerItem(parent), mComposition(c)
+{
+  setZValue(50);
+  show();
+}
+
+QgsComposerItemGroup::~QgsComposerItemGroup()
+{
+  //todo: notify composition to delete child items too
+  //QgsComposer::removeItem(QgsComposerItem* item)
+
+  if(!mComposition)
+    {
+      return;
+    }
+
+  QgsComposer* composer = mComposition->composer();
+  if(!composer)
+    {
+      return;
+    }
+  
+  QSet<QgsComposerItem*>::iterator itemIt = mItems.begin();
+  for(; itemIt != mItems.end(); ++itemIt)
+    {
+      composer->removeItem(*itemIt);
+    }
+}
+ 
+void QgsComposerItemGroup::addItem(QgsComposerItem* item)
+{
+  if(!item)
+    {
+      return;
+    }
+
+  if(mItems.contains(item))
+    {
+      return;
+    }
+  mItems.insert(item);
+  item->setSelected(false);
+
+  //update extent (which is in scene coordinates)
+  double minXItem = item->transform().dx();
+  double minYItem = item->transform().dy();
+  double maxXItem = minXItem + item->rect().width();
+  double maxYItem = minYItem + item->rect().height();
+
+  if(mSceneBoundingRectangle.isEmpty()) //we add the first item
+    {
+      mSceneBoundingRectangle.setLeft(minXItem);
+      mSceneBoundingRectangle.setTop(minYItem);
+      mSceneBoundingRectangle.setRight(maxXItem);
+      mSceneBoundingRectangle.setBottom(maxYItem);
+    }
+
+  else
+    {
+      if(minXItem < mSceneBoundingRectangle.left())
+	{
+	  mSceneBoundingRectangle.setLeft(minXItem);
+	}
+      if(minYItem < mSceneBoundingRectangle.top())
+	{
+	  mSceneBoundingRectangle.setTop(minYItem);
+	}
+      if(maxXItem > mSceneBoundingRectangle.right())
+	{
+	  mSceneBoundingRectangle.setRight(maxXItem);
+	}
+      if(maxYItem > mSceneBoundingRectangle.bottom())
+	{
+	  mSceneBoundingRectangle.setBottom(maxYItem);
+	}
+    }
+
+  setSceneRect(mSceneBoundingRectangle);
+
+}
+
+void QgsComposerItemGroup::removeItems()
+{
+  mItems.clear();
+}
+
+void QgsComposerItemGroup::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
+{
+  drawFrame(painter);
+  if(isSelected())
+    {
+      drawSelectionBoxes(painter);
+    }
+}
+
+void QgsComposerItemGroup::move(double dx, double dy)
+{
+  QSet<QgsComposerItem*>::iterator item_it = mItems.begin();
+  for(; item_it != mItems.end(); ++item_it)
+    {
+      (*item_it)->move(dx, dy);
+    }
+  QgsComposerItem::move(dx, dy);
+}
+
+void QgsComposerItemGroup::drawFrame(QPainter* p)
+{
+  if(mFrame)
+    {
+      QPen newPen(pen());
+      newPen.setStyle(Qt::DashLine);
+      newPen.setColor(QColor(128, 128, 128, 128));
+      p->setPen(newPen);
+      p->setRenderHint(QPainter::Antialiasing, true);
+      p->drawRect (QRectF( 0, 0, rect().width(), rect().height()));
+    }
+}

Added: branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.h	                        (rev 0)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposeritemgroup.h	2008-06-03 12:54:07 UTC (rev 8578)
@@ -0,0 +1,46 @@
+/***************************************************************************
+                         qgscomposeritemgroup.h
+                         ----------------------
+    begin                : 2nd June 2008
+    copyright            : (C) 2008 by Marco Hugentobler
+    email                : marco dot hugentobler at karto dot baug dot ethz dot ch
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "qgscomposeritem.h"
+#include <QSet>
+class QgsComposition;
+
+class QgsComposerItemGroup: public QgsComposerItem
+{
+ public:
+  QgsComposerItemGroup(QgsComposition* c, QGraphicsItem* parent = 0);
+  ~QgsComposerItemGroup();
+  /**Adds an item to the group. All the group members are deleted 
+   if the group is deleted*/
+  void addItem(QgsComposerItem* item);
+  /**Removes the items but does not delete them*/
+  void removeItems();
+  /**Draw outline and ev. selection handles*/
+  void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
+  /**Moves all contained items by dx/dy*/
+  void move(double dx, double dy);
+
+ protected:
+  void drawFrame(QPainter* p);
+
+ private:
+  QSet<QgsComposerItem*> mItems;
+  QgsComposition* mComposition;
+  QRectF mSceneBoundingRectangle;
+};
+
+

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerview.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerview.cpp	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerview.cpp	2008-06-03 12:54:07 UTC (rev 8578)
@@ -29,7 +29,7 @@
 
 // Note: |WRepaintNoErase|WResizeNoErase|WStaticContents doeen't make it faster
 QgsComposerView::QgsComposerView( QgsComposer *composer, QWidget* parent, const char* name, Qt::WFlags f) :
-                                  QGraphicsView(parent)
+  QGraphicsView(parent), mShiftKeyPressed(false)
 //,name,f|Qt::WNoAutoErase|Qt::WResizeNoErase|Qt::WStaticContents
 {
     mComposer = composer;
@@ -39,11 +39,11 @@
 
 void QgsComposerView::mousePressEvent(QMouseEvent* e)
 {
-    mComposer->composition()->mousePressEvent(e);
-    if(mComposer->composition()->tool() == QgsComposition::Select)
-      {
-	QGraphicsView::mousePressEvent(e);
-      }
+  mComposer->composition()->mousePressEvent(e, mShiftKeyPressed);
+  if(mComposer->composition()->tool() == QgsComposition::Select)
+    {
+      QGraphicsView::mousePressEvent(e);
+    }
 }
 
 void QgsComposerView::mouseReleaseEvent(QMouseEvent* e)
@@ -67,9 +67,21 @@
 
 void QgsComposerView::keyPressEvent ( QKeyEvent * e )
 {
-    mComposer->composition()->keyPressEvent ( e );
+  if(e->key() == Qt::Key_Shift)
+    {
+      mShiftKeyPressed = true;
+    }
+  mComposer->composition()->keyPressEvent ( e );
 }
 
+void QgsComposerView::keyReleaseEvent ( QKeyEvent * e )
+{
+  if(e->key() == Qt::Key_Shift)
+    {
+      mShiftKeyPressed = false;
+    }
+}
+
 void QgsComposerView::resizeEvent ( QResizeEvent *  )
 {
 #ifdef QGISDEBUG

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerview.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerview.h	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerview.h	2008-06-03 12:54:07 UTC (rev 8578)
@@ -39,10 +39,12 @@
     void mouseMoveEvent(QMouseEvent*);
 
     void keyPressEvent ( QKeyEvent * e );
+    void keyReleaseEvent ( QKeyEvent * e );
     void resizeEvent ( QResizeEvent *  );
 
 private:
     QgsComposer *mComposer;
+    bool mShiftKeyPressed;
 
 };
 

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposition.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposition.cpp	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposition.cpp	2008-06-03 12:54:07 UTC (rev 8578)
@@ -19,6 +19,7 @@
 
 #include "qgscomposer.h"
 #include "qgscomposeritem.h"
+#include "qgscomposeritemgroup.h"
 #include "qgscomposerlabel.h"
 
 #include "qgscomposermap.h"
@@ -220,7 +221,7 @@
   }
 }
 
-void QgsComposition::mousePressEvent(QMouseEvent* e)
+void QgsComposition::mousePressEvent(QMouseEvent* e, bool shiftKeyPressed)
 {
 #ifdef QGISDEBUG
   std::cerr << "QgsComposition::mousePressEvent() mTool = " << mTool << " mToolStep = "
@@ -246,17 +247,15 @@
 	QgsComposerItem* selectedItem = dynamic_cast<QgsComposerItem*>(newItem);
 	if(selectedItem)
 	  {
-	    selectedItem->setSelected(true);
-	    if(selectedItem != mSelectedItem)
+	    if(!shiftKeyPressed)
 	      {
-		if(mSelectedItem)
-		  {
-		    mSelectedItem->setSelected(false);
-		  }
-		mSelectedItem = selectedItem;
-		mCanvas->update();
-		mComposer->showItemOptions(selectedItem);
+		canvas()->clearSelection();
 	      }
+	    
+	    //toggle selection state of selected item
+	    bool currentSelectState = selectedItem->isSelected();
+	    selectedItem->setSelected(!currentSelectState);
+	    mComposer->showItemOptions(selectedItem);
 	  }
 	break;
   }
@@ -534,33 +533,52 @@
   std::cout << "QgsComposition::keyPressEvent() key = " << e->key() << std::endl;
 #endif
 
-  if(!mSelectedItem)
-    {
-      return;
-    }
+  QList<QGraphicsItem *> selectionList = canvas()->selectedItems();
 
   if ( e->key() == Qt::Key_Delete) { // delete
 
-    QgsComposerItem *coi = dynamic_cast <QgsComposerItem *> (mSelectedItem);
-    mComposer->removeItem(coi);
+    QList<QGraphicsItem *> selectionList = canvas()->selectedItems();
+    QList<QGraphicsItem *>::iterator sIt = selectionList.begin();
+    for(; sIt != selectionList.end(); ++sIt)
+      {
+	mComposer->removeItem(dynamic_cast<QgsComposerItem *>(*sIt));
+      }
+
     mSelectedItem = 0;
     mCanvas->update();
   }
-  else if(e->key() == Qt::Key_Left)
+
+  if(e->key() == Qt::Key_Left)
     {
-      mSelectedItem->moveBy(-1.0, 0.0);
+      QList<QGraphicsItem *>::iterator sIt = selectionList.begin();
+      for(; sIt != selectionList.end(); ++sIt)
+	{
+	  ((QgsComposerItem*)(*sIt))->move(-1.0, 0.0);
+	}
     }
   else if(e->key() == Qt::Key_Right)
     {
-      mSelectedItem->moveBy(1.0, 0.0);
+      QList<QGraphicsItem *>::iterator sIt = selectionList.begin();
+      for(; sIt != selectionList.end(); ++sIt)
+	{
+	  ((QgsComposerItem*)(*sIt))->move(1.0, 0.0);
+	}
     }
   else if(e->key() == Qt::Key_Down)
     {
-      mSelectedItem->moveBy(0.0, 1.0);
+      QList<QGraphicsItem *>::iterator sIt = selectionList.begin();
+      for(; sIt != selectionList.end(); ++sIt)
+	{
+	  ((QgsComposerItem*)(*sIt))->move(0.0, 1.0);
+	}
     }
   else if(e->key() == Qt::Key_Up)
     {
-      mSelectedItem->moveBy(0.0, -1.0);
+      QList<QGraphicsItem *>::iterator sIt = selectionList.begin();
+      for(; sIt != selectionList.end(); ++sIt)
+	{
+	  ((QgsComposerItem*)(*sIt))->move(0.0, -1.0);
+	}
     }
 }
 
@@ -808,6 +826,53 @@
   mToolStep = 0;
 }
 
+void QgsComposition::groupItems()
+{
+  if(!mComposer || !canvas())
+    {
+      return;
+    }
+  QList<QGraphicsItem *> selectedItems = canvas()->selectedItems();
+
+  if(selectedItems.size() < 2)
+    {
+      return; //not enough items for a group
+    }
+
+  QgsComposerItemGroup* itemGroup = new QgsComposerItemGroup(this, 0);
+
+  QList<QGraphicsItem *>::iterator itemIt = selectedItems.begin();
+  for(; itemIt != selectedItems.end(); ++itemIt)
+    {
+      itemGroup->addItem((QgsComposerItem*)(*itemIt));
+    }
+
+  mComposer->addItem(itemGroup, 0);
+  mCanvas->addItem(itemGroup);
+  itemGroup->setSelected(true);
+  mComposer->showItemOptions(0);
+}
+
+void QgsComposition::ungroupItems()
+{
+  if(!mComposer || !canvas())
+    {
+      return;
+    }
+  QList<QGraphicsItem *> selectedItems = canvas()->selectedItems();
+  QList<QGraphicsItem *>::iterator itemIt = selectedItems.begin();
+  for(; itemIt != selectedItems.end(); ++itemIt)
+    {
+      QgsComposerItemGroup* itemGroup = dynamic_cast<QgsComposerItemGroup*>(*itemIt);
+      if(itemGroup)
+	{
+	  itemGroup->removeItems();
+	  mCanvas->removeItem(itemGroup);
+	  mComposer->removeItem(itemGroup);
+	}
+    }
+}
+
 std::vector<QgsComposerMap*> QgsComposition::maps(void) 
 {
   std::vector<QgsComposerMap*> v;

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposition.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposition.h	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposition.h	2008-06-03 12:54:07 UTC (rev 8578)
@@ -152,7 +152,7 @@
     QGraphicsScene *canvas(void);
     
     /** \brief recieves mousePressEvent from view */
-    void mousePressEvent(QMouseEvent*);
+    void mousePressEvent(QMouseEvent*, bool shiftKeyPressed = false);
     
     /** \brief recieves mouseReleaseEvent from view */
     void mouseReleaseEvent(QMouseEvent*);
@@ -172,6 +172,12 @@
     /**  \brief Set tool */
     void setTool ( Tool tool );
 
+    /**Insert a group containing the selected items*/
+    void groupItems();
+
+    /**Removes items from selected group and also the group item*/
+    void ungroupItems();
+
     /** Refresh. Refresh objects which are not updated automaticaly, e.g. map object does not know
      * if a layer was switched on/off. Later should be substituted by appropriate signals 
      * se by map canvas */

Modified: branches/advanced_printing_branch/src/ui/qgscomposerbase.ui
===================================================================
--- branches/advanced_printing_branch/src/ui/qgscomposerbase.ui	2008-06-03 12:35:22 UTC (rev 8577)
+++ branches/advanced_printing_branch/src/ui/qgscomposerbase.ui	2008-06-03 12:54:07 UTC (rev 8578)
@@ -234,6 +234,8 @@
    <addaction name="mActionAddNewVectLegend" />
    <addaction name="mActionAddNewScalebar" />
    <addaction name="mActionSelectMoveItem" />
+   <addaction name="mActionGroupItems" />
+   <addaction name="mActionUngroupItems" />
   </widget>
   <action name="mActionOpenTemplate" >
    <property name="icon" >
@@ -355,6 +357,16 @@
     <string>Add Image</string>
    </property>
   </action>
+  <action name="mActionGroupItems" >
+   <property name="text" >
+    <string>Group Items</string>
+   </property>
+  </action>
+  <action name="mActionUngroupItems" >
+   <property name="text" >
+    <string>Ungroup items</string>
+   </property>
+  </action>
  </widget>
  <tabstops>
   <tabstop>mOptionsTabWidget</tabstop>



More information about the QGIS-commit mailing list