Hi BogDan, I have no solution for this problem, but I recognized the same behavior last week. I tried to use it for printing html with css instead of a QTextDocument.
Maybe we should submit this problem to the Bug Tracker Page? Greetings, Sebastian -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Samstag, 14. Juni 2008 10:41 An: [email protected] Betreff: [Qt4-preview-feedback] QWebFrame setHtml and render problem Hi Trolls, I can't use setHtml member of QWebFrame class. For me is not working (see the output of ->> qDebug()<<page.mainFrame()->toHtml();<<-). I made an example. //test.h #ifndef TEST_H #define TEST_H #include <QWidget> #include <QPaintEvent> #include <QPainter> #include <QWebPage> #include <QWebFrame> #include <QDebug> class Test : public QWidget { Q_OBJECT public: Test(QWidget *parent = 0): QWidget(parent){} protected: void paintEvent(QPaintEvent * event) { QWidget::paintEvent(event); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); painter.translate(50,50); painter.drawText(10,10,"Trolltech"); painter.translate(100,100); QWebPage page; page.mainFrame()->setHtml("<b>Trolltech</b>"); qDebug()<<page.mainFrame()->toHtml(); // page.mainFrame()->render(&painter,geometry()); page.mainFrame()->render(&painter); } }; #endif // main.cpp #include <QApplication> #include "test.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); Test t; t.show(); return app.exec(); } I use qt 4.4.0 (from debian unstable). Best regards, BogDan, _______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback _______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
