Fixed drop filtering in GridView.

This commit is contained in:
Luis Ángel San Martín 2016-04-18 17:21:54 +02:00
parent c052a82195
commit af235fb516

View File

@ -415,33 +415,23 @@ Rectangle {
} }
} }
//QTBUG-39453
//Another fu%$·#& bug in Qt
//https://bugreports.qt.io/browse/QTBUG-39453
//To solve this I am going to accept any input drag, drops will be filtered in "onDropped"
DropArea { DropArea {
anchors.fill: parent anchors.fill: parent
/*
onEntered: { onEntered: {
console.log("onEntered");
if(drag.hasUrls) if(drag.hasUrls)
{ {
console.log("HAS URLS -> ", drag.urls);
if(dropManager.canDropUrls(drag.urls, drag.action)) if(dropManager.canDropUrls(drag.urls, drag.action))
{ {
drag.accepted = true; drag.accepted = true;
console.log("canDropUrls");
}else }else
drag.accepted = false; drag.accepted = false;
} }
else if (dropManager.canDropFormats(drag.formats)) { else if (dropManager.canDropFormats(drag.formats)) {
drag.accepted = true; drag.accepted = true;
console.log("canDropFormats");
} else } else
drag.accepted = false; drag.accepted = false;
}*/ }
onDropped: { onDropped: {
if(drop.hasUrls && dropManager.canDropUrls(drop.urls, drop.action)) if(drop.hasUrls && dropManager.canDropUrls(drop.urls, drop.action))