Results 1 to 2 of 2

Thread: dropEvent not being fired for files dragged in from Windows Explorer

  1. #1
    Join Date
    Aug 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default dropEvent not being fired for files dragged in from Windows Explorer

    I was playing around with drag and drop, and I noticed that when I dragged files in from Windows Explorer, I would see dragEnterEvent() firing, but not dropEvent(). It works fine when I drag in text from Notepad2 or Word.

    I tried to follow the directions from here: http://doc.trolltech.com/4.5/dnd.html#dropping. Basically, I subclassed a QTextEdit. I call setAcceptDrops( true ) in the constructor. dragEnterEvent() unconditionally calls acceptProposedAction() and accept() (I wasn't sure if both were needed or not). dropEvent() is never called.

    I see the same behavior on Windows 7 and Windows XP Pro.

    Am I missing something? I attached the full source from my Qt Creator project (Qt SDK 2009.03.01).
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2009
    Posts
    139
    Thanks
    13
    Thanked 59 Times in 52 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: dropEvent not being fired for files dragged in from Windows Explorer

    Works fine on Ubuntu, if that's of any help.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.