I'm trying to implement some Drag and Drop functionality in a program, and I only want to accept text files. Based off an example I found online I'm using the following funciton
Qt Code:
{ if (event->mimeData()->hasText()) { event->acceptProposedAction(); } }To copy to clipboard, switch view to plain text mode
If I drag a text file onto it from Explorer (only tested under Windows 7 65 bit so far) the code functions correctly. Where I'm getting confused and am not finding much documentation, is if I drag a non-text file onto it such as a BMP, PNG, PDF (the only three binary files I've tested with so far) the hasText() functions returns true. Any one have any suggestions as to what I may be doing wrong?
Bookmarks