Void MainWindow: : dragEnterEvent (QDragEnterEvent * e)
{
If (e - & gt; MimeData () - & gt; HasFormat (" text/uri - list ")) {//can only open the text file
E - & gt; AcceptProposedAction ();//can drag and drop on the widget object
}
}
You, why add this, in addition to the text file types of processing program and the file will still be recognition?