{
QByteArray data
= event
->mimeData
()->data
("text/uri-list");
if ( event->mimeData()->hasFormat("application/x-stompbox") ||
uri.contains(".syx", Qt::CaseInsensitive) &&
event->answerRect().intersects(this->geometry()) )
{
if (children().contains(event->source()))
{
event->setDropAction(Qt::MoveAction);
event->accept();
} else {
event->acceptProposedAction();
};
} else {
event->ignore();
};
};
void floorBoard::dragMoveEvent(QDragMoveEvent *event)
{
QByteArray data = event->mimeData()->data("text/uri-list");
QString uri(data);
if ( event->mimeData()->hasFormat("application/x-stompbox") ||
uri.contains(".syx", Qt::CaseInsensitive) &&
event->answerRect().intersects(this->geometry()) )
{
if (children().contains(event->source()))
{
event->setDropAction(Qt::MoveAction);
event->accept();
} else {
event->acceptProposedAction();
};
} else {
event->ignore();
};
};
To copy to clipboard, switch view to plain text mode
I tried with adding event->answerRect().intersects(this->geometry()) but you can still drag items outside the mainwindow?
Bit lost here, I want the drag to stop when we are outside the window but it is still active when moving over other apps like firefox.
Bookmarks