Skip to content

Commit

Permalink
don't allow dropping layers into legend classes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14420 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 20, 2010
1 parent 2195cce commit 493aff4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -321,9 +321,10 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
updateLineWidget();
scrollToItem( item );

mDropTarget = 0;

if ( item )
{
mDropTarget = item;
showItem( "moveMoveEvent" , item );

QgsLegendItem *litem = dynamic_cast<QgsLegendGroup *>( item );
Expand All @@ -341,6 +342,7 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
showLine( line_y, line_left );
setCursor( QCursor( Qt::SizeVerCursor ) );

mDropTarget = item;
mDropAction = BEFORE;
}
else // below center of item
Expand All @@ -354,6 +356,7 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
showLine( line_y, line_left );
setCursor( QCursor( Qt::SizeVerCursor ) );

mDropTarget = item;
mDropAction = INSERT;
}
else
Expand All @@ -362,6 +365,7 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
showLine( line_y, line_left );
setCursor( QCursor( Qt::SizeVerCursor ) );

mDropTarget = item;
mDropAction = AFTER;
}
}
Expand Down Expand Up @@ -389,7 +393,6 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
else
{
QgsDebugMsg( "No item here" );
mDropTarget = NULL;
setCursor( QCursor( Qt::ForbiddenCursor ) );
}
}
Expand Down

0 comments on commit 493aff4

Please sign in to comment.