Hi,
I need to help to solve this problem that the path is not correctly obtained. I am running the QT in Window7 environment.
I shared a folder from another computer and opened the folder using window. The path of the file is
\\yw-desk3\users\yw\qttest\videodata\0000.bmp.
When I drap and drop the file to my qt applications, it only get
users\yw\qttest\videodata\0000.bmp
So the file cannot be opened since the path is not correct. How should I fix the problem? Here is the code that I used.
void MainWindow::dropEvent(QDropEvent *event)
{
const QMimeData *mimeData = event->mimeData();
if (!mimeData->hasUrls() || mimeData->urls().size() < 1)
return;
// In both cases, we need to remove the leading '/' that
// remains after 'file:///C:/' is truncated to '/C:/'
QString path = mimeData->urls().at(0).path().remove(0, 1);
openColorComponent(path);
}
Thanks
Frank
Bookmarks