Skip to content

Commit

Permalink
Legend: allow swapping of legend layers between toplevel layers and l…
Browse files Browse the repository at this point in the history
…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 863c74a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/legend/qgslegend.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/legend/qgslegenditem.h
Expand Up @@ -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*/
Expand Down
6 changes: 3 additions & 3 deletions src/legend/qgslegendlayer.cpp
Expand Up @@ -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)
{
Expand Down

0 comments on commit 863c74a

Please sign in to comment.