I have a "QFile myhtmlFile", is there a way to print that easy with
Qt4? I know there is QPrinter but I couldn't find where to set the
file I want to print, anyone?
thanx in advance
Patcito
I have a "QFile myhtmlFile", is there a way to print that easy with
Qt4? I know there is QPrinter but I couldn't find where to set the
file I want to print, anyone?
thanx in advance
Patcito
Use QPrinter.
Qt 5.3 Opensource & Creator 3.1.2
QPrinter is a paint device. You need to layout that html file using Qt richtext capabilities (QDocumentLayout probably) and paint that layout "on" the printer (like you were using a QPainter).
To print a content of a HTML file, you would need to use a QTextDocument. I would use something like the following to do it:
HTH
Qt Code:To copy to clipboard, switch view to plain text mode
and what to do if the file I have to print is a binary file (for instance pdf file, .doc file )??
Thank you for your help
Roby
You have to have an application that understands these types of files.
Bookmarks