Qt World Summit: Submit your Presentation

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:


    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


    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