Skip to content
Permalink
Browse files
Legend: allow swapping of legend layers between toplevel layers and l…
…ayers in a group (motivated by ticket #148 'Legend groups capture legend items')

git-svn-id: http://svn.osgeo.org/qgis/trunk@5586 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 12, 2006
1 parent 9712510 commit 863c74a3853695f58b8cfc189bb2387151df9ccf
Showing with 14 additions and 14 deletions.
  1. +10 −10 src/legend/qgslegend.cpp
  2. +1 −1 src/legend/qgslegenditem.h
  3. +3 −3 src/legend/qgslegendlayer.cpp
@@ -228,21 +228,21 @@ void QgsLegend::mouseMoveEvent(QMouseEvent * e)
{
if(origin->parent() != dest->parent())
{
dest->parent()->insertChild(dest->parent()->childCount(), origin);
origin->moveItem(dest);
dest->moveItem(origin);
}
moveItem(origin, dest);
moveItem(dest, origin);
}
else
{
dest->moveItem(origin);
}
}
}
{
moveItem(dest, origin);
}
}
}
else //over top of item
{
if (mItemBeingMoved != dest->nextSibling())
{
origin->moveItem(dest);
//origin->moveItem(dest);
moveItem(origin, dest);
}
}
setCurrentItem(origin);
@@ -85,7 +85,7 @@ class QgsLegendItem : public QTreeWidgetItem
QgsLegendItem* nextSibling();
/**Returns the younger sibling or 0 if this item is the first child of its parent*/
QgsLegendItem* findYoungerSibling();
/**Moves this item after as an older sibling after another item*/
/**Moves this item after (as an older sibling) another item*/
void moveItem(QgsLegendItem* after);
/**Removes all the children of this item. This function is for qt-4.0.1 compatibility, where
'takeChildren()' does not yet exist*/
@@ -93,10 +93,10 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept(const QgsLegendItem* li) const
LEGEND_ITEM_TYPE type = li->type();
if ( type == LEGEND_LAYER)
{
if(parent() == li->parent())
{
//if(parent() == li->parent())
//{
return REORDER;
}
//}
}
else if(type == LEGEND_GROUP)
{

0 comments on commit 863c74a

Please sign in to comment.