I actually solved the problem right now. Here is the solution:

Qt Code:
  1. QString returnActualPathForDroppedFile(QString aPath)
  2. {
  3. QUrl url(aPath);
  4. if (url.host().toLower() == QLatin1String("localhost"))
  5. url.setHost(QString());
  6. if (url.host().isEmpty() && url.path().startsWith(QLatin1String("/.file/id=")))
  7. {
  8. const QByteArray utf8 = aPath.toUtf8();
  9. const char* cString = utf8.constData();
  10. NSString *localFilePath = [[NSString alloc] initWithUTF8String:cString];
  11. NSURL *localFilePathURL = [NSURL fileURLWithPath:localFilePath];
  12. url = QUrl::fromNSURL([localFilePathURL filePathURL]);
  13. }
  14. url.setPath(url.path().normalized(QString::NormalizationForm_C));
  15. return url.toString();
  16. }
To copy to clipboard, switch view to plain text mode