Qt provides two kinds of help files: Qt Compressed Help (.qch) and Qt Help Collection (.qhc).
The first one actually contains compressed help data (html pages, images etc). The second one contains references to different compressed help files.
Both Qt Assistant and QHelpEngine are using collection files to display help. So I need at least two files to provide documentation for my application: .qch and .qhc.
I want to have a single help file to be used by Qt Help API (e.g. like a .chm help file in Windows).
Is it possible?
I don't think it is possible to create a chm file using QtHelp module since chm files are Microsoft specific and not an independent format.
But all the chm files are opened by the hh.exe application that belongs to HTML Help workshop. I have accessed chm files for opening a specified html page using hh application.
You can have a look over here in my answer.
If there are command line options provided by Microsoft to compile chm files either by hh or through HTML Help workshop command line (if any), you can do that by running the command in QProcess. You have to probe more into that.
Or you can create chm files manually using HTML Help workshop and integrate the chm files into the application.
Hope that helps in giving you a start.
I have not tried this but have a look at chm2qch, Tool for converting Windows CHM files to Qt Help format.
Related
I want to translate a program; but its language files (.qm) are in a .rcc file.
The program is not mine, so I haven't got any .qrc file.
Before asking this question, I have searched this site about this issue; but I don't attain anything.
Is there any way to extract/decompile it?
You can take my tool RccExtended - it based on the official Qt resource compiler with additional function to decompile binary resources.
Usage example:
cd \Path\To\MyQtResources\
rcc --reverse
Decompiler will unpack all .rcc files in the current directory, generate .qrc files and make.bat file to compile resources back to the binary format.
There isn't a supported way to decompile it as far as I'm aware, but it's a binary file format that can be read and handled. There's a nodejs example of how to read the file and extract PNGs on github: https://github.com/gcochard/png-extractor. It may be possible to extend that method out for the .qm files.
However there's other issues with attempting to add more translations to a Qt application without having the code, depending on the language you're attempting to add, how the developer has exposed the other languages etc.
In my Qt application we can open a help file (chm) by doing the following:
QDesktopServices::openUrl(QUrl::fromLocalFile(_PathToTheCHMFile));
This seems to be the suggested way of doing things. And it has worked up until now.
However, the documentation team has now changed how the chm files work. Now we are referencing a "master" file which only contains references to other chm files. The directory structure of the chm files is as follows:
master.chm
SUBDIR/
-> child1.chm
-> child2.chm
...
If open the master.chm file with hh.exe (the default tool in windows), everything looks perfect. However, from my Qt application, the help file opens, but there are no sub topics, just the root node.
I assume this is a search path issue, and it can't resolve the relative paths. There doesn't seem to be any way to configure the openURL call to run from a certain directory, or anything like that.
Thanks in advance
If you need to be able to access those elements properly, then you may need to change your applications current directory on the fly.
http://qt-project.org/doc/qt-4.8/qdir.html#details
http://qt-project.org/doc/qt-4.8/qdir.html#setCurrent
If that doesn't work, you may want to look into using QProcess::startDetached
http://qt-project.org/doc/qt-4.8/qprocess.html#startDetached
and specifying the working directory to be exactly where your master.chm is located.
You may want to specify some command-line arguments, too.
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_command.htm
Hope that helps.
I have some files whose extension is qzip, for example a.qzip.
It seems that those files are compressed with a library of qt.
Could anyone tell me what it is?
Thankyou very much.
According to this FAQ page:
Qt uses the zlib library to provide compression. This means that you can compress and decompress your bytearrays of data using Qt. [...]
Note that this does not produce file archives that can be opened by other applications, to do that you will need to write it yourself using Qt’s custom file handling system or use a 3rd party library.
Which if someone (lazily) created a file using qCompress() you would need to write your own code to read the file as a QByteArray then use the corresponding qUncompress() method to read it. There is no official qzip format related to Qt that I know, so you should probably go and slap the developer who made these files if it works out!
In general, if you want to compress data that will be reusable, use a common file format.
This was the only reference I have found on the entire www over qzip.
quicklz
I have been looking at QHelpEngine and QHelpEngineCore, and I was wondering if there is a nice guide on how to start making a help file.
QAssistant was theviewer for html help files.
The new QHelp framework uses a single compiled help file and includes a set of classes to implement a viewer in your app and some standalone tools to build the help file
Ironically I find it difficult to locate this information in the Qt manual. It's under QAssistant.
Ho can I combine multiple pdfs(using url path) into one using tool like iText.
I am able to combine pdfsfrom my c# code using iText when the files are stored on my hard disk(local path).
But unable to combine when I am given the url to pdfs.
Thanks in advance
-Naresh
The PDF files must be downloaded in order to be combined.
So the question is: who will download the files, your app or the lib you are using?
PDFsharp cannot download PDF files from URLs yet. This could be implemented but I think it doesn't make much sense; you're much more flexible if you download the PDF files with your own code, retrying the download if it failed if you want.
Downloading them to MemoryStreams will do, no need to create temporary files.
I don't know if iText or iTextSharp will do the download for you.