Dear All
I have file in c:\windows\local files\temp\picture.jpg, I would like to open the file. How can I do it?
Dear All
I have file in c:\windows\local files\temp\picture.jpg, I would like to open the file. How can I do it?
the problem is not only a image, we have word files, excel files, we could read the file, but we could not open it.
please, show code what we do.
Qt Code:
{ return; } qint64 size = tmpFile->write ( ba1 ); if ( size != -1 ) { tmpFile->setFileName(realname); }To copy to clipboard, switch view to plain text mode
After this it saves the file to temp folder but I would like to open the file after that.
if you cooment this line
and then try to open this file, does it open?Qt Code:
... ...To copy to clipboard, switch view to plain text mode
What do you mean with 'open the file after that'? What you do is write it to disk and afterwards you try to start it as executable.
ok then should I write,
??Qt Code:
To copy to clipboard, switch view to plain text mode
your file isn't executable. you need specify needed program and your file as an argument.
somethig like this will work
Qt Code:
To copy to clipboard, switch view to plain text mode
for the file, I never know what the user saves,
It could be pdf, odt, dwg? So I dont know the program, any way to do it withour writing the program.
For what os do you write the program? Windows? Linux?
windows xp ...
then try to use ShellExecute or ShellExecuteEx.
If you're trying to open files in their respective applications, you might want to take a look at
openUrl in the QDesktopServices class:
aekilic (28th October 2008)
aekilic (28th October 2008)
tried this
didnt work...
Dear all thank you very much, I have just understand I made a mistake for the QUrl
Thank you very much again...
Bookmarks