![]() |
Qt 6.x
The Qt SDK
|
#include <qtexthtmlparser_p.h>
Public Types | |
enum | Margin { MarginTop , MarginRight , MarginBottom , MarginLeft } |
Public Member Functions | |
~QTextHtmlParser () | |
const QTextHtmlParserNode & | at (int i) const |
QTextHtmlParserNode & | operator[] (int i) |
int | count () const |
int | last () const |
int | depth (int i) const |
int | topMargin (int i) const |
int | bottomMargin (int i) const |
int | leftMargin (int i) const |
int | rightMargin (int i) const |
int | topPadding (int i) const |
int | bottomPadding (int i) const |
int | leftPadding (int i) const |
int | rightPadding (int i) const |
qreal | tableCellBorder (int i, int edge) const |
QTextFrameFormat::BorderStyle | tableCellBorderStyle (int i, int edge) const |
QBrush | tableCellBorderBrush (int i, int edge) const |
void | dumpHtml () |
void | parse (const QString &text, const QTextDocument *resourceProvider) |
Static Public Member Functions | |
static int | lookupElement (const QString &element) |
static Q_GUI_EXPORT QString | parseEntity (QStringView entity) |
Protected Member Functions | |
QTextHtmlParserNode * | newNode (int parent) |
void | parse () |
void | parseTag () |
void | parseCloseTag () |
void | parseExclamationTag () |
QString | parseEntity () |
QString | parseWord () |
QTextHtmlParserNode * | resolveParent () |
void | resolveNode () |
QStringList | parseAttributes () |
void | applyAttributes (const QStringList &attributes) |
void | eatSpace () |
bool | hasPrefix (QChar c, int lookahead=0) const |
int | margin (int i, int mar) const |
bool | nodeIsChildOf (int i, QTextHTMLElements id) const |
Protected Attributes | |
QList< QTextHtmlParserNode * > | nodes |
QString | txt |
int | pos |
int | len |
bool | textEditMode |
const QTextDocument * | resourceProvider |
Definition at line 242 of file qtexthtmlparser_p.h.
Enumerator | |
---|---|
MarginTop | |
MarginRight | |
MarginBottom | |
MarginLeft |
Definition at line 245 of file qtexthtmlparser_p.h.
|
inline |
Definition at line 251 of file qtexthtmlparser_p.h.
References nodes, and qDeleteAll().
|
protected |
Definition at line 1571 of file qtexthtmlparser.cpp.
References Qt::AlignAbsolute, QTextCharFormat::AlignBottom, Qt::AlignHCenter, Qt::AlignJustify, Qt::AlignLeft, QTextBlockFormat::alignment(), QTextCharFormat::AlignMiddle, Qt::AlignRight, QTextCharFormat::AlignTop, QTextHtmlParserNode::applyBackgroundImage(), QTextFormat::BlockCodeLanguage, QTextHtmlParserNode::blockFormat, QTextHtmlParserNode::borderBrush, QTextHtmlParserNode::charFormat, QTextBlockFormat::Checked, QTextHtmlParserNode::cssFloat, QTextFrameFormat::FloatLeft, QTextFrameFormat::FloatRight, QTextFormat::FontSizeAdjustment, QColor::fromString(), QTextHtmlParserNode::hasOwnListStyle, QTextHtmlParserNode::height, Html_a, Html_body, Html_font, Html_hr, Html_img, Html_li, Html_link, Html_meta, Html_ol, Html_pre, Html_table, Html_td, Html_th, Html_tr, Html_ul, i, QTextHtmlParserNode::id, QTextHtmlParserNode::imageAlt, QTextHtmlParserNode::imageHeight, QTextHtmlParserNode::imageName, QTextHtmlParserNode::imageWidth, QString::isEmpty(), QList< T >::last(), Qt::LeftToRight, QTextListFormat::ListCircle, QTextListFormat::ListDecimal, QTextListFormat::ListDisc, QTextListFormat::ListLowerAlpha, QTextListFormat::ListLowerRoman, QTextListFormat::ListSquare, QTextHtmlParserNode::listStart, QTextHtmlParserNode::listStyle, QTextListFormat::ListStyleUndefined, QTextListFormat::ListUpperAlpha, QTextListFormat::ListUpperRoman, nodes, QTextHtmlParserNode::parseStyleAttribute(), qBound(), qMax(), qWarning, resourceProvider, Qt::RightToLeft, QTextBlockFormat::setAlignment(), QTextCharFormat::setAnchor(), QTextCharFormat::setAnchorHref(), QTextCharFormat::setAnchorNames(), QTextFormat::setBackground(), setFloatAttribute(), QTextCharFormat::setFontFamilies(), QTextFormat::setForeground(), setIntAttribute(), QTextFormat::setLayoutDirection(), QTextBlockFormat::setMarker(), QTextFormat::setProperty(), QTextCharFormat::setToolTip(), QTextCharFormat::setVerticalAlignment(), setWidthAttribute(), QTextHtmlParserNode::tableBorder, QTextHtmlParserNode::tableCellColSpan, QTextHtmlParserNode::tableCellPadding, QTextHtmlParserNode::tableCellRowSpan, QTextHtmlParserNode::tableCellSpacing, QTextHtmlParserNode::text, textEditMode, QTextBlockFormat::Unchecked, and QTextHtmlParserNode::width.
Referenced by parseTag().
|
inline |
Definition at line 256 of file qtexthtmlparser_p.h.
References QList< T >::at(), i, and nodes.
Referenced by QTextHtmlStyleSelector::attributeValue(), QTextHtmlStyleSelector::hasAttributes(), QTextHtmlParserNode::isNestedList(), QTextHtmlStyleSelector::nodeNames(), QTextHtmlStyleSelector::parentNode(), and QTextHtmlStyleSelector::previousSiblingNode().
int QTextHtmlParser::bottomMargin | ( | int | i | ) | const |
Definition at line 588 of file qtexthtmlparser.cpp.
References at, i, and MarginBottom.
|
inline |
Definition at line 267 of file qtexthtmlparser_p.h.
References at, i, and MarginBottom.
|
inline |
Definition at line 258 of file qtexthtmlparser_p.h.
References nodes, and QList< T >::size().
Referenced by dumpHtml(), QTextHtmlImporter::import(), and newNode().
int QTextHtmlParser::depth | ( | int | i | ) | const |
Definition at line 553 of file qtexthtmlparser.cpp.
References at, i, and QObject::parent().
void QTextHtmlParser::dumpHtml | ( | ) |
Definition at line 475 of file qtexthtmlparser.cpp.
References at, count(), i, qDebug, qPrintable, quoteNewline(), tag, and text.
|
protected |
Definition at line 595 of file qtexthtmlparser.cpp.
References QString::at(), QChar::isSpace(), QChar::ParagraphSeparator, pos, and txt.
Referenced by parseAttributes(), and parseTag().
|
inlineprotected |
Definition at line 302 of file qtexthtmlparser_p.h.
References QString::at(), pos, and txt.
Referenced by parseAttributes(), parseExclamationTag(), parseTag(), and parseWord().
|
inline |
Definition at line 259 of file qtexthtmlparser_p.h.
References nodes, and QList< T >::size().
Referenced by parseCloseTag(), and parseTag().
|
inline |
Definition at line 263 of file qtexthtmlparser_p.h.
References i, margin(), and MarginLeft.
|
inline |
Definition at line 268 of file qtexthtmlparser_p.h.
References at, i, and MarginLeft.
|
static |
Definition at line 436 of file qtexthtmlparser.cpp.
References e, and lookupElementHelper().
Referenced by Qt::mightBeRichText().
|
protected |
Definition at line 563 of file qtexthtmlparser.cpp.
References at, Html_table, i, QTextHtmlParserNode::id, QTextHtmlParserNode::isBlock(), QTextHtmlParserNode::isTableCell(), QTextHtmlParserNode::margin, MarginLeft, MarginRight, and QTextHtmlParserNode::parent.
Referenced by leftMargin(), and rightMargin().
|
protected |
Definition at line 484 of file qtexthtmlparser.cpp.
References QList< T >::append(), QString::at(), at, QString::clear(), count(), QTextHtmlElement::DisplayInline, Html_unknown, QTextHtmlParserNode::id, QString::isEmpty(), QChar::isSpace(), QList< T >::last(), newNode(), nodes, QObject::parent(), parent, QTextHtmlParserNode::parent, QString::size(), QList< T >::size(), QTextHtmlParserNode::tag, and QTextHtmlParserNode::text.
Referenced by newNode(), parseCloseTag(), and parseTag().
|
protected |
Definition at line 2158 of file qtexthtmlparser.cpp.
References at, i, and QObject::parent().
|
inline |
Definition at line 257 of file qtexthtmlparser_p.h.
|
protected |
Definition at line 601 of file qtexthtmlparser.cpp.
References QString::at(), QList< T >::last(), nodes, parseEntity(), parseTag(), pos, QTextHtmlParserNode::text, and txt.
Referenced by QTextHtmlImporter::QTextHtmlImporter(), and parse().
void QTextHtmlParser::parse | ( | const QString & | text, |
const QTextDocument * | resourceProvider | ||
) |
Definition at line 539 of file qtexthtmlparser.cpp.
References QList< T >::append(), QList< T >::clear(), nodes, parse(), pos, qDeleteAll(), resourceProvider, QString::size(), text, textEditMode, and txt.
|
protected |
Definition at line 1545 of file qtexthtmlparser.cpp.
References attrs, eatSpace(), hasPrefix(), parseWord(), pos, and QString::toLower().
Referenced by parseTag().
|
protected |
Definition at line 707 of file qtexthtmlparser.cpp.
References QString::at(), at, QString::endsWith(), last(), newNode(), nodes, QObject::parent(), parent, parseWord(), pos, resolveNode(), tag, text, QString::toLower(), QString::trimmed(), txt, QTextHtmlParserNode::WhiteSpacePre, QTextHtmlParserNode::WhiteSpacePreLine, and QTextHtmlParserNode::WhiteSpacePreWrap.
Referenced by parseTag().
|
protected |
Definition at line 796 of file qtexthtmlparser.cpp.
References QString::at(), error, QString::isNull(), QStringView::mid(), parseEntity(), pos, and txt.
Referenced by parse(), parseEntity(), QQuickStyledTextPrivate::parseEntity(), and parseWord().
|
static |
Definition at line 768 of file qtexthtmlparser.cpp.
References QStringView::at(), base, QChar::fromUcs4(), QChar::isNull(), QStringView::mid(), ok, resolveEntity(), QStringView::size(), QChar::toLower(), QStringView::toUInt(), and windowsLatin1ExtendedCharacters.
|
protected |
Definition at line 750 of file qtexthtmlparser.cpp.
References QString::at(), hasPrefix(), QString::indexOf(), len, pos, and txt.
Referenced by parseTag().
|
protected |
Definition at line 616 of file qtexthtmlparser.cpp.
References applyAttributes(), QString::at(), at, QTextHtmlParserNode::attributes, Qt::CaseInsensitive, QList< T >::constLast(), QTextHtmlElement::displayMode, QTextHtmlParserNode::displayMode, eatSpace(), hasPrefix(), Html_style, Html_unknown, QTextHtmlElement::id, QTextHtmlParserNode::id, QTextHtmlParserNode::isBlock(), QChar::isSpace(), QList< T >::last(), last(), lookupElementHelper(), QTextHtmlParserNode::mayNotHaveChildren(), newNode(), nodes, QCss::StyleSheet::origin, QObject::parent(), QTextHtmlParserNode::parent, QCss::Parser::parse(), parseAttributes(), parseCloseTag(), parseExclamationTag(), parseWord(), pos, resolveNode(), resolveParent(), resourceProvider, QList< T >::size(), QCss::StyleSheetOrigin_Author, QTextHtmlParserNode::tag, tag, QTextHtmlParserNode::text, textEditMode, QString::toLower(), txt, QTextHtmlParserNode::WhiteSpacePre, QTextHtmlParserNode::WhiteSpacePreLine, QTextHtmlParserNode::WhiteSpacePreWrap, and QTextHtmlParserNode::wsm.
Referenced by parse().
|
protected |
Definition at line 822 of file qtexthtmlparser.cpp.
References QString::at(), hasPrefix(), parseEntity(), pos, QString::size(), and txt.
Referenced by parseAttributes(), parseCloseTag(), and parseTag().
|
protected |
Definition at line 962 of file qtexthtmlparser.cpp.
References QList< T >::at(), QTextHtmlParserNode::initializeProperties(), QList< T >::last(), nodes, parent, and QTextHtmlParserNode::parent.
Referenced by parseCloseTag(), and parseTag().
|
protected |
Definition at line 864 of file qtexthtmlparser.cpp.
References QTextHtmlParserNode::allowedInContext(), QList< T >::append(), at, Html_p, Html_table, Html_td, Html_tr, QTextHtmlParserNode::id, QList< T >::insert(), QTextHtmlParserNode::isNotSelfNesting(), QList< T >::last(), nodes, QObject::parent(), QTextHtmlParserNode::parent, and QList< T >::size().
Referenced by parseTag().
|
inline |
Definition at line 264 of file qtexthtmlparser_p.h.
References i, margin(), and MarginRight.
|
inline |
Definition at line 269 of file qtexthtmlparser_p.h.
References at, i, and MarginRight.
|
inline |
Definition at line 271 of file qtexthtmlparser_p.h.
|
inline |
Definition at line 273 of file qtexthtmlparser_p.h.
|
inline |
Definition at line 272 of file qtexthtmlparser_p.h.
int QTextHtmlParser::topMargin | ( | int | i | ) | const |
Definition at line 581 of file qtexthtmlparser.cpp.
|
inline |
Definition at line 266 of file qtexthtmlparser_p.h.
|
protected |
Definition at line 287 of file qtexthtmlparser_p.h.
Referenced by parseExclamationTag().
|
protected |
Definition at line 285 of file qtexthtmlparser_p.h.
Referenced by ~QTextHtmlParser(), applyAttributes(), at(), count(), last(), newNode(), operator[](), parse(), parse(), parseCloseTag(), parseTag(), resolveNode(), and resolveParent().
|
protected |
Definition at line 287 of file qtexthtmlparser_p.h.
Referenced by eatSpace(), hasPrefix(), parse(), parse(), parseAttributes(), parseCloseTag(), parseEntity(), parseExclamationTag(), parseTag(), and parseWord().
|
protected |
Definition at line 329 of file qtexthtmlparser_p.h.
Referenced by QTextHtmlImporter::QTextHtmlImporter(), applyAttributes(), parse(), and parseTag().
|
protected |
Definition at line 289 of file qtexthtmlparser_p.h.
Referenced by applyAttributes(), QTextHtmlImporter::import(), parse(), and parseTag().
|
protected |
Definition at line 286 of file qtexthtmlparser_p.h.
Referenced by eatSpace(), hasPrefix(), parse(), parse(), parseCloseTag(), parseEntity(), parseExclamationTag(), parseTag(), and parseWord().