[QGIS Commit] r11206 - trunk/qgis/src/app/legend
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Jul 29 17:04:59 EDT 2009
Author: mhugent
Date: 2009-07-29 17:04:58 -0400 (Wed, 29 Jul 2009)
New Revision: 11206
Modified:
trunk/qgis/src/app/legend/qgslegend.cpp
Log:
Fix for ticket 1745 (QGis crashes dragging a Legend Layer File over a Legend Layer File Group)
Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp 2009-07-29 18:16:32 UTC (rev 11205)
+++ trunk/qgis/src/app/legend/qgslegend.cpp 2009-07-29 21:04:58 UTC (rev 11206)
@@ -250,26 +250,26 @@
QgsLegendItem::DRAG_ACTION action = dest->accept( origin );
if ( yCoordAboveCenter( dest, e->y() ) ) //over center of item
{
-
- if ( action == QgsLegendItem::REORDER || action == QgsLegendItem::INSERT )
+ if ( action == QgsLegendItem::REORDER )
{
- QgsDebugMsg( "mouseMoveEvent::REORDER/INSERT top half" );
if ( origin->nextSibling() != dest )
{
- if ( origin->parent() != dest->parent() )
- {
- moveItem( origin, dest );
- moveItem( dest, origin );
- }
- else
- {
- moveItem( dest, origin );
- }
+ moveItem( dest, origin );setCurrentItem( origin );
}
+ setCurrentItem( origin );
setCursor( QCursor( Qt::SizeVerCursor ) );
+ }
+ else if ( action == QgsLegendItem::INSERT )
+ {
+ setCursor( QCursor( Qt::PointingHandCursor ) );
+ if ( origin->parent() != dest )
+ {
+ insertItem( origin, dest );
+ }
setCurrentItem( origin );
+ setCursor( QCursor( Qt::PointingHandCursor ) );
}
- else
+ else //no action
{
QgsDebugMsg( "mouseMoveEvent::NO_ACTION" );
More information about the QGIS-commit
mailing list