[Qt-interest] droping a file

Puneet Bisht pbisht at nivio.com
Thu Mar 19 07:33:36 CET 2009


hi,
i m working on a ftp transfer,uploading file is working fine but now i m
trying to implement drag n drop ,i m droping a file in a QListWidget. By
droping file i m getting its absolute path ,but when i m trying to send
the file using QFile::put(sourcePath,DestinationPath) the file is not
opening.

i think the file is locked after droping.
 can anyone help me on this , how to open the file.

code is:

 void FtpWindow::uploadFile(const QString & clientPath, const QString &
serverPath)
 {

     QFile *File = new QFile(clientPath);
    bool fileOpen = File->open(QIODevice::ReadOnly);
    cout<<"file open===>"<<fileOpen<<endl;
    ftp->put(File->readAll(), serverPath);
    progressDialog->exec();
    File->close();
 }

bool variable fileOpen is printing false;

thanks in advance



More information about the Qt-interest-old mailing list