Skip to content

Commit 493aff4

Browse files
author
jef
committedOct 20, 2010
don't allow dropping layers into legend classes
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14420 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/app/legend/qgslegend.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,10 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
321321
updateLineWidget();
322322
scrollToItem( item );
323323

324+
mDropTarget = 0;
325+
324326
if ( item )
325327
{
326-
mDropTarget = item;
327328
showItem( "moveMoveEvent" , item );
328329

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

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

359+
mDropTarget = item;
357360
mDropAction = INSERT;
358361
}
359362
else
@@ -362,6 +365,7 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
362365
showLine( line_y, line_left );
363366
setCursor( QCursor( Qt::SizeVerCursor ) );
364367

368+
mDropTarget = item;
365369
mDropAction = AFTER;
366370
}
367371
}
@@ -389,7 +393,6 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
389393
else
390394
{
391395
QgsDebugMsg( "No item here" );
392-
mDropTarget = NULL;
393396
setCursor( QCursor( Qt::ForbiddenCursor ) );
394397
}
395398
}

0 commit comments

Comments
 (0)
Please sign in to comment.