Qt 4.8
Classes | Public Types | Public Functions | Private Types | Private Functions | Properties | Friends | List of all members
QTextHtmlImporter Class Reference

#include <qtextdocumentfragment_p.h>

Inheritance diagram for QTextHtmlImporter:
QTextHtmlParser

Classes

struct  List
 
struct  RowColSpanInfo
 
struct  Table
 
struct  TableCellIterator
 

Public Types

enum  ImportMode { ImportToFragment, ImportToDocument }
 
- Public Types inherited from QTextHtmlParser
enum  Margin { MarginTop, MarginRight, MarginBottom, MarginLeft }
 

Public Functions

void import ()
 
 QTextHtmlImporter (QTextDocument *_doc, const QString &html, ImportMode mode, const QTextDocument *resourceProvider=0)
 
- Public Functions inherited from QTextHtmlParser
const QTextHtmlParserNodeat (int i) const
 
int bottomMargin (int i) const
 
int bottomPadding (int i) const
 
int count () const
 
int depth (int i) const
 
void dumpHtml ()
 
int last () const
 
int leftMargin (int i) const
 
int leftPadding (int i) const
 
QTextHtmlParserNodeoperator[] (int i)
 
void parse (const QString &text, const QTextDocument *resourceProvider)
 
int rightMargin (int i) const
 
int rightPadding (int i) const
 
int topMargin (int i) const
 
int topPadding (int i) const
 

Private Types

enum  ProcessNodeResult { ContinueWithNextNode, ContinueWithCurrentNode, ContinueWithNextSibling }
 
enum  WhiteSpace { RemoveWhiteSpace, CollapseWhiteSpace, PreserveWhiteSpace }
 

Private Functions

void appendBlock (const QTextBlockFormat &format, QTextCharFormat charFmt=QTextCharFormat())
 
bool appendNodeText ()
 
bool closeTag ()
 
ProcessNodeResult processBlockNode ()
 
ProcessNodeResult processSpecialNodes ()
 
Table scanTable (int tableNodeIdx)
 

Properties

bool blockTagClosed
 
WhiteSpace compressNextWhitespace
 
const QTextHtmlParserNodecurrentNode
 
int currentNodeIdx
 
QTextCursor cursor
 
QTextDocumentdoc
 
bool forceBlockMerging
 
bool hasBlock
 
ImportMode importMode
 
int indent
 
QVector< Listlists
 
QStringList namedAnchors
 
QVector< Tabletables
 
QTextHtmlParserNode::WhiteSpaceMode wsm
 

Friends

struct Table
 

Additional Inherited Members

- Static Public Functions inherited from QTextHtmlParser
static int lookupElement (const QString &element)
 
- Protected Functions inherited from QTextHtmlParser
void applyAttributes (const QStringList &attributes)
 
QVector< QCss::DeclarationdeclarationsForNode (int node) const
 
void eatSpace ()
 
bool hasPrefix (QChar c, int lookahead=0) const
 
void importStyleSheet (const QString &href)
 
int margin (int i, int mar) const
 
QTextHtmlParserNodenewNode (int parent)
 
bool nodeIsChildOf (int i, QTextHTMLElements id) const
 
void parse ()
 
QStringList parseAttributes ()
 
void parseCloseTag ()
 
QString parseEntity ()
 
void parseExclamationTag ()
 
void parseTag ()
 
QString parseWord ()
 
void resolveNode ()
 
QTextHtmlParserNoderesolveParent ()
 
void resolveStyleSheetImports (const QCss::StyleSheet &sheet)
 
- Protected Variables inherited from QTextHtmlParser
QVector< ExternalStyleSheetexternalStyleSheets
 
QVector< QCss::StyleSheetinlineStyleSheets
 
int len
 
QVector< QTextHtmlParserNodenodes
 
int pos
 
const QTextDocumentresourceProvider
 
bool textEditMode
 
QString txt
 

Detailed Description

Definition at line 118 of file qtextdocumentfragment_p.h.

Enumerations

◆ ImportMode

Enumerator
ImportToFragment 
ImportToDocument 

Definition at line 122 of file qtextdocumentfragment_p.h.

◆ ProcessNodeResult

◆ WhiteSpace

Constructors and Destructors

◆ QTextHtmlImporter()

QTextHtmlImporter::QTextHtmlImporter ( QTextDocument _doc,
const QString html,
ImportMode  mode,
const QTextDocument resourceProvider = 0 
)

Definition at line 445 of file qtextdocumentfragment.cpp.

447 {
450 
451  QString html = _html;
452  const int startFragmentPos = html.indexOf(QLatin1String("<!--StartFragment-->"));
453  if (startFragmentPos != -1) {
454  QString qt3RichTextHeader(QLatin1String("<meta name=\"qrichtext\" content=\"1\" />"));
455 
456  // Hack for Qt3
457  const bool hasQtRichtextMetaTag = html.contains(qt3RichTextHeader);
458 
459  const int endFragmentPos = html.indexOf(QLatin1String("<!--EndFragment-->"));
460  if (startFragmentPos < endFragmentPos)
461  html = html.mid(startFragmentPos, endFragmentPos - startFragmentPos);
462  else
463  html = html.mid(startFragmentPos);
464 
465  if (hasQtRichtextMetaTag)
466  html.prepend(qt3RichTextHeader);
467  }
468 
469  parse(html, resourceProvider ? resourceProvider : doc);
470 // dumpHtml();
471 }
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
QString & prepend(QChar c)
Definition: qstring.h:261
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
QTextHtmlParserNode::WhiteSpaceMode wsm
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706

Functions

◆ appendBlock()

void QTextHtmlImporter::appendBlock ( const QTextBlockFormat format,
QTextCharFormat  charFmt = QTextCharFormat() 
)
private

Definition at line 1185 of file qtextdocumentfragment.cpp.

Referenced by appendNodeText(), import(), processBlockNode(), and processSpecialNodes().

1186 {
1187  if (!namedAnchors.isEmpty()) {
1188  charFmt.setAnchor(true);
1189  charFmt.setAnchorNames(namedAnchors);
1190  namedAnchors.clear();
1191  }
1192 
1193  cursor.insertBlock(format, charFmt);
1194 
1197 }
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QTextHtmlParserNode::WhiteSpaceMode wsm
void setAnchorNames(const QStringList &names)
Sets the text format&#39;s anchor names.
Definition: qtextformat.h:513
void clear()
Removes all items from the list.
Definition: qlist.h:764
void insertBlock()
Inserts a new empty block at the cursor position() with the current blockFormat() and charFormat()...
void setAnchor(bool anchor)
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate wa...
Definition: qtextformat.h:499

◆ appendNodeText()

bool QTextHtmlImporter::appendNodeText ( )
private

Definition at line 581 of file qtextdocumentfragment.cpp.

Referenced by import().

582 {
583  const int initialCursorPosition = cursor.position();
585 
588 
590 
591  QString textToInsert;
592  textToInsert.reserve(text.size());
593 
594  for (int i = 0; i < text.length(); ++i) {
595  QChar ch = text.at(i);
596 
597  if (ch.isSpace()
598  && ch != QChar::Nbsp
599  && ch != QChar::ParagraphSeparator) {
600 
602  compressNextWhitespace = RemoveWhiteSpace; // allow this one, and remove the ones coming next.
604  continue;
605 
607  || textEditMode
608  ) {
609  if (ch == QLatin1Char('\n')) {
610  if (textEditMode)
611  continue;
612  } else if (ch == QLatin1Char('\r')) {
613  continue;
614  }
618  ch = QChar::Nbsp;
619  else
620  ch = QLatin1Char(' ');
621  }
622  } else {
624  }
625 
626  if (ch == QLatin1Char('\n')
627  || ch == QChar::ParagraphSeparator) {
628 
629  if (!textToInsert.isEmpty()) {
630  cursor.insertText(textToInsert, format);
631  textToInsert.clear();
632  }
633 
635 
637  QTextBlockFormat tmp = fmt;
639  cursor.setBlockFormat(tmp);
640  }
641 
643  appendBlock(fmt, cursor.charFormat());
644  } else {
645  if (!namedAnchors.isEmpty()) {
646  if (!textToInsert.isEmpty()) {
647  cursor.insertText(textToInsert, format);
648  textToInsert.clear();
649  }
650 
651  format.setAnchor(true);
653  cursor.insertText(ch, format);
657  } else {
658  textToInsert += ch;
659  }
660  }
661  }
662 
663  if (!textToInsert.isEmpty()) {
664  cursor.insertText(textToInsert, format);
665  }
666 
667  return cursor.position() != initialCursorPosition;
668 }
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
Definition: qtextformat.h:372
QTextCharFormat charFormat() const
Returns the format of the character immediately before the cursor position().
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QTextBlockFormat blockFormat() const
Returns the block format of the block the cursor is in.
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
void insertText(const QString &text)
Inserts text at the current position, using the current character format.
bool isSpace() const
Returns true if the character is a separator character (Separator_* categories); otherwise returns fa...
Definition: qchar.cpp:609
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QTextHtmlParserNode::WhiteSpaceMode wsm
void setAnchorNames(const QStringList &names)
Sets the text format&#39;s anchor names.
Definition: qtextformat.h:513
void reserve(int size)
Attempts to allocate memory for at least size characters.
Definition: qstring.h:881
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
QTextCharFormat charFormat
void appendBlock(const QTextBlockFormat &format, QTextCharFormat charFmt=QTextCharFormat())
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
void setBlockFormat(const QTextBlockFormat &format)
Sets the block format of the current block (or all blocks that are contained in the selection) to for...
void clear()
Removes all items from the list.
Definition: qlist.h:764
int position() const
Returns the absolute position of the cursor within the document.
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723
The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument...
Definition: qtextformat.h:545
void setAnchor(bool anchor)
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate wa...
Definition: qtextformat.h:499
const QTextHtmlParserNode * currentNode
void clearProperty(int propertyId)
Clears the value of the property given by propertyId.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
#define text
Definition: qobjectdefs.h:80

◆ closeTag()

bool QTextHtmlImporter::closeTag ( )
private

Definition at line 779 of file qtextdocumentfragment.cpp.

Referenced by import().

780 {
781  const QTextHtmlParserNode *closedNode = &at(currentNodeIdx - 1);
782  const int endDepth = depth(currentNodeIdx) - 1;
783  int depth = this->depth(currentNodeIdx - 1);
784  bool blockTagClosed = false;
785 
786  while (depth > endDepth) {
787  Table *t = 0;
788  if (!tables.isEmpty())
789  t = &tables.last();
790 
791  switch (closedNode->id) {
792  case Html_tr:
793  if (t && !t->isTextFrame) {
794  ++t->currentRow;
795 
796  // for broken html with rowspans but missing tr tags
797  while (!t->currentCell.atEnd() && t->currentCell.row < t->currentRow)
798  ++t->currentCell;
799  }
800 
801  blockTagClosed = true;
802  break;
803 
804  case Html_table:
805  if (!t)
806  break;
807  indent = t->lastIndent;
808 
809  tables.resize(tables.size() - 1);
810  t = 0;
811 
812  if (tables.isEmpty()) {
814  } else {
815  t = &tables.last();
816  if (t->isTextFrame)
817  cursor = t->frame->lastCursorPosition();
818  else if (!t->currentCell.atEnd())
819  cursor = t->currentCell.cell().lastCursorPosition();
820  }
821 
822  // we don't need an extra block after tables, so we don't
823  // claim to have closed one for the creation of a new one
824  // in import()
825  blockTagClosed = false;
827  break;
828 
829  case Html_th:
830  case Html_td:
831  if (t && !t->isTextFrame)
832  ++t->currentCell;
833  blockTagClosed = true;
835  break;
836 
837  case Html_ol:
838  case Html_ul:
839  if (lists.isEmpty())
840  break;
841  lists.resize(lists.size() - 1);
842  --indent;
843  blockTagClosed = true;
844  break;
845 
846  case Html_br:
848  break;
849 
850  case Html_div:
851  if (closedNode->children.isEmpty())
852  break;
853  // fall through
854  default:
855  if (closedNode->isBlock())
856  blockTagClosed = true;
857  break;
858  }
859 
860  closedNode = &at(closedNode->parent);
861  --depth;
862  }
863 
864  return blockTagClosed;
865 }
QVector< int > children
const QTextHtmlParserNode & at(int i) const
QTextFrame * rootFrame() const
Returns the document&#39;s root frame.
QTextHTMLElements id
QTextCursor lastCursorPosition() const
Returns the last cursor position inside the frame.
int depth(int i) const
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
Definition: qvector.h:139

◆ import()

void QTextHtmlImporter::import ( )

Definition at line 473 of file qtextdocumentfragment.cpp.

Referenced by QTextDocumentFragment::fromHtml(), and QTextDocument::setHtml().

474 {
476  hasBlock = true;
477  forceBlockMerging = false;
479  blockTagClosed = false;
483 
484  /*
485  * process each node in three stages:
486  * 1) check if the hierarchy changed and we therefore passed the
487  * equivalent of a closing tag -> we may need to finish off
488  * some structures like tables
489  *
490  * 2) check if the current node is a special node like a
491  * <table>, <ul> or <img> tag that requires special processing
492  *
493  * 3) if the node should result in a QTextBlock create one and
494  * finally insert text that may be attached to the node
495  */
496 
497  /* emit 'closing' table blocks or adjust current indent level
498  * if we
499  * 1) are beyond the first node
500  * 2) the current node not being a child of the previous node
501  * means there was a tag closing in the input html
502  */
503  if (currentNodeIdx > 0 && (currentNode->parent != currentNodeIdx - 1)) {
505  // visually collapse subsequent block tags, but if the element after the closed block tag
506  // is for example an inline element (!isBlock) we have to make sure we start a new paragraph by setting
507  // hasBlock to false.
508  if (blockTagClosed
509  && !currentNode->isBlock()
510  && currentNode->id != Html_unknown)
511  {
512  hasBlock = false;
513  } else if (hasBlock) {
514  // when collapsing subsequent block tags we need to clear the block format
516  blockFormat.setIndent(indent);
517 
518  QTextBlockFormat oldFormat = cursor.blockFormat();
519  if (oldFormat.hasProperty(QTextFormat::PageBreakPolicy)) {
520  QTextFormat::PageBreakFlags pageBreak = oldFormat.pageBreakPolicy();
521  if (pageBreak == QTextFormat::PageBreak_AlwaysAfter)
522  /* We remove an empty paragrah that requested a page break after.
523  moving that request to the next paragraph means we also need to make
524  that a pagebreak before to keep the same visual appearance.
525  */
527  blockFormat.setPageBreakPolicy(pageBreak);
528  }
529 
530  cursor.setBlockFormat(blockFormat);
531  }
532  }
533 
535  if (currentNode->id == Html_title)
537  // ignore explicitly 'invisible' elements
538  continue;
539  }
540 
542  continue;
543 
544  // make sure there's a block for 'Blah' after <ul><li>foo</ul>Blah
545  if (blockTagClosed
546  && !hasBlock
547  && !currentNode->isBlock()
550 
552  block.setIndent(indent);
553 
555 
556  hasBlock = true;
557  }
558 
559  if (currentNode->isBlock()) {
561  if (result == ContinueWithNextNode) {
562  continue;
563  } else if (result == ContinueWithNextSibling) {
565  continue;
566  }
567  }
568 
571  }
572 
573  if (appendNodeText())
574  hasBlock = false; // if we actually appended text then we don't
575  // have an empty block anymore
576  }
577 
579 }
void endEditBlock()
Indicates the end of a block of editing operations on the document that should appear as a single ope...
QVector< int > children
PageBreakFlags pageBreakPolicy() const
Returns the currently set page break policy for the paragraph.
Definition: qtextformat.h:608
QTextBlockFormat blockFormat() const
Returns the block format of the block the cursor is in.
const QTextHtmlParserNode & at(int i) const
QString anchorName() const
This function is deprecated.
bool hasOnlyWhitespace() const
void setMetaInformation(MetaInformation info, const QString &)
Sets the document&#39;s meta information of the type specified by info to the given string.
QTextHtmlParserNode::WhiteSpaceMode wsm
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QTextCharFormat charFormat
void appendBlock(const QTextBlockFormat &format, QTextCharFormat charFmt=QTextCharFormat())
bool isAnchor() const
Returns true if the text is formatted as an anchor; otherwise returns false.
Definition: qtextformat.h:501
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
void setBlockFormat(const QTextBlockFormat &format)
Sets the block format of the current block (or all blocks that are contained in the selection) to for...
void setPageBreakPolicy(PageBreakFlags flags)
Sets the page break policy for the paragraph to policy.
Definition: qtextformat.h:606
QTextBlockFormat blockFormat
QTextHTMLElements id
void beginEditBlock()
Indicates the start of a block of editing operations on the document that should appear as a single o...
The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument...
Definition: qtextformat.h:545
void setIndent(int indent)
Sets the paragraph&#39;s indentation.
Definition: qtextformat.h:622
const QTextHtmlParserNode * currentNode
ProcessNodeResult processSpecialNodes()
ProcessNodeResult processBlockNode()
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

◆ processBlockNode()

QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode ( )
private

Definition at line 1018 of file qtextdocumentfragment.cpp.

Referenced by import().

1019 {
1020  QTextBlockFormat block;
1021  QTextCharFormat charFmt;
1022  bool modifiedBlockFormat = true;
1023  bool modifiedCharFormat = true;
1024 
1025  if (currentNode->isTableCell() && !tables.isEmpty()) {
1026  Table &t = tables.last();
1027  if (!t.isTextFrame && !t.currentCell.atEnd()) {
1028  QTextTableCell cell = t.currentCell.cell();
1029  if (cell.isValid()) {
1031  if (topPadding(currentNodeIdx) >= 0)
1033  if (bottomPadding(currentNodeIdx) >= 0)
1035  if (leftPadding(currentNodeIdx) >= 0)
1037  if (rightPadding(currentNodeIdx) >= 0)
1039  cell.setFormat(fmt);
1040 
1042  }
1043  }
1044  hasBlock = true;
1046 
1049  cursor.mergeBlockCharFormat(charFmt);
1050  }
1051  }
1052 
1053  if (hasBlock) {
1054  block = cursor.blockFormat();
1055  charFmt = cursor.blockCharFormat();
1056  modifiedBlockFormat = false;
1057  modifiedCharFormat = false;
1058  }
1059 
1060  // collapse
1061  {
1063  if (tm > block.topMargin()) {
1064  block.setTopMargin(tm);
1065  modifiedBlockFormat = true;
1066  }
1067  }
1068 
1070 
1071  // for list items we may want to collapse with the bottom margin of the
1072  // list.
1073  const QTextHtmlParserNode *parentNode = currentNode->parent ? &at(currentNode->parent) : 0;
1074  if ((currentNode->id == Html_li || currentNode->id == Html_dt || currentNode->id == Html_dd)
1075  && parentNode
1076  && (parentNode->isListStart() || parentNode->id == Html_dl)
1077  && (parentNode->children.last() == currentNodeIdx)) {
1078  bottomMargin = qMax(bottomMargin, this->bottomMargin(currentNode->parent));
1079  }
1080 
1081  if (block.bottomMargin() != bottomMargin) {
1082  block.setBottomMargin(bottomMargin);
1083  modifiedBlockFormat = true;
1084  }
1085 
1086  {
1087  const qreal lm = leftMargin(currentNodeIdx);
1088  const qreal rm = rightMargin(currentNodeIdx);
1089 
1090  if (block.leftMargin() != lm) {
1091  block.setLeftMargin(lm);
1092  modifiedBlockFormat = true;
1093  }
1094  if (block.rightMargin() != rm) {
1095  block.setRightMargin(rm);
1096  modifiedBlockFormat = true;
1097  }
1098  }
1099 
1100  if (currentNode->id != Html_li
1101  && indent != 0
1102  && (lists.isEmpty()
1103  || !hasBlock
1104  || !lists.last().list
1105  || lists.last().list->itemNumber(cursor.block()) == -1
1106  )
1107  ) {
1108  block.setIndent(indent);
1109  modifiedBlockFormat = true;
1110  }
1111 
1112  if (currentNode->blockFormat.propertyCount() > 0) {
1113  modifiedBlockFormat = true;
1114  block.merge(currentNode->blockFormat);
1115  }
1116 
1117  if (currentNode->charFormat.propertyCount() > 0) {
1118  modifiedCharFormat = true;
1119  charFmt.merge(currentNode->charFormat);
1120  }
1121 
1122  // ####################
1123  // block.setFloatPosition(node->cssFloat);
1124 
1126  block.setNonBreakableLines(true);
1127  modifiedBlockFormat = true;
1128  }
1129 
1132  modifiedBlockFormat = true;
1133  }
1134 
1136  if (modifiedBlockFormat)
1137  cursor.setBlockFormat(block);
1138  if (modifiedCharFormat)
1139  cursor.setBlockCharFormat(charFmt);
1140  } else {
1141  if (currentNodeIdx == 1 && cursor.position() == 0 && currentNode->isEmptyParagraph) {
1142  cursor.setBlockFormat(block);
1143  cursor.setBlockCharFormat(charFmt);
1144  } else {
1145  appendBlock(block, charFmt);
1146  }
1147  }
1148 
1149  if (currentNode->userState != -1)
1151 
1152  if (currentNode->id == Html_li && !lists.isEmpty()) {
1153  List &l = lists.last();
1154  if (l.list) {
1155  l.list->add(cursor.block());
1156  } else {
1157  l.list = cursor.createList(l.format);
1158  const qreal listTopMargin = topMargin(l.listNode);
1159  if (listTopMargin > block.topMargin()) {
1160  block.setTopMargin(listTopMargin);
1161  cursor.mergeBlockFormat(block);
1162  }
1163  }
1164  if (hasBlock) {
1165  QTextBlockFormat fmt;
1166  fmt.setIndent(0);
1167  cursor.mergeBlockFormat(fmt);
1168  }
1169  }
1170 
1171  forceBlockMerging = false;
1173  forceBlockMerging = true;
1174 
1176  hasBlock = false;
1177  return ContinueWithNextSibling;
1178  }
1179 
1180  hasBlock = true;
1181  blockTagClosed = false;
1182  return ContinueWithCurrentNode;
1183 }
void setRightPadding(qreal padding)
Sets the right padding of the table cell.
Definition: qtextformat.h:954
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
Definition: qtextformat.h:372
double qreal
Definition: qglobal.h:1193
int rightMargin(int i) const
void setUserState(int state)
Stores the specified state integer value in the text block.
QVector< int > children
QTextTableCellFormat toTableCellFormat() const
Returns this format as a table cell format.
void setBlockCharFormat(const QTextCharFormat &format)
Sets the block char format of the current block (or all blocks that are contained in the selection) t...
QTextList * createList(const QTextListFormat &format)
Creates and returns a new list with the given format, and makes the current paragraph the cursor is i...
QTextBlockFormat blockFormat() const
Returns the block format of the block the cursor is in.
const QTextHtmlParserNode & at(int i) const
void setBackground(const QBrush &brush)
Sets the brush use to paint the document&#39;s background to the brush specified.
Definition: qtextformat.h:343
qreal topMargin() const
Returns the paragraph&#39;s top margin.
Definition: qtextformat.h:566
void setLeftPadding(qreal padding)
Sets the left padding of the table cell.
Definition: qtextformat.h:944
qreal rightMargin() const
Returns the paragraph&#39;s right margin.
Definition: qtextformat.h:581
void mergeBlockFormat(const QTextBlockFormat &modifier)
Modifies the block format of the current block (or all blocks that are contained in the selection) wi...
int topPadding(int i) const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
QTextHtmlParserNode::WhiteSpaceMode wsm
void setTopMargin(qreal margin)
Sets the paragraph&#39;s top margin.
Definition: qtextformat.h:564
int leftMargin(int i) const
void setLeftMargin(qreal margin)
Sets the paragraph&#39;s left margin.
Definition: qtextformat.h:574
QTextCharFormat charFormat
void setBottomMargin(qreal margin)
Sets the paragraph&#39;s bottom margin.
Definition: qtextformat.h:569
QTextCharFormat format() const
Returns the cell&#39;s character format.
Definition: qtexttable.cpp:153
void setBottomPadding(qreal padding)
Sets the bottom padding of the table cell.
Definition: qtextformat.h:934
void appendBlock(const QTextBlockFormat &format, QTextCharFormat charFmt=QTextCharFormat())
int bottomMargin(int i) const
void setBlockFormat(const QTextBlockFormat &format)
Sets the block format of the current block (or all blocks that are contained in the selection) to for...
QTextBlockFormat blockFormat
void setFormat(const QTextCharFormat &format)
Sets the cell&#39;s character format to format.
Definition: qtexttable.cpp:134
int topMargin(int i) const
void mergeBlockCharFormat(const QTextCharFormat &modifier)
Modifies the block char format of the current block (or all blocks that are contained in the selectio...
int bottomPadding(int i) const
int position() const
Returns the absolute position of the cursor within the document.
QBrush background() const
Returns the brush used to paint the document&#39;s background.
Definition: qtextformat.h:345
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QTextHTMLElements id
void setNonBreakableLines(bool b)
If b is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable...
Definition: qtextformat.h:601
QTextBlock block() const
Returns the block that contains the cursor.
QTextCharFormat blockCharFormat() const
Returns the block character format of the block the cursor is in.
void merge(const QTextFormat &other)
Merges the other format with this format; where there are conflicts the other format takes precedence...
int firstPosition() const
Returns the first valid position in the document occupied by this cell.
Definition: qtexttable.cpp:273
qreal bottomMargin() const
Returns the paragraph&#39;s bottom margin.
Definition: qtextformat.h:571
T & last()
Returns a reference to the last item in the vector.
Definition: qvector.h:262
void setTopPadding(qreal padding)
Sets the top padding of the table cell.
Definition: qtextformat.h:924
The QTextTableCell class represents the properties of a cell in a QTextTable.
Definition: qtexttable.h:59
The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument...
Definition: qtextformat.h:545
int leftPadding(int i) const
QFactoryLoader * l
void setIndent(int indent)
Sets the paragraph&#39;s indentation.
Definition: qtextformat.h:622
void setRightMargin(qreal margin)
Sets the paragraph&#39;s right margin.
Definition: qtextformat.h:579
bool isValid() const
Returns true if this is a valid table cell; otherwise returns false.
Definition: qtexttable.h:77
The QTextTableCellFormat class provides formatting information for table cells in a QTextDocument...
Definition: qtextformat.h:898
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...
const QTextHtmlParserNode * currentNode
int propertyCount() const
Returns the number of properties stored in the format.
int rightPadding(int i) const
qreal leftMargin() const
Returns the paragraph&#39;s left margin.
Definition: qtextformat.h:576

◆ processSpecialNodes()

QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processSpecialNodes ( )
private

Definition at line 670 of file qtextdocumentfragment.cpp.

Referenced by import().

671 {
672  switch (currentNode->id) {
673  case Html_body:
677  doc->rootFrame()->setFrameFormat(fmt);
678  const_cast<QTextHtmlParserNode *>(currentNode)->charFormat.clearProperty(QTextFormat::BackgroundBrush);
679  }
681  break;
682 
683  case Html_ol:
684  case Html_ul: {
686 
689  while (n) {
690  if (n->id == Html_ul) {
692  }
693  if (n->parent)
694  n = &at(n->parent);
695  else
696  n = 0;
697  }
698  }
699 
700  QTextListFormat listFmt;
701  listFmt.setStyle(style);
706 
707  ++indent;
710  else
711  listFmt.setIndent(indent);
712 
713  List l;
714  l.format = listFmt;
715  l.listNode = currentNodeIdx;
716  lists.append(l);
718 
719  // broken html: <ul>Text here<li>Foo
720  const QString simpl = currentNode->text.simplified();
721  if (simpl.isEmpty() || simpl.at(0).isSpace())
722  return ContinueWithNextNode;
723  break;
724  }
725 
726  case Html_table: {
728  tables.append(t);
729  hasBlock = false;
731  return ContinueWithNextNode;
732  }
733 
734  case Html_tr:
735  return ContinueWithNextNode;
736 
737  case Html_img: {
738  QTextImageFormat fmt;
740 
742 
743  if (currentNode->imageWidth != -1)
745  if (currentNode->imageHeight != -1)
747 
749 
754 
755  hasBlock = false;
756  return ContinueWithNextNode;
757  }
758 
759  case Html_hr: {
761  blockFormat.setTopMargin(topMargin(currentNodeIdx));
765  cursor.mergeBlockFormat(blockFormat);
766  else
767  appendBlock(blockFormat);
768  hasBlock = false;
770  return ContinueWithNextNode;
771  }
772 
773  default: break;
774  }
776 }
The QTextListFormat class provides formatting information for lists in a QTextDocument.
Definition: qtextformat.h:642
Table scanTable(int tableNodeIdx)
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
Position
This enum describes how a frame is located relative to the surrounding text.
Definition: qtextformat.h:734
void setIndent(int indent)
Sets the list format&#39;s indentation.
Definition: qtextformat.h:685
void insertImage(const QTextImageFormat &format, QTextFrameFormat::Position alignment)
Inserts the image defined by the given format at the cursor&#39;s current position with the specified ali...
const QTextHtmlParserNode & at(int i) const
void setBackground(const QBrush &brush)
Sets the brush use to paint the document&#39;s background to the brush specified.
Definition: qtextformat.h:343
The QString class provides a Unicode character string.
Definition: qstring.h:83
void mergeBlockFormat(const QTextBlockFormat &modifier)
Modifies the block format of the current block (or all blocks that are contained in the selection) wi...
QTextListFormat::Style listStyle
bool isSpace() const
Returns true if the character is a separator character (Separator_* categories); otherwise returns fa...
Definition: qchar.cpp:609
void setTopMargin(qreal margin)
Sets the paragraph&#39;s top margin.
Definition: qtextformat.h:564
QTextFrame * rootFrame() const
Returns the document&#39;s root frame.
QTextCharFormat charFormat
void setBottomMargin(qreal margin)
Sets the paragraph&#39;s bottom margin.
Definition: qtextformat.h:569
The QTextImageFormat class provides formatting information for images in a QTextDocument.
Definition: qtextformat.h:694
void appendBlock(const QTextBlockFormat &format, QTextCharFormat charFmt=QTextCharFormat())
Style
This enum describes the symbols used to decorate list items:
Definition: qtextformat.h:649
int bottomMargin(int i) const
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
void setName(const QString &name)
Sets the name of the image.
Definition: qtextformat.h:718
QTextBlockFormat blockFormat
int topMargin(int i) const
void setNumberPrefix(const QString &numberPrefix)
Sets the list format&#39;s number prefix to the string specified by numberPrefix.
Definition: qtextformat.h:688
QBrush background() const
Returns the brush used to paint the document&#39;s background.
Definition: qtextformat.h:345
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QTextHTMLElements id
void mergeCharFormat(const QTextCharFormat &modifier)
Merges the cursor&#39;s current character format with the properties described by format modifier...
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
static QTextListFormat::Style nextListStyle(QTextListFormat::Style style)
void merge(const QTextFormat &other)
Merges the other format with this format; where there are conflicts the other format takes precedence...
void setNumberSuffix(const QString &numberSuffix)
Sets the list format&#39;s number suffix to the string specified by numberSuffix.
Definition: qtextformat.h:691
QString simplified() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end, and that has each sequence o...
Definition: qstring.cpp:4415
void setHeight(qreal height)
Sets the height of the rectangle occupied by the image.
Definition: qtextformat.h:724
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
Definition: qtextformat.h:727
The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument...
Definition: qtextformat.h:545
QFactoryLoader * l
bool movePosition(MoveOperation op, MoveMode=MoveAnchor, int n=1)
Moves the cursor by performing the given operation n times, using the specified mode, and returns true if all operations were completed successfully; otherwise returns false.
const QTextHtmlParserNode * currentNode
void setStyle(Style style)
Sets the list format&#39;s style.
Definition: qtextformat.h:682
void setWidth(qreal width)
Sets the width of the rectangle occupied by the image.
Definition: qtextformat.h:721
void setFrameFormat(const QTextFrameFormat &format)
Sets the frame&#39;s format.
Definition: qtextobject.h:191
QTextFrameFormat frameFormat() const
Returns the frame&#39;s format.
Definition: qtextobject.h:131

◆ scanTable()

QTextHtmlImporter::Table QTextHtmlImporter::scanTable ( int  tableNodeIdx)
private

Definition at line 867 of file qtextdocumentfragment.cpp.

Referenced by processSpecialNodes().

868 {
869  Table table;
870  table.columns = 0;
871 
872  QVector<QTextLength> columnWidths;
873 
874  int tableHeaderRowCount = 0;
875  QVector<int> rowNodes;
876  rowNodes.reserve(at(tableNodeIdx).children.count());
877  foreach (int row, at(tableNodeIdx).children)
878  switch (at(row).id) {
879  case Html_tr:
880  rowNodes += row;
881  break;
882  case Html_thead:
883  case Html_tbody:
884  case Html_tfoot:
885  foreach (int potentialRow, at(row).children)
886  if (at(potentialRow).id == Html_tr) {
887  rowNodes += potentialRow;
888  if (at(row).id == Html_thead)
889  ++tableHeaderRowCount;
890  }
891  break;
892  default: break;
893  }
894 
895  QVector<RowColSpanInfo> rowColSpans;
896  QVector<RowColSpanInfo> rowColSpanForColumn;
897 
898  int effectiveRow = 0;
899  foreach (int row, rowNodes) {
900  int colsInRow = 0;
901 
902  foreach (int cell, at(row).children)
903  if (at(cell).isTableCell()) {
904  // skip all columns with spans from previous rows
905  while (colsInRow < rowColSpanForColumn.size()) {
906  const RowColSpanInfo &spanInfo = rowColSpanForColumn[colsInRow];
907 
908  if (spanInfo.row + spanInfo.rowSpan > effectiveRow) {
909  Q_ASSERT(spanInfo.col == colsInRow);
910  colsInRow += spanInfo.colSpan;
911  } else
912  break;
913  }
914 
915  const QTextHtmlParserNode &c = at(cell);
916  const int currentColumn = colsInRow;
917  colsInRow += c.tableCellColSpan;
918 
919  RowColSpanInfo spanInfo;
920  spanInfo.row = effectiveRow;
921  spanInfo.col = currentColumn;
922  spanInfo.colSpan = c.tableCellColSpan;
923  spanInfo.rowSpan = c.tableCellRowSpan;
924  if (spanInfo.colSpan > 1 || spanInfo.rowSpan > 1)
925  rowColSpans.append(spanInfo);
926 
927  columnWidths.resize(qMax(columnWidths.count(), colsInRow));
928  rowColSpanForColumn.resize(columnWidths.size());
929  for (int i = currentColumn; i < currentColumn + c.tableCellColSpan; ++i) {
930  if (columnWidths.at(i).type() == QTextLength::VariableLength) {
931  QTextLength w = c.width;
933  w = QTextLength(w.type(), w.value(100.) / c.tableCellColSpan);
934  columnWidths[i] = w;
935  }
936  rowColSpanForColumn[i] = spanInfo;
937  }
938  }
939 
940  table.columns = qMax(table.columns, colsInRow);
941 
942  ++effectiveRow;
943  }
944  table.rows = effectiveRow;
945 
946  table.lastIndent = indent;
947  indent = 0;
948 
949  if (table.rows == 0 || table.columns == 0)
950  return table;
951 
952  QTextFrameFormat fmt;
953  const QTextHtmlParserNode &node = at(tableNodeIdx);
954 
955  if (!node.isTextFrame) {
956  QTextTableFormat tableFmt;
957  tableFmt.setCellSpacing(node.tableCellSpacing);
958  tableFmt.setCellPadding(node.tableCellPadding);
960  tableFmt.setAlignment(node.blockFormat.alignment());
961  tableFmt.setColumns(table.columns);
962  tableFmt.setColumnWidthConstraints(columnWidths);
963  tableFmt.setHeaderRowCount(tableHeaderRowCount);
964  fmt = tableFmt;
965  }
966 
967  fmt.setTopMargin(topMargin(tableNodeIdx));
968  fmt.setBottomMargin(bottomMargin(tableNodeIdx));
969  fmt.setLeftMargin(leftMargin(tableNodeIdx)
970  + table.lastIndent * 40 // ##### not a good emulation
971  );
972  fmt.setRightMargin(rightMargin(tableNodeIdx));
973 
974  // compatibility
975  if (qFuzzyCompare(fmt.leftMargin(), fmt.rightMargin())
976  && qFuzzyCompare(fmt.leftMargin(), fmt.topMargin())
977  && qFuzzyCompare(fmt.leftMargin(), fmt.bottomMargin()))
979 
980  fmt.setBorderStyle(node.borderStyle);
981  fmt.setBorderBrush(node.borderBrush);
982  fmt.setBorder(node.tableBorder);
983  fmt.setWidth(node.width);
984  fmt.setHeight(node.height);
987 
990  if (node.charFormat.background().style() != Qt::NoBrush)
991  fmt.setBackground(node.charFormat.background());
993 
994  if (node.isTextFrame) {
995  if (node.isRootFrame) {
996  table.frame = cursor.currentFrame();
997  table.frame->setFrameFormat(fmt);
998  } else
999  table.frame = cursor.insertFrame(fmt);
1000 
1001  table.isTextFrame = true;
1002  } else {
1003  const int oldPos = cursor.position();
1004  QTextTable *textTable = cursor.insertTable(table.rows, table.columns, fmt.toTableFormat());
1005  table.frame = textTable;
1006 
1007  for (int i = 0; i < rowColSpans.count(); ++i) {
1008  const RowColSpanInfo &nfo = rowColSpans.at(i);
1009  textTable->mergeCells(nfo.row, nfo.col, nfo.rowSpan, nfo.colSpan);
1010  }
1011 
1012  table.currentCell = TableCellIterator(textTable);
1013  cursor.setPosition(oldPos); // restore for caption support which needs to be inserted right before the table
1014  }
1015  return table;
1016 }
QTextTable * insertTable(int rows, int cols, const QTextTableFormat &format)
Creates a new table with the given number of rows and columns in the specified format, inserts it at the current cursor position() in the document, and returns the table object.
void setBorderBrush(const QBrush &brush)
Sets the brush used for the frame&#39;s border.
Definition: qtextformat.h:765
unsigned char c[8]
Definition: qnumeric_p.h:62
QTextFrameFormat::BorderStyle borderStyle
int rightMargin(int i) const
void setBorder(qreal border)
Sets the width (in pixels) of the frame&#39;s border.
Definition: qtextformat.h:816
QVector< int > children
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
void setBorderStyle(BorderStyle style)
Sets the style of the frame&#39;s border.
Definition: qtextformat.h:770
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
Type type() const
Returns the type of this length object.
Definition: qtextformat.h:93
QTextFrame * insertFrame(const QTextFrameFormat &format)
Inserts a frame with the given format at the current cursor position(), moves the cursor position() i...
Position
This enum describes how a frame is located relative to the surrounding text.
Definition: qtextformat.h:734
PageBreakFlags pageBreakPolicy() const
Returns the currently set page break policy for the paragraph.
Definition: qtextformat.h:608
void setWidth(qreal width)
Convenience method that sets the width of the frame&#39;s border rectangle&#39;s width to the specified fixed...
Definition: qtextformat.h:822
const QTextHtmlParserNode & at(int i) const
void setCellPadding(qreal padding)
Sets the cell padding for the table.
Definition: qtextformat.h:892
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Definition: qglobal.h:2030
qreal leftMargin() const
Returns the width of the frame&#39;s left margin in pixels.
void setBackground(const QBrush &brush)
Sets the brush use to paint the document&#39;s background to the brush specified.
Definition: qtextformat.h:343
QTextTableFormat toTableFormat() const
Returns this format as a table format.
void mergeCells(int row, int col, int numRows, int numCols)
Merges the cell at the specified row and column with the adjacent cells into one cell.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
Qt::Alignment alignment() const
Returns the paragraph&#39;s alignment.
Definition: qtextformat.h:561
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
Qt::LayoutDirection layoutDirection() const
Returns the document&#39;s layout direction.
Definition: qtextformat.h:340
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
void setColumnWidthConstraints(const QVector< QTextLength > &constraints)
Sets the column width constraints for the table.
Definition: qtextformat.h:853
void setPosition(Position f)
Sets the policy for positioning frames with this frame format.
Definition: qtextformat.h:756
int leftMargin(int i) const
QTextFrame * currentFrame() const
Returns a pointer to the current frame.
void setTopMargin(qreal margin)
Sets the frame&#39;s top margin in pixels.
Definition: qtextformat.h:830
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
QTextCharFormat charFormat
qreal topMargin() const
Returns the width of the frame&#39;s top margin in pixels.
qreal bottomMargin() const
Returns the width of the frame&#39;s bottom margin in pixels.
void setHeaderRowCount(int count)
Declares the first count rows of the table as table header.
Definition: qtextformat.h:875
void setPageBreakPolicy(PageBreakFlags flags)
Sets the page break policy for the frame/table to policy.
Definition: qtextformat.h:806
int bottomMargin(int i) const
QTextBlockFormat blockFormat
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
int topMargin(int i) const
int position() const
Returns the absolute position of the cursor within the document.
QBrush background() const
Returns the brush used to paint the document&#39;s background.
Definition: qtextformat.h:345
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
The QTextTable class represents a table in a QTextDocument.
Definition: qtexttable.h:103
QTextHTMLElements id
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
void setColumns(int columns)
Sets the number of columns required by the table format.
Definition: qtextformat.h:885
void setCellSpacing(qreal spacing)
Sets the cell spacing for the table.
Definition: qtextformat.h:864
void setAlignment(Qt::Alignment alignment)
Sets the table&#39;s alignment.
Definition: qtextformat.h:895
void setLeftMargin(qreal margin)
Sets the frame&#39;s left margin in pixels.
Definition: qtextformat.h:836
void setHeight(qreal height)
Sets the frame&#39;s height.
Definition: qtextformat.h:825
qreal rightMargin() const
Returns the width of the frame&#39;s right margin in pixels.
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
Definition: qtextformat.h:727
The QTextLength class encapsulates the different types of length used in a QTextDocument.
Definition: qtextformat.h:84
void setRightMargin(qreal margin)
Sets the frame&#39;s right margin in pixels.
Definition: qtextformat.h:839
qreal value(qreal maximumLength) const
Returns the effective length, constrained by the type of the length object and the specified maximumL...
Definition: qtextformat.h:94
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...
The QTextTableFormat class provides formatting information for tables in a QTextDocument.
Definition: qtextformat.h:842
void reserve(int size)
Attempts to allocate memory for at least size elements.
Definition: qvector.h:339
void setBottomMargin(qreal margin)
Sets the frame&#39;s bottom margin in pixels.
Definition: qtextformat.h:833
void setLayoutDirection(Qt::LayoutDirection direction)
Sets the document&#39;s layout direction to the specified direction.
Definition: qtextformat.h:338
void setFrameFormat(const QTextFrameFormat &format)
Sets the frame&#39;s format.
Definition: qtextobject.h:191
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

Friends and Related Functions

◆ Table

friend struct Table
friend

Definition at line 193 of file qtextdocumentfragment_p.h.

Properties

◆ blockTagClosed

bool QTextHtmlImporter::blockTagClosed
private

Definition at line 228 of file qtextdocumentfragment_p.h.

Referenced by closeTag(), import(), and processBlockNode().

◆ compressNextWhitespace

WhiteSpace QTextHtmlImporter::compressNextWhitespace
private

◆ currentNode

const QTextHtmlParserNode* QTextHtmlImporter::currentNode
private

◆ currentNodeIdx

int QTextHtmlImporter::currentNodeIdx
private

Definition at line 229 of file qtextdocumentfragment_p.h.

Referenced by closeTag(), import(), processBlockNode(), and processSpecialNodes().

◆ cursor

QTextCursor QTextHtmlImporter::cursor
private

◆ doc

QTextDocument* QTextHtmlImporter::doc
private

◆ forceBlockMerging

bool QTextHtmlImporter::forceBlockMerging
private

Definition at line 227 of file qtextdocumentfragment_p.h.

Referenced by import(), and processBlockNode().

◆ hasBlock

bool QTextHtmlImporter::hasBlock
private

Definition at line 226 of file qtextdocumentfragment_p.h.

Referenced by import(), processBlockNode(), and processSpecialNodes().

◆ importMode

ImportMode QTextHtmlImporter::importMode
private

Definition at line 225 of file qtextdocumentfragment_p.h.

Referenced by processSpecialNodes().

◆ indent

int QTextHtmlImporter::indent
private

◆ lists

QVector<List> QTextHtmlImporter::lists
private

Definition at line 153 of file qtextdocumentfragment_p.h.

Referenced by closeTag(), processBlockNode(), and processSpecialNodes().

◆ namedAnchors

QStringList QTextHtmlImporter::namedAnchors
private

Definition at line 158 of file qtextdocumentfragment_p.h.

Referenced by appendBlock(), appendNodeText(), and import().

◆ tables

QVector<Table> QTextHtmlImporter::tables
private

Definition at line 205 of file qtextdocumentfragment_p.h.

Referenced by closeTag(), processBlockNode(), and processSpecialNodes().

◆ wsm

QTextHtmlParserNode::WhiteSpaceMode QTextHtmlImporter::wsm
private

The documentation for this class was generated from the following files: