Os X Yosemite Qt drag and drop file name bug

后端 未结 2 1098
长发绾君心
长发绾君心 2020-12-17 01:14

I was trying to use a simple drag and drop feature in my Qt app. Here is my code:

MyWindow::MyWindow(QWidget *parent)
{
    ..........
    setAcceptDrops(tru         


        
2条回答
  •  一生所求
    2020-12-17 01:55

    To apply the patch, you would need to download the Qt Sources (ex. use git) and then add the lines needed to retrieve the filepath instead of the fileId using the:

    QUrl::fromNSURL([url.toNSURL() filePathURL]);
    

    method.

    Here is the part where it should be added: Patch Code

    When you did this, you need to build Qt and build your project with this patched version to take use of the changes you made.

提交回复
热议问题