I need to open a .chm file .
I've tried :
Qt Code:
To copy to clipboard, switch view to plain text mode
However , nothing is happened !!
Thanks .
I need to open a .chm file .
I've tried :
Qt Code:
To copy to clipboard, switch view to plain text mode
However , nothing is happened !!
Thanks .
I want to clarify something more ; that I need to open the chm file in order to make the user read the file .
Thanks .
It is not clear what do you mean by "in order to make the user read the file ."
In the docs it says:
Which means, that the extension .chm needs to be registered in the system as a file opened by a specific application - and is probably not the case on the system you are working on.If the URL is a reference to a local file (i.e. the URL scheme is "file") then it will be opened with a suitable application instead of a web browser.
But maybe what you mean is that you want to open the file for text editing.
In such a case, you can either use QProcess (and open it with a text editor), or read the file and show its content by your self on a QTextEdit or similar.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Thanks for your help.
I've meant by "in order to make the user read the file ." --> that the file to be opened just like if the user double clicked the .chm file .
Actually I've found out that my piece of code is working very fine .
It doesn't work as my path contains "spaces " .
I've solved this issue & saved headache by putting the .chm file I need to open beside my .exe .
Thanks .
Thnaks JPN .
It works fine & the space problem has been resolved by this approach .
Qt Code:
QDesktopServices::openUrl(QUrl::fromLocalFile("C:/Documents and Settings/Admin/Desktop/ubuntu.chm"));To copy to clipboard, switch view to plain text mode
Thanks .
Last edited by jpn; 24th July 2008 at 18:17. Reason: missing [code] tags
vycke (11th February 2009), WinchellChung (28th August 2008)
Bookmarks