ドロップ ターゲットがアクティブ化されると、カーソルが元のドロップ ターゲットの上にある別のドロップ ターゲットに移動してもアクティブなままです。
QML のデモは次のとおりです。灰色と青色の領域にファイルをドロップしてみてください。青いものはアクティブになりません。
import QtQuick 2.1
Rectangle {
color: "grey"
width: 300
height: 300
DropArea {
anchors.fill: parent
onDropped: status.text = "Dropped on Grey";
}
Rectangle {
color: "blue"
anchors.fill: parent
anchors.margins: 80
DropArea {
anchors.fill: parent
# Never active!
onDropped: status.text = "Dropped on Blue"
}
}
Text {
x: 10
y: 10
id: status
text: "Nothing dropped"
}
}
グレーとブルーの両方の長方形へのドロップを実装するにはどうすればよいですか?