File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,6 @@ void QgsLegend::mouseMoveEvent(QMouseEvent * e)
161
161
162
162
// remember item we've pressed as the one being moved
163
163
// and where it was originally
164
- // QTreeWidgetItem* item = itemAt(contentsToViewport(mLastPressPos));
165
164
QTreeWidgetItem* item = itemAt (mLastPressPos );
166
165
if (item)
167
166
{
Original file line number Diff line number Diff line change @@ -78,12 +78,12 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept(LEGEND_ITEM_TYPE type)
78
78
{
79
79
if ( type == LEGEND_LAYER || type == LEGEND_GROUP)
80
80
{
81
- return REORDER;
81
+ return REORDER;
82
82
}
83
83
else
84
- {
84
+ {
85
85
return NO_ACTION;
86
- }
86
+ }
87
87
}
88
88
89
89
QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept (const QgsLegendItem* li) const
@@ -94,7 +94,14 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayer::accept(const QgsLegendItem* li) const
94
94
if (li && li != this )
95
95
{
96
96
LEGEND_ITEM_TYPE type = li->type ();
97
- if ( type == LEGEND_LAYER || type == LEGEND_GROUP)
97
+ if ( type == LEGEND_LAYER)
98
+ {
99
+ if (parent () == li->parent ())
100
+ {
101
+ return REORDER;
102
+ }
103
+ }
104
+ else if (type == LEGEND_GROUP)
98
105
{
99
106
return REORDER;
100
107
}
You can’t perform that action at this time.
0 commit comments