I spend two day to dispay and edit the XSL-Fo format is similar from dock book KDE..
now i can not grab QTextDocument to resave to xml file.
Question:
Why QTextFrame can not find image or table? inside a QTextFrame::iterator from QTextDocument
Or is image part from fragment? how grab this?
i have one image and one table inside and iterator not find? why .. pleas help .
I not found any sample to iterate QTextDocument http://doc.trolltech.com/4.2/richtext-structure.html
Qt Code:
//////QTextDocument *w3 = fop.GetDoc() [ return QTextDocument->clone() ] XSL-FO format ; /////QTextFrame *Tframe = w3->rootFrame(); int speed = 0; qDebug() << "### iterator start ############################" << speed; /* QTextFrameFormat QTextFrame::frameFormat() const */ for (it = Tframe->begin(); !(it.atEnd()); ++it) { speed++; /* to find tree structure */ if (childFrame) { qDebug() << "### frame " << speed; } else if (para.isValid()) { qDebug() << "### block " << speed << " Paragraph ->" << para.text(); if (para.charFormat().isValid()) { /* QTextCharFormat */ qDebug() << "### inline span " << speed; if ( subpara.toImageFormat().isValid() ) { qDebug() << "### image " << speed; } else if ( subpara.toTableFormat().isValid() ) { qDebug() << "### table " << speed; } } } } qDebug() << "### iterator end ############################" << speed;To copy to clipboard, switch view to plain text mode
Bookmarks