14 авг. 2013 г. 21:59 пользователь "Sven Putze" <
[email protected]> написал:
>
> Hi,
>
> do you accept the event for the top level window? Then this would explain
why you/the user can see the "accepting" cursor everywhere.
> I would suggest to accept (and handle) the event per widget/drop area.

Ok, let me explain again. I need to know when items are dragged over my
app. So I need to know:

1. When dragged items enters my app. MainWindow::dragEnterEvent()

2. When dragged items leave my app. MainWindow::dragLeaveEvent(). But
handler is only activated when QDragEnterEvent was accepted previously. I
accept it and set accepted actions to Qt::IgnoreActon so user see
"forbidden" cursor. To make sure that items really no longer inside my app,
I check if QCursor::pos() is outside.

3. When items are dropped on widget supporting drop. Pretty easy, just use
MyWidget::dropEvent().

4. When dragged items are dropped inside my app, but on place which doesn't
support drop. And here is a problem: MainWindow::dropEvent() is not called
if acceptedActions is set to Qt::IgnoreActon. So I get
MainWindow::dragLeaveEvent() instead.
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to