How to link to a PDF file in Qt Assistant? - qt

I use Qt Assistant as a help viewer and I have an internal link to a PDF file that is embedded into the compiled archive format. When I click on that link, nothing happens. How can I link to a PDF file that is embedded, click on the link and have an external application opened? I use Qt Assistant 4.7.3.

Short of bundling a program like Okular into your application release and launching it as an external process there isn't a native way of arriving at your solution. More options are discussed here as well, to sum it up it's either externally or converting the PDF to a QPixmap.

I don't think that this can work. To display a pdf file you need Acrobat or a similar (external) program, and this program needs a file to read. Why don't you store the pdf files outside the help file?

Related

Qt Creator and QML Live Preview

The problem now is that I don't know how I can use qml live preview?
I saw a video:
https://vimeo.com/145921618
I saw this post about erase this function for Qt Creator.
How i can implementlive coding into my app?
Perhaps you mean Terrarium?
Terrarium is a cross platform QML Playground: the view renders lively
as you type in the editor, makes prototyping and experimenting with
QtQuick a lot more fun!
It monitors changes in its TextEdit, and triggers the view to reload
source from the local http server. If you're looking for a file system
watcher implementation, please refer to QML LiveReload.
Or LiveReload?
As is evident from the video, this is as simple as auto reloading a QML file each time a chance to the file has been saved.
You can easily do that yourself, set up a QFileSystemWatcher and every time the file is modified, load the file in a QML view. And there you have it.
Of course, this is only good for previewing standalone components which can work on their own. You could go further, set the file system watcher to monitor the entire QML project and reload the main QML file every time something changes. It is a two step process, you need to monitor the directory, which only reflects adding or removing of files, and you subsequently add or remove those files from watching for changes.
Just for the sake of it, I want to share another tool that I found online.
It is a web based QML editor that gives immediate preview while writing the code. It has its limits, but still it's pretty useful for live QML coding
https://qmlweb.github.io/
If someone is still interested, in my Qt 5.10 installation, there is a qmlscene.exe in bin folder (same location as qmake or assistant). Running on command line is fine, however it is not in Qt creator.
PS: I found this:
http://doc.qt.io/qt-5/qtquick-qmlscene.html

simple javafx application to convert an mp4 file into mp3

I want to write a basic application that converts an mp4 file into an mp3 file using javafx, but I don't know the API's necessary to do so - if there are any.
Can you please assist me with code snippets?
You could use ffmpeg and a JavaFX gui.
But since it's "basic" as you say, you may as well use a batch command for it.

How to intergrate PDF viewer(display) in the GTK+ interface

Am working on the project in which am required to fetch files from the server and to display them on the client post.All of this is to be done in the UNIX environment where I used C language for coding client and server and GTK+ for the interface which will display files in the PDF format.
My problem is I do not know how can I intergrate a PDF viewer in such interface.
As the final results I would like when I select the file and click GTKbutton it displays the file in a PDF format in that intergrated viewer.
Check out the EvView and EvDocument libraries. They are not too well documented but it's a GTK widget for displaying PDFs and other documents.

Creating Documentation Using QtHelp Module

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.

Open PDF file in Qt

I want to read a .PDF file in Qt. I placed my .PDF file in the resource(qrc) folder.
How can i read the PDF file from there? I want to load a PDF file on the click of a button.
Read your pdf file via QFile, resource access is done by prepending the path in the resource with a ":".
Qt does not natively support displaying PDF documents (it can export them using QPrinter though). You can do it through third-party libraries such as Poppler, see this Qt Quarterly edition on how to do it.
FWIW the resource access information is the docs, and the PDF stuff I got off Google in 30 seconds. I expect a bit more research effort for someone with 7K+ rep points.

Resources