Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuickStyledTextPrivate Class Reference
+ Collaboration diagram for QQuickStyledTextPrivate:

Classes

struct  List
 

Public Types

enum  ListType { Ordered , Unordered }
 
enum  ListFormat {
  Bullet , Disc , Square , Decimal ,
  LowerAlpha , UpperAlpha , LowerRoman , UpperRoman
}
 

Public Member Functions

 QQuickStyledTextPrivate (const QString &t, QTextLayout &l, QList< QQuickStyledTextImgTag * > &imgTags, const QUrl &baseUrl, QQmlContext *context, bool preloadImages, bool *fontSizeModified)
 
void parse ()
 
void appendText (const QString &textIn, int start, int length, QString &textOut)
 
bool parseTag (const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format)
 
bool parseCloseTag (const QChar *&ch, const QString &textIn, QString &textOut)
 
void parseEntity (const QChar *&ch, const QString &textIn, QString &textOut)
 
bool parseFontAttributes (const QChar *&ch, const QString &textIn, QTextCharFormat &format)
 
bool parseOrderedListAttributes (const QChar *&ch, const QString &textIn)
 
bool parseUnorderedListAttributes (const QChar *&ch, const QString &textIn)
 
bool parseAnchorAttributes (const QChar *&ch, const QString &textIn, QTextCharFormat &format)
 
void parseImageAttributes (const QChar *&ch, const QString &textIn, QString &textOut)
 
QPair< QStringView, QStringViewparseAttribute (const QChar *&ch, const QString &textIn)
 
QStringView parseValue (const QChar *&ch, const QString &textIn)
 
void setFontSize (int size, QTextCharFormat &format)
 
void skipSpace (const QChar *&ch)
 

Static Public Member Functions

static QString toAlpha (int value, bool upper)
 
static QString toRoman (int value, bool upper)
 

Public Attributes

QString text
 
QTextLayoutlayout
 
QList< QQuickStyledTextImgTag * > * imgTags
 
QFont baseFont
 
QStack< ListlistStack
 
QUrl baseUrl
 
bool * fontSizeModified
 
QQmlContextcontext
 
int nbImages = 0
 
bool hasNewLine = true
 
bool updateImagePositions = false
 
bool preFormat = false
 
bool prependSpace = false
 
bool hasSpace = true
 
bool preloadImages
 

Static Public Attributes

static const QChar lessThan
 
static const QChar greaterThan
 
static const QChar equals
 
static const QChar singleQuote
 
static const QChar doubleQuote
 
static const QChar slash
 
static const QChar ampersand
 
static const QChar bullet
 
static const QChar disc
 
static const QChar square
 
static const QChar lineFeed
 
static const QChar space
 
static const int tabsize = 6
 

Detailed Description

Definition at line 41 of file qquickstyledtext.cpp.

Member Enumeration Documentation

◆ ListFormat

Enumerator
Bullet 
Disc 
Square 
Decimal 
LowerAlpha 
UpperAlpha 
LowerRoman 
UpperRoman 

Definition at line 45 of file qquickstyledtext.cpp.

◆ ListType

Enumerator
Ordered 
Unordered 

Definition at line 44 of file qquickstyledtext.cpp.

Constructor & Destructor Documentation

◆ QQuickStyledTextPrivate()

QQuickStyledTextPrivate::QQuickStyledTextPrivate ( const QString & t,
QTextLayout & l,
QList< QQuickStyledTextImgTag * > & imgTags,
const QUrl & baseUrl,
QQmlContext * context,
bool preloadImages,
bool * fontSizeModified )
inline

Definition at line 53 of file qquickstyledtext.cpp.

Member Function Documentation

◆ appendText()

void QQuickStyledTextPrivate::appendText ( const QString & textIn,
int start,
int length,
QString & textOut )

Definition at line 271 of file qquickstyledtext.cpp.

References hasNewLine, hasSpace, prependSpace, and space.

Referenced by parse().

+ Here is the caller graph for this function:

◆ parse()

void QQuickStyledTextPrivate::parse ( )

Definition at line 165 of file qquickstyledtext.cpp.

References ampersand, appendText(), ch, QString::constData(), drawText(), QTextLayout::FormatRange::format, hasNewLine, hasSpace, imgTags, QList< T >::isEmpty(), layout, lessThan, lineFeed, parseCloseTag(), parseEntity(), parseTag(), preFormat, prependSpace, QString::reserve(), QTextLayout::setFormats(), QTextLayout::setText(), QString::size(), slash, space, text, and updateImagePositions.

Referenced by QQuickStyledText::parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseAnchorAttributes()

bool QQuickStyledTextPrivate::parseAnchorAttributes ( const QChar *& ch,
const QString & textIn,
QTextCharFormat & format )

Definition at line 627 of file qquickstyledtext.cpp.

References ch, and parseAttribute().

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseAttribute()

QPair< QStringView, QStringView > QQuickStyledTextPrivate::parseAttribute ( const QChar *& ch,
const QString & textIn )

Definition at line 719 of file qquickstyledtext.cpp.

References ch, doubleQuote, equals, greaterThan, QStringView::mid(), parseValue(), singleQuote, and skipSpace().

Referenced by parseAnchorAttributes(), parseFontAttributes(), parseImageAttributes(), parseOrderedListAttributes(), and parseUnorderedListAttributes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseCloseTag()

bool QQuickStyledTextPrivate::parseCloseTag ( const QChar *& ch,
const QString & textIn,
QString & textOut )

Definition at line 442 of file qquickstyledtext.cpp.

References ch, greaterThan, hasNewLine, hasSpace, listStack, QStringView::mid(), preFormat, skipSpace(), and tag.

Referenced by parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseEntity()

void QQuickStyledTextPrivate::parseEntity ( const QChar *& ch,
const QString & textIn,
QString & textOut )

Definition at line 526 of file qquickstyledtext.cpp.

References ch, QStringView::mid(), QTextHtmlParser::parseEntity(), and qCWarning.

Referenced by parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseFontAttributes()

bool QQuickStyledTextPrivate::parseFontAttributes ( const QChar *& ch,
const QString & textIn,
QTextCharFormat & format )

Definition at line 551 of file qquickstyledtext.cpp.

References ch, QColor::fromString(), parseAttribute(), and setFontSize().

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseImageAttributes()

void QQuickStyledTextPrivate::parseImageAttributes ( const QChar *& ch,
const QString & textIn,
QString & textOut )

Definition at line 645 of file qquickstyledtext.cpp.

References QList< T >::append(), baseUrl, ch, context, QQmlContext::engine(), QTextLayout::font(), imgTags, QUrl::isLocalFile(), layout, QQuickStyledTextImgTag::Middle, nbImages, parseAttribute(), preloadImages, qCWarning, qFloor(), QUrl::resolved(), space, QQuickStyledTextImgTag::Top, updateImagePositions, url, and QList< T >::value().

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseOrderedListAttributes()

bool QQuickStyledTextPrivate::parseOrderedListAttributes ( const QChar *& ch,
const QString & textIn )

Definition at line 573 of file qquickstyledtext.cpp.

References ch, Decimal, QQuickStyledTextPrivate::List::level, listStack, LowerAlpha, LowerRoman, Ordered, parseAttribute(), UpperAlpha, and UpperRoman.

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseTag()

bool QQuickStyledTextPrivate::parseTag ( const QChar *& ch,
const QString & textIn,
QString & textOut,
QTextCharFormat & format )

Definition at line 295 of file qquickstyledtext.cpp.

References QFont::Bold, Bullet, bullet, ch, Decimal, Disc, disc, QString::fromLatin1(), greaterThan, hasNewLine, hasSpace, i, QQuickStyledTextPrivate::List::level, listStack, LowerAlpha, LowerRoman, QStringView::mid(), QString::number(), Ordered, parseAnchorAttributes(), parseFontAttributes(), parseImageAttributes(), parseOrderedListAttributes(), parseUnorderedListAttributes(), preFormat, prependSpace, setFontSize(), skipSpace(), slash, Square, square, tabsize, tag, toAlpha(), toRoman(), Unordered, UpperAlpha, and UpperRoman.

Referenced by parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseUnorderedListAttributes()

bool QQuickStyledTextPrivate::parseUnorderedListAttributes ( const QChar *& ch,
const QString & textIn )

Definition at line 602 of file qquickstyledtext.cpp.

References Bullet, ch, Disc, QQuickStyledTextPrivate::List::level, listStack, parseAttribute(), Square, and Unordered.

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseValue()

QStringView QQuickStyledTextPrivate::parseValue ( const QChar *& ch,
const QString & textIn )

Definition at line 752 of file qquickstyledtext.cpp.

References ch, doubleQuote, QStringView::mid(), and singleQuote.

Referenced by parseAttribute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFontSize()

void QQuickStyledTextPrivate::setFontSize ( int size,
QTextCharFormat & format )

Definition at line 285 of file qquickstyledtext.cpp.

References baseFont, fontSizeModified, QFont::pixelSize(), QFont::pointSize(), QFont::pointSizeF(), and qt_defaultDpi().

Referenced by parseFontAttributes(), and parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skipSpace()

void QQuickStyledTextPrivate::skipSpace ( const QChar *& ch)
inline

Definition at line 78 of file qquickstyledtext.cpp.

References ch.

Referenced by parseAttribute(), parseCloseTag(), and parseTag().

+ Here is the caller graph for this function:

◆ toAlpha()

QString QQuickStyledTextPrivate::toAlpha ( int value,
bool upper )
static

Definition at line 767 of file qquickstyledtext.cpp.

Referenced by parseTag().

+ Here is the caller graph for this function:

◆ toRoman()

QString QQuickStyledTextPrivate::toRoman ( int value,
bool upper )
static

Definition at line 781 of file qquickstyledtext.cpp.

References QString::fromLatin1(), QByteArray::fromRawData(), i, and numDigits().

Referenced by parseTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ ampersand

const QChar QQuickStyledTextPrivate::ampersand
static

Definition at line 108 of file qquickstyledtext.cpp.

Referenced by parse().

◆ baseFont

QFont QQuickStyledTextPrivate::baseFont

Definition at line 89 of file qquickstyledtext.cpp.

Referenced by setFontSize().

◆ baseUrl

QUrl QQuickStyledTextPrivate::baseUrl

Definition at line 91 of file qquickstyledtext.cpp.

Referenced by parseImageAttributes().

◆ bullet

const QChar QQuickStyledTextPrivate::bullet
static

Definition at line 109 of file qquickstyledtext.cpp.

Referenced by parseTag().

◆ context

QQmlContext* QQuickStyledTextPrivate::context

Definition at line 93 of file qquickstyledtext.cpp.

Referenced by parseImageAttributes().

◆ disc

const QChar QQuickStyledTextPrivate::disc
static

Definition at line 110 of file qquickstyledtext.cpp.

Referenced by parseTag().

◆ doubleQuote

const QChar QQuickStyledTextPrivate::doubleQuote
static

Definition at line 106 of file qquickstyledtext.cpp.

Referenced by parseAttribute(), and parseValue().

◆ equals

const QChar QQuickStyledTextPrivate::equals
static

Definition at line 104 of file qquickstyledtext.cpp.

Referenced by parseAttribute().

◆ fontSizeModified

bool* QQuickStyledTextPrivate::fontSizeModified

Definition at line 92 of file qquickstyledtext.cpp.

Referenced by setFontSize().

◆ greaterThan

const QChar QQuickStyledTextPrivate::greaterThan
static

Definition at line 103 of file qquickstyledtext.cpp.

Referenced by parseAttribute(), parseCloseTag(), and parseTag().

◆ hasNewLine

bool QQuickStyledTextPrivate::hasNewLine = true

Definition at line 95 of file qquickstyledtext.cpp.

Referenced by appendText(), parse(), parseCloseTag(), and parseTag().

◆ hasSpace

bool QQuickStyledTextPrivate::hasSpace = true

Definition at line 99 of file qquickstyledtext.cpp.

Referenced by appendText(), parse(), parseCloseTag(), and parseTag().

◆ imgTags

QList<QQuickStyledTextImgTag*>* QQuickStyledTextPrivate::imgTags

Definition at line 88 of file qquickstyledtext.cpp.

Referenced by parse(), and parseImageAttributes().

◆ layout

QTextLayout& QQuickStyledTextPrivate::layout

Definition at line 87 of file qquickstyledtext.cpp.

Referenced by parse(), and parseImageAttributes().

◆ lessThan

const QChar QQuickStyledTextPrivate::lessThan
static

Definition at line 102 of file qquickstyledtext.cpp.

Referenced by parse().

◆ lineFeed

const QChar QQuickStyledTextPrivate::lineFeed
static

Definition at line 112 of file qquickstyledtext.cpp.

Referenced by parse().

◆ listStack

QStack<List> QQuickStyledTextPrivate::listStack

◆ nbImages

int QQuickStyledTextPrivate::nbImages = 0

Definition at line 94 of file qquickstyledtext.cpp.

Referenced by parseImageAttributes().

◆ preFormat

bool QQuickStyledTextPrivate::preFormat = false

Definition at line 97 of file qquickstyledtext.cpp.

Referenced by parse(), parseCloseTag(), and parseTag().

◆ preloadImages

bool QQuickStyledTextPrivate::preloadImages

Definition at line 100 of file qquickstyledtext.cpp.

Referenced by parseImageAttributes().

◆ prependSpace

bool QQuickStyledTextPrivate::prependSpace = false

Definition at line 98 of file qquickstyledtext.cpp.

Referenced by appendText(), parse(), and parseTag().

◆ singleQuote

const QChar QQuickStyledTextPrivate::singleQuote
static

Definition at line 105 of file qquickstyledtext.cpp.

Referenced by parseAttribute(), and parseValue().

◆ slash

const QChar QQuickStyledTextPrivate::slash
static

Definition at line 107 of file qquickstyledtext.cpp.

Referenced by parse(), and parseTag().

◆ space

const QChar QQuickStyledTextPrivate::space
static

Definition at line 113 of file qquickstyledtext.cpp.

Referenced by appendText(), parse(), and parseImageAttributes().

◆ square

const QChar QQuickStyledTextPrivate::square
static

Definition at line 111 of file qquickstyledtext.cpp.

Referenced by parseTag().

◆ tabsize

const int QQuickStyledTextPrivate::tabsize = 6
static

Definition at line 114 of file qquickstyledtext.cpp.

Referenced by parseTag().

◆ text

QString QQuickStyledTextPrivate::text

Definition at line 86 of file qquickstyledtext.cpp.

Referenced by parse().

◆ updateImagePositions

bool QQuickStyledTextPrivate::updateImagePositions = false

Definition at line 96 of file qquickstyledtext.cpp.

Referenced by parse(), and parseImageAttributes().


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