PDA

View Full Version : opening a file using its Url in QFileDialog::getOpenFileName() not working in linux



netmat
16th February 2010, 12:22
Hi Forum,

I am using a QFileDialog::getOpenFileName() to open files in my application.
Its working fine for windows (XP).But there are two problems in linux (Ubuntu)

1) If the files I am selecting are in current working directory (that we pass as a parameter ), then only its working. And not for files in any other location.

2)passing an url for the file(if the file is in a server) is working in windows but not in linux.

Here is my code:

QString fileName = QFileDialog::getOpenFileName(this, tr("Open App"),
accessedPath,
tr("My App Files (*.plist | *.xml)");

In, linux for all above cases, the open button is just staying disabled.

Would you please, suggest me the possible solution foo this problem?

Thanks and Regards
~nemat

spirit
16th February 2010, 12:25
are you sure that accessedPath contains correct path?
what does this code prints in console?


qDebug() << accessedPath;

netmat
17th February 2010, 05:47
Hi Spirit,

accessedPath is pointing to right place. But it is ok for it to point anywhere right. Its just to say to what location
the dialog will point when opened. Then we can choose the file from any other location?