![]() |
Qt 6.x
The Qt SDK
|
#include <qtextmarkdownimporter_p.h>
Public Types | |
enum | Feature { FeatureCollapseWhitespace = 0x0001 , FeaturePermissiveATXHeaders = 0x0002 , FeaturePermissiveURLAutoLinks = 0x0004 , FeaturePermissiveMailAutoLinks = 0x0008 , FeatureNoIndentedCodeBlocks = 0x0010 , FeatureNoHTMLBlocks = 0x0020 , FeatureNoHTMLSpans = 0x0040 , FeatureTables = 0x0100 , FeatureStrikeThrough = 0x0200 , FeaturePermissiveWWWAutoLinks = 0x0400 , FeatureTasklists = 0x0800 , FeatureUnderline = 0x4000 , FeaturePermissiveAutoLinks , FeatureNoHTML = QTextDocument::MarkdownNoHTML , DialectCommonMark = QTextDocument::MarkdownDialectCommonMark , DialectGitHub = QTextDocument::MarkdownDialectGitHub } |
Public Member Functions | |
QTextMarkdownImporter (Features features) | |
QTextMarkdownImporter (QTextDocument::MarkdownFeatures features) | |
void | import (QTextDocument *doc, const QString &markdown) |
int | cbEnterBlock (int blockType, void *detail) |
int | cbLeaveBlock (int blockType, void *detail) |
int | cbEnterSpan (int spanType, void *detail) |
int | cbLeaveSpan (int spanType, void *detail) |
int | cbText (int textType, const char *text, unsigned size) |
Definition at line 33 of file qtextmarkdownimporter_p.h.
Definition at line 36 of file qtextmarkdownimporter_p.h.
QTextMarkdownImporter::QTextMarkdownImporter | ( | Features | features | ) |
QTextMarkdownImporter::QTextMarkdownImporter | ( | QTextDocument::MarkdownFeatures | features | ) |
Definition at line 113 of file qtextmarkdownimporter.cpp.
int QTextMarkdownImporter::cbEnterBlock | ( | int | blockType, |
void * | detail | ||
) |
Definition at line 148 of file qtextmarkdownimporter.cpp.
References QTextTable::appendColumns(), QTextTable::appendRows(), QTextCursor::blockFormat(), QTextFormat::BlockTrailingHorizontalRulerWidth, QFont::Bold, QTextTable::cellAt(), QTextBlockFormat::Checked, QList< T >::clear(), QTextTable::columns(), QTextTableCell::firstCursorPosition(), fmt, QTextFormat::FontSizeAdjustment, QChar::fromLatin1(), info, QTextCursor::insertBlock(), QTextCursor::insertList(), QTextCursor::insertTable(), QTextDocument::isEmpty(), QList< T >::isEmpty(), QTextTableCell::isValid(), QTextListFormat::ListCircle, QTextListFormat::ListDecimal, QTextListFormat::ListDisc, QTextListFormat::ListSquare, MdAlignment(), QTextBlockFormat::NoMarker, QStack< T >::push(), qCDebug, qPrintable, qWarning, QTextTable::rows(), QTextBlockFormat::setAlignment(), QTextCursor::setBlockFormat(), QTextCursor::setCharFormat(), QTextCharFormat::setFontWeight(), QTextBlockFormat::setHeadingLevel(), QTextListFormat::setIndent(), QTextListFormat::setNumberSuffix(), QTextFormat::setProperty(), QTextListFormat::setStart(), QTextListFormat::setStyle(), QList< T >::size(), and QTextBlockFormat::Unchecked.
Referenced by CbEnterBlock().
int QTextMarkdownImporter::cbEnterSpan | ( | int | spanType, |
void * | detail | ||
) |
Definition at line 363 of file qtextmarkdownimporter.cpp.
References QFont::Bold, QBrush::color(), QFont::families(), QTextCharFormat::font(), QTextCharFormat::fontItalic(), QTextCharFormat::fontWeight(), QTextFormat::foreground(), QString::fromUtf8(), QTextFormat::ImageTitle, QString::isEmpty(), QList< T >::isEmpty(), QPalette::link(), QColor::name(), QStack< T >::push(), qCDebug, QTextCharFormat::setAnchor(), QTextCharFormat::setAnchorHref(), QTextCursor::setCharFormat(), QTextCharFormat::setFont(), QTextCharFormat::setFontFixedPitch(), QTextCharFormat::setFontItalic(), QTextCharFormat::setFontStrikeOut(), QTextCharFormat::setFontUnderline(), QTextCharFormat::setFontWeight(), QTextFormat::setForeground(), QTextImageFormat::setName(), QTextFormat::setProperty(), QTextCharFormat::setToolTip(), title, QStack< T >::top(), and url.
Referenced by CbEnterSpan().
int QTextMarkdownImporter::cbLeaveBlock | ( | int | blockType, |
void * | detail | ||
) |
Definition at line 290 of file qtextmarkdownimporter.cpp.
References QString::clear(), QTextTable::columns(), QListSpecialMethodsBase< T >::contains(), QTextCursor::createList(), QTextCursor::End, QList< T >::isEmpty(), QTextTable::mergeCells(), QTextCursor::movePosition(), QStack< T >::pop(), QStack< T >::push(), Q_UNLIKELY, Q_UNUSED, qCDebug, qCWarning, QTextTable::rows(), QTextCursor::setCharFormat(), and QList< T >::size().
Referenced by CbLeaveBlock().
int QTextMarkdownImporter::cbLeaveSpan | ( | int | spanType, |
void * | detail | ||
) |
Definition at line 413 of file qtextmarkdownimporter.cpp.
References QBrush::color(), QFont::families(), QTextCharFormat::font(), QTextCharFormat::fontItalic(), QTextCharFormat::fontWeight(), QTextFormat::foreground(), QList< T >::isEmpty(), QColor::name(), QStack< T >::pop(), Q_UNUSED, qCDebug, QTextCursor::setCharFormat(), and QStack< T >::top().
Referenced by CbLeaveSpan().
int QTextMarkdownImporter::cbText | ( | int | textType, |
const char * | text, | ||
unsigned | size | ||
) |
Definition at line 431 of file qtextmarkdownimporter.cpp.
References QList< T >::append(), QTextDocument::baseUrl, QTextFormat::BlockCodeLanguage, QTextCursor::blockFormat(), QTextFormat::BlockQuoteLevel, QTextBlockFormat::bottomMargin(), QTextCursor::currentList(), QTextList::format(), QString::fromUtf8(), QTextFormat::hasProperty(), QTextFormat::ImageAltText, QTextFormat::ImageTitle, QTextBlockFormat::indent(), QTextListFormat::indent(), QTextCursor::insertHtml(), QTextCursor::insertImage(), QTextCursor::insertText(), QTextFormat::intProperty(), QList< T >::isEmpty(), QTextBlockFormat::leftMargin(), QTextImageFormat::name(), QString::number(), qCDebug, qPrintable, QStringLiteral, QtDebugMsg, qtmi_Newline, qtmi_Space, QTextBlockFormat::rightMargin(), QTextCursor::setBlockFormat(), QTextCursor::setCharFormat(), QTextBlockFormat::setIndent(), QTextFormat::setProperty(), QTextFormat::stringProperty(), text, QTextBlockFormat::textIndent(), QStack< T >::top(), and QTextBlockFormat::topMargin().
Referenced by CbText().
void QTextMarkdownImporter::import | ( | QTextDocument * | doc, |
const QString & | markdown | ||
) |
Definition at line 118 of file qtextmarkdownimporter.cpp.
References QTextCursor::beginEditBlock(), callbacks, CbDebugLog(), CbEnterBlock(), CbEnterSpan(), CbLeaveBlock(), CbLeaveSpan(), CbText(), QTextDocument::clear(), QByteArray::constData(), QTextDocument::defaultFont, QTextCursor::endEditBlock(), QFont::pixelSize(), QFont::pointSize(), qCDebug, QFont::setPixelSize(), QFont::setPointSize(), QByteArray::size(), and QString::toUtf8().