'Reimplement Qt method
Inform Qt about the types of data that the widget accepts'

def dragEnterEvent(self, event):

    source = event.mimeData()
    if (source.hasUrls() and source.urls()):
        all_urls = mimedata2url(source)
        text = [encoding.is_text_file(url) for url in all_urls]
        if any(text):
            event.acceptProposedAction()
        else:
            event.ignore()
    elif source.hasText():
        event.acceptProposedAction()
    elif (os.name == 'nt'):
        event.acceptProposedAction()
    else:
        event.ignore()
