user63898
user63898

Reputation: 30895

using QtWebkit headless in Qt GUI app

i need to use Qtwebkit functions in GUI application but i do not want to view the webkit in my GUI app. the main function is to render HTML to pdf . i know i can do it with QtWebkit headless.

Upvotes: 0

Views: 498

Answers (1)

Ariya Hidayat
Ariya Hidayat

Reputation: 12561

Use QWebPage since it can work without displaying anything on the screen. Something like:

QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);

page->mainFrame->print(&printer);

Upvotes: 1

Related Questions