Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Migration Qdropevent from qt4 to qt5



  • Hi,

    I am migrating some code for Qdropevent from qt to qt5 and I have found three methods that I cannot find the equivalent in qt5:

    QdropEvent:

    const char* format(int n = 0) const;
    QByteArray encodedData(const char*) const;
    bool provides(const char*) const;
    

    Could someone tell me what would be the equivalent in qt5 so I can keep the same functionality please?

    Thanks in advance.


  • Lifetime Qt Champion

    Hi,

    From a quick look, you will likely have to access the QMimeData object returned by the drop event to gather these informations.



  • Yes, I think I can do that. There is a method mimeData() that returns mdata.

    QMimeData *mimeData() const { return mdata; }

    Thank you for your help!


  • Lifetime Qt Champion

    You're welcome !

    Since you have your answer, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)


Log in to reply