On parse and iterate QTextBlock i can find all elements! only <hr> horizzontal line i can not find, is this element hidden on a property qvariant nummer from QTextBlockFormat or QTextCharFormat.. ?

http://doc.trolltech.com/4.1/qtextfo...ml#intProperty

How i can find the objekt?

I wand to export my xhtml + class name that I have put on QTextBlockFormat Property..

Qt Code:
  1. HandleBlock( QTextBlock para , QDomElement appender )
  2. {
  3. QTextCharFormat paraformats;
  4. QDomElement paragraph = dom.createElement("p");
  5. QTextBlock::iterator de;
  6.  
  7. for (de = para.begin(); !(de.atEnd()); ++de) {
  8.  
  9. QTextFragment fr = de.fragment();
  10.  
  11. if (fr.isValid()) {
  12. const QTextCharFormat base = fr.charFormat();
  13. QTextImageFormat Pics = base.toImageFormat();
  14. QTextTableFormat Tabl = base.toTableFormat();
  15. QTextListFormat Uls = base.toListFormat();
  16.  
  17. if (Pics.isValid()) {
  18. ........ /// image
  19. } else if (Tabl.isValid()) {
  20. ........ /// table
  21. } else if (Uls.isValid()) {
  22. ........ //// ul li
  23. } else if (base.isAnchor() && base.anchorHref() !="" ) {
  24. ...... ///link
  25. } else if (para.charFormat() !=fr.charFormat()) {
  26. /* found diffs from fragment to paragraph ... */
  27. if (para.text() == fr.text()) {
  28. ///// no span only format append
  29. } else {
  30. ////span + format
  31. }
  32. } else {
  33.  
  34. QString txtfrag = fr.text();
  35. QString txt = Qt::escape(txtfrag);
  36. QString forcedLineBreakRegExp = QString::fromLatin1("[\\na]");
  37. forcedLineBreakRegExp[3] = QChar::LineSeparator;
  38. const QStringList lines = txt.split(QRegExp(forcedLineBreakRegExp));
  39.  
  40. if (lines.size() > 0) {
  41. for (int i = 0; i < lines.size(); ++i) {
  42. const QString piece = lines.at(i); //// .chop(1)
  43. paragraph.appendChild(dom.createTextNode(piece));
  44. if (piece != lines.last() ) {
  45. QDomElement breakline = dom.createElement("br");
  46. paragraph.appendChild(breakline);
  47. }
  48. }
  49. } else {
  50. paragraph.appendChild(dom.createTextNode(txtfrag)); //// .chop(1)
  51. }
  52.  
  53. }
  54.  
  55. }
  56.  
  57. }
  58. appender.appendChild(paragraph);
  59. }
To copy to clipboard, switch view to plain text mode