[Qt-interest] Drag&Drop on OS X behaves weird

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Mon Jan 3 10:09:11 CET 2011


On 2010-12-31 Nikos Nikos Chantziaras wrote:

> ...
>   void dropEvent( QDropEvent* e )
>   {
>      if (ok_to_open_a_file) {
>          schedule_file_open(e->mimeData()->urls().at(0).toLocalFile());
>          e->acceptProposedAction(); } else { e->ignore();
>      }
>   }

Looks good to me.

> I'm on Qt 4.7.1.

I am on the same Qt version and also on Mac, which is OS X 10.6.5 (latest), I implemented drag'n'drop onto a QGraphicsScene without the mentioned problems (no freezes - will check the keyboard/shortcut input, however so far I did not notice anything strange). However I do not open any files (yet), I check the MIME data for pixmap data and my own data structures, and paste from memory (e.g. an image dragged from Firefox onto my app works without problems). So that is the difference so far between your and my drag'n'drop operation.

What does your "schedule_file_open()" do? I guess that's where the interesting part would be for us to know what could go wrong.

Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22





More information about the Qt-interest-old mailing list