OpenCoverage

qquickstyledtext.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickstyledtext.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3__attribute__((visibility("default"))) int qt_defaultDpi();-
4-
5class QQuickStyledTextPrivate-
6{-
7public:-
8 enum ListType { Ordered, Unordered };-
9 enum ListFormat { Bullet, Disc, Square, Decimal, LowerAlpha, UpperAlpha, LowerRoman, UpperRoman };-
10-
11 struct List {-
12 int level;-
13 ListType type;-
14 ListFormat format;-
15 };-
16-
17 QQuickStyledTextPrivate(const QString &t, QTextLayout &l,-
18 QList<QQuickStyledTextImgTag*> &imgTags,-
19 const QUrl &baseUrl,-
20 QQmlContext *context,-
21 bool preloadImages,-
22 bool *fontSizeModified)-
23 : text(t), layout(l), imgTags(&imgTags), baseFont(layout.font()), baseUrl(baseUrl), hasNewLine(true), nbImages(0), updateImagePositions(false)-
24 , preFormat(false), prependSpace(false), hasSpace(true), preloadImages(preloadImages), fontSizeModified(fontSizeModified), context(context)-
25 {-
26 }
executed 2146 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2146
27-
28 void parse();-
29 void appendText(const QString &textIn, int start, int length, QString &textOut);-
30 bool parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format);-
31 bool parseCloseTag(const QChar *&ch, const QString &textIn, QString &textOut);-
32 void parseEntity(const QChar *&ch, const QString &textIn, QString &textOut);-
33 bool parseFontAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format);-
34 bool parseOrderedListAttributes(const QChar *&ch, const QString &textIn);-
35 bool parseUnorderedListAttributes(const QChar *&ch, const QString &textIn);-
36 bool parseAnchorAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format);-
37 void parseImageAttributes(const QChar *&ch, const QString &textIn, QString &textOut);-
38 QPair<QStringRef,QStringRef> parseAttribute(const QChar *&ch, const QString &textIn);-
39 QStringRef parseValue(const QChar *&ch, const QString &textIn);-
40 void setFontSize(int size, QTextCharFormat &format);-
41-
42 inline void skipSpace(const QChar *&ch) {-
43 while (ch->isSpace()
ch->isSpace()Description
TRUEevaluated 1046 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6806 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
&& !ch->isNull()
!ch->isNull()Description
TRUEevaluated 1046 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
)
0-6806
44 ++
executed 1046 times by 3 tests: ++ch;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
ch;
executed 1046 times by 3 tests: ++ch;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
1046
45 }
executed 6806 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
6806
46-
47 static QString toAlpha(int value, bool upper);-
48 static QString toRoman(int value, bool upper);-
49-
50 QString text;-
51 QTextLayout &layout;-
52 QList<QQuickStyledTextImgTag*> *imgTags;-
53 QFont baseFont;-
54 QStack<List> listStack;-
55 QUrl baseUrl;-
56 bool hasNewLine;-
57 int nbImages;-
58 bool updateImagePositions;-
59 bool preFormat;-
60 bool prependSpace;-
61 bool hasSpace;-
62 bool preloadImages;-
63 bool *fontSizeModified;-
64 QQmlContext *context;-
65-
66 static const QChar lessThan;-
67 static const QChar greaterThan;-
68 static const QChar equals;-
69 static const QChar singleQuote;-
70 static const QChar doubleQuote;-
71 static const QChar slash;-
72 static const QChar ampersand;-
73 static const QChar bullet;-
74 static const QChar disc;-
75 static const QChar square;-
76 static const QChar lineFeed;-
77 static const QChar space;-
78 static const int tabsize = 6;-
79};-
80-
81const QChar QQuickStyledTextPrivate::lessThan(QLatin1Char('<'));-
82const QChar QQuickStyledTextPrivate::greaterThan(QLatin1Char('>'));-
83const QChar QQuickStyledTextPrivate::equals(QLatin1Char('='));-
84const QChar QQuickStyledTextPrivate::singleQuote(QLatin1Char('\''));-
85const QChar QQuickStyledTextPrivate::doubleQuote(QLatin1Char('\"'));-
86const QChar QQuickStyledTextPrivate::slash(QLatin1Char('/'));-
87const QChar QQuickStyledTextPrivate::ampersand(QLatin1Char('&'));-
88const QChar QQuickStyledTextPrivate::bullet(0x2022);-
89const QChar QQuickStyledTextPrivate::disc(0x25e6);-
90const QChar QQuickStyledTextPrivate::square(0x25a1);-
91const QChar QQuickStyledTextPrivate::lineFeed(QLatin1Char('\n'));-
92const QChar QQuickStyledTextPrivate::space(QLatin1Char(' '));-
93-
94QQuickStyledText::QQuickStyledText(const QString &string, QTextLayout &layout,-
95 QList<QQuickStyledTextImgTag*> &imgTags,-
96 const QUrl &baseUrl,-
97 QQmlContext *context,-
98 bool preloadImages,-
99 bool *fontSizeModified)-
100 : d(new QQuickStyledTextPrivate(string, layout, imgTags, baseUrl, context, preloadImages, fontSizeModified))-
101{-
102}
executed 2146 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2146
103-
104QQuickStyledText::~QQuickStyledText()-
105{-
106 delete d;-
107}
executed 2146 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2146
108-
109void QQuickStyledText::parse(const QString &string, QTextLayout &layout,-
110 QList<QQuickStyledTextImgTag*> &imgTags,-
111 const QUrl &baseUrl,-
112 QQmlContext *context,-
113 bool preloadImages,-
114 bool *fontSizeModified)-
115{-
116 if (string.isEmpty()
string.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 2146 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
)
2-2146
117 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickstyledtext
2
118 QQuickStyledText styledText(string, layout, imgTags, baseUrl, context, preloadImages, fontSizeModified);-
119 styledText.d->parse();-
120}
executed 2146 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2146
121-
122void QQuickStyledTextPrivate::parse()-
123{-
124 QVector<QTextLayout::FormatRange> ranges;-
125 QStack<QTextCharFormat> formatStack;-
126-
127 QString drawText;-
128 drawText.reserve(text.count());-
129-
130 updateImagePositions = !imgTags->isEmpty();-
131-
132 int textStart = 0;-
133 int textLength = 0;-
134 int rangeStart = 0;-
135 bool formatChanged = false;-
136-
137 const QChar *ch = text.constData();-
138 while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 20051504 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 2146 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
2146-20051504
139 if (*
*ch == lessThanDescription
TRUEevaluated 4844 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 20046660 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
ch == lessThan
*ch == lessThanDescription
TRUEevaluated 4844 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 20046660 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
4844-20046660
140 if (textLength
textLengthDescription
TRUEevaluated 2356 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 2488 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
2356-2488
141 appendText(text, textStart, textLength, drawText);-
142 }
executed 2356 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
else if (prependSpace
prependSpaceDescription
TRUEevaluated 1676 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 812 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
812-2356
143 drawText.append(space);-
144 prependSpace = false;-
145 hasSpace = true;-
146 }
executed 1676 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
1676
147-
148 if (rangeStart != drawText.length()
rangeStart != ...wText.length()Description
TRUEevaluated 4066 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 778 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
&& formatStack.count()
formatStack.count()Description
TRUEevaluated 2316 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 1750 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
778-4066
149 if (formatChanged
formatChangedDescription
TRUEevaluated 2298 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 18 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
18-2298
150 QTextLayout::FormatRange formatRange;-
151 formatRange.format = formatStack.top();-
152 formatRange.start = rangeStart;-
153 formatRange.length = drawText.length() - rangeStart;-
154 ranges.append(formatRange);-
155 formatChanged = false;-
156 }
executed 2298 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
else if (ranges.count()
ranges.count()Description
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
) {
0-2298
157 ranges.last().length += drawText.length() - rangeStart;-
158 }
executed 18 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
18
159 }
executed 2316 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2316
160 rangeStart = drawText.length();-
161 ++ch;-
162 if (*
*ch == slashDescription
TRUEevaluated 2220 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2624 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
ch == slash
*ch == slashDescription
TRUEevaluated 2220 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2624 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
2220-2624
163 ++ch;-
164 if (parseCloseTag(ch, text, drawText)
parseCloseTag(...ext, drawText)Description
TRUEevaluated 2106 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
114-2106
165 if (formatStack.count()
formatStack.count()Description
TRUEevaluated 2090 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
16-2090
166 formatChanged = true;-
167 formatStack.pop();-
168 }
executed 2090 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
2090
169 }
executed 2106 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
2106
170 }
executed 2220 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
else {
2220
171 QTextCharFormat format;-
172 if (formatStack.count()
formatStack.count()Description
TRUEevaluated 256 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 2368 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
)
256-2368
173 format = formatStack.top();
executed 256 times by 4 tests: format = formatStack.top();
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
256
174 if (parseTag(ch, text, drawText, format)
parseTag(ch, t...wText, format)Description
TRUEevaluated 2120 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 504 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
504-2120
175 formatChanged = true;-
176 formatStack.push(format);-
177 }
executed 2120 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2120
178 }
executed 2624 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2624
179 textStart = ch - text.constData() + 1;-
180 textLength = 0;-
181 }
executed 4844 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
else if (*
*ch == ampersandDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 20046630 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
ch == ampersand
*ch == ampersandDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 20046630 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
30-20046630
182 ++ch;-
183 appendText(text, textStart, textLength, drawText);-
184 parseEntity(ch, text, drawText);-
185 textStart = ch - text.constData() + 1;-
186 textLength = 0;-
187 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (ch->isSpace()
ch->isSpace()Description
TRUEevaluated 7448 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 20039182 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
30-20039182
188 if (textLength
textLengthDescription
TRUEevaluated 6012 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 1436 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
)
1436-6012
189 appendText(text, textStart, textLength, drawText);
executed 6012 times by 6 tests: appendText(text, textStart, textLength, drawText);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
6012
190 if (!preFormat
!preFormatDescription
TRUEevaluated 7442 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
6-7442
191 prependSpace = !hasSpace;-
192 for (const QChar *n = ch + 1; !n->isNull()
!n->isNull()Description
TRUEevaluated 20009776 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& n->isSpace()
n->isSpace()Description
TRUEevaluated 20002340 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 7436 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
; ++n)
6-20009776
193 ch = n;
executed 20002340 times by 3 tests: ch = n;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
20002340
194 hasNewLine = false;-
195 }
executed 7442 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
else if (*
*ch == lineFeedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch == lineFeed
*ch == lineFeedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-7442
196 drawText.append(QChar(QChar::LineSeparator));-
197 hasNewLine = true;-
198 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else {
2
199 drawText.append(QChar(QChar::Nbsp));-
200 hasNewLine = false;-
201 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
4
202 textStart = ch - text.constData() + 1;-
203 textLength = 0;-
204 }
executed 7448 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
else {
7448
205 ++textLength;-
206 }
executed 20039182 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
20039182
207 if (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 20051494 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
)
10-20051494
208 ++
executed 20051494 times by 7 tests: ++ch;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
ch;
executed 20051494 times by 7 tests: ++ch;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
20051494
209 }
executed 20051504 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
20051504
210 if (textLength
textLengthDescription
TRUEevaluated 1902 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 244 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
)
244-1902
211 appendText(text, textStart, textLength, drawText);
executed 1902 times by 6 tests: appendText(text, textStart, textLength, drawText);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
1902
212 if (rangeStart != drawText.length()
rangeStart != ...wText.length()Description
TRUEevaluated 1958 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 188 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
&& formatStack.count()
formatStack.count()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 1938 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
) {
20-1958
213 if (formatChanged
formatChangedDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
4-16
214 QTextLayout::FormatRange formatRange;-
215 formatRange.format = formatStack.top();-
216 formatRange.start = rangeStart;-
217 formatRange.length = drawText.length() - rangeStart;-
218 ranges.append(formatRange);-
219 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (ranges.count()
ranges.count()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-16
220 ranges.last().length += drawText.length() - rangeStart;-
221 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
4
222 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
20
223-
224 layout.setText(drawText);-
225 layout.setFormats(ranges);-
226}
executed 2146 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
2146
227-
228void QQuickStyledTextPrivate::appendText(const QString &textIn, int start, int length, QString &textOut)-
229{-
230 if (prependSpace
prependSpaceDescription
TRUEevaluated 4940 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 5360 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
)
4940-5360
231 textOut.append(space);
executed 4940 times by 6 tests: textOut.append(space);
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
4940
232 textOut.append(QStringRef(&textIn, start, length));-
233 prependSpace = false;-
234 hasSpace = false;-
235 hasNewLine = false;-
236}
executed 10300 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
10300
237-
238-
239-
240-
241-
242void QQuickStyledTextPrivate::setFontSize(int size, QTextCharFormat &format)-
243{-
244 static const qreal scaling[] = { 0.7, 0.8, 1.0, 1.2, 1.5, 2.0, 2.4 };-
245 if (baseFont.pointSizeF() != -1
baseFont.pointSizeF() != -1Description
TRUEevaluated 666 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 648 times by 1 test
Evaluated by:
  • tst_qquicktext
)
648-666
246 format.setFontPointSize(baseFont.pointSize() * scaling[size - 1]);
executed 666 times by 2 tests: format.setFontPointSize(baseFont.pointSize() * scaling[size - 1]);
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
666
247 else-
248 format.setFontPointSize(baseFont.pixelSize() * qreal(72.) / qreal(qt_defaultDpi()) * scaling[size - 1]);
executed 648 times by 1 test: format.setFontPointSize(baseFont.pixelSize() * qreal(72.) / qreal(qt_defaultDpi()) * scaling[size - 1]);
Executed by:
  • tst_qquicktext
648
249 *fontSizeModified = true;-
250}
executed 1314 times by 2 tests: end of block
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
1314
251-
252bool QQuickStyledTextPrivate::parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format)-
253{-
254 skipSpace(ch);-
255-
256 int tagStart = ch - textIn.constData();-
257 int tagLength = 0;-
258 while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 8732 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
) {
4-8732
259 if (*
*ch == greaterThanDescription
TRUEevaluated 1684 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 7048 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
ch == greaterThan
*ch == greaterThanDescription
TRUEevaluated 1684 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 7048 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
1684-7048
260 if (tagLength == 0
tagLength == 0Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
FALSEevaluated 1678 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
)
6-1678
261 return
executed 6 times by 2 tests: return false;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
false;
executed 6 times by 2 tests: return false;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
6
262 QStringRef tag(&textIn, tagStart, tagLength);-
263 const QChar char0 = tag.at(0);-
264 if (char0 == QLatin1Char('b')
char0 == QLatin1Char('b')Description
TRUEevaluated 760 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 918 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
760-918
265 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 586 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 174 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
) {
174-586
266 format.setFontWeight(QFont::Bold);-
267 return
executed 586 times by 7 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
true;
executed 586 times by 7 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
586
268 } else if (tagLength == 2
tagLength == 2Description
TRUEevaluated 168 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& tag.at(1) == QLatin1Char('r')
tag.at(1) == QLatin1Char('r')Description
TRUEevaluated 166 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-168
269 textOut.append(QChar(QChar::LineSeparator));-
270 hasSpace = true;-
271 prependSpace = false;-
272 return
executed 166 times by 2 tests: return false;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
false;
executed 166 times by 2 tests: return false;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
166
273 }-
274 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (char0 == QLatin1Char('i')
char0 == QLatin1Char('i')Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 846 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
8-846
275 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 70 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-70
276 format.setFontItalic(true);-
277 return
executed 70 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 70 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
70
278 }-
279 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (char0 == QLatin1Char('p')
char0 == QLatin1Char('p')Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 824 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
2-824
280 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
10-12
281 if (!hasNewLine
!hasNewLineDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
)
0-12
282 textOut.append(QChar::LineSeparator);
executed 12 times by 2 tests: textOut.append(QChar::LineSeparator);
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
12
283 hasSpace = true;-
284 prependSpace = false;-
285 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
else if (tag == QLatin1String("pre")
tag == QLatin1String("pre")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
4-12
286 preFormat = true;-
287 if (!hasNewLine
!hasNewLineDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
)
0-4
288 textOut.append(QChar::LineSeparator);
executed 4 times by 1 test: textOut.append(QChar::LineSeparator);
Executed by:
  • tst_qquickstyledtext
4
289 format.setFontFamily(QString::fromLatin1("Courier New,courier"));-
290 format.setFontFixedPitch(true);-
291 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
4
292 }-
293 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
else if (char0 == QLatin1Char('u')
char0 == QLatin1Char('u')Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 806 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
18-806
294 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
4-14
295 format.setFontUnderline(true);-
296 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
4
297 } else if (tag == QLatin1String("ul")
tag == QLatin1String("ul")Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-12
298 List listItem;-
299 listItem.level = 0;-
300 listItem.type = Unordered;-
301 listItem.format = Bullet;-
302 listStack.push(listItem);-
303 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
12
304 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
else if (char0 == QLatin1Char('h')
char0 == QLatin1Char('h')Description
TRUEevaluated 660 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 146 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
&& tagLength == 2
tagLength == 2Description
TRUEevaluated 644 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
) {
14-660
305 int level = tag.at(1).digitValue();-
306 if (level >= 1
level >= 1Description
TRUEevaluated 642 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& level <= 6
level <= 6Description
TRUEevaluated 640 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-642
307 if (!hasNewLine
!hasNewLineDescription
TRUEevaluated 624 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
16-624
308 textOut.append(QChar::LineSeparator);
executed 624 times by 1 test: textOut.append(QChar::LineSeparator);
Executed by:
  • tst_qquicktext
624
309 hasSpace = true;-
310 prependSpace = false;-
311 setFontSize(7 - level, format);-
312 format.setFontWeight(QFont::Bold);-
313 return
executed 640 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 640 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
640
314 }-
315 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (tag == QLatin1String("strong")
tag == QLatin1String("strong")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 160 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
2-160
316 format.setFontWeight(QFont::Bold);-
317 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
2
318 } else if (tag == QLatin1String("ol")
tag == QLatin1String("ol")Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 148 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
12-148
319 List listItem;-
320 listItem.level = 0;-
321 listItem.type = Ordered;-
322 listItem.format = Decimal;-
323 listStack.push(listItem);-
324 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
else if (tag == QLatin1String("li")
tag == QLatin1String("li")Description
TRUEevaluated 110 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
12-110
325 if (!hasNewLine
!hasNewLineDescription
TRUEevaluated 86 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
24-86
326 textOut.append(QChar(QChar::LineSeparator));
executed 86 times by 2 tests: textOut.append(QChar(QChar::LineSeparator));
Executed by:
  • tst_examples
  • tst_qquickstyledtext
86
327 if (!listStack.isEmpty()
!listStack.isEmpty()Description
TRUEevaluated 110 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-110
328 int count = ++listStack.top().level;-
329 for (int i = 0; i < listStack.size()
i < listStack.size()Description
TRUEevaluated 110 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 110 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
; ++i)
110
330 textOut += QString(tabsize, QChar::Nbsp);
executed 110 times by 2 tests: textOut += QString(tabsize, QChar::Nbsp);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
110
331 switch (listStack.top().format) {-
332 case
executed 40 times by 2 tests: case Decimal:
Executed by:
  • tst_examples
  • tst_qquickstyledtext
Decimal:
executed 40 times by 2 tests: case Decimal:
Executed by:
  • tst_examples
  • tst_qquickstyledtext
40
333 textOut += QString::number(count) % QLatin1Char('.');-
334 break;
executed 40 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
40
335 case
executed 4 times by 1 test: case LowerAlpha:
Executed by:
  • tst_qquickstyledtext
LowerAlpha:
executed 4 times by 1 test: case LowerAlpha:
Executed by:
  • tst_qquickstyledtext
4
336 textOut += toAlpha(count, false) % QLatin1Char('.');-
337 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
338 case
executed 4 times by 1 test: case UpperAlpha:
Executed by:
  • tst_qquickstyledtext
UpperAlpha:
executed 4 times by 1 test: case UpperAlpha:
Executed by:
  • tst_qquickstyledtext
4
339 textOut += toAlpha(count, true) % QLatin1Char('.');-
340 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
341 case
executed 4 times by 1 test: case LowerRoman:
Executed by:
  • tst_qquickstyledtext
LowerRoman:
executed 4 times by 1 test: case LowerRoman:
Executed by:
  • tst_qquickstyledtext
4
342 textOut += toRoman(count, false) % QLatin1Char('.');-
343 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
344 case
executed 4 times by 1 test: case UpperRoman:
Executed by:
  • tst_qquickstyledtext
UpperRoman:
executed 4 times by 1 test: case UpperRoman:
Executed by:
  • tst_qquickstyledtext
4
345 textOut += toRoman(count, true) % QLatin1Char('.');-
346 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
347 case
executed 46 times by 2 tests: case Bullet:
Executed by:
  • tst_examples
  • tst_qquickstyledtext
Bullet:
executed 46 times by 2 tests: case Bullet:
Executed by:
  • tst_examples
  • tst_qquickstyledtext
46
348 textOut += bullet;-
349 break;
executed 46 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
46
350 case
executed 4 times by 1 test: case Disc:
Executed by:
  • tst_qquickstyledtext
Disc:
executed 4 times by 1 test: case Disc:
Executed by:
  • tst_qquickstyledtext
4
351 textOut += disc;-
352 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
353 case
executed 4 times by 1 test: case Square:
Executed by:
  • tst_qquickstyledtext
Square:
executed 4 times by 1 test: case Square:
Executed by:
  • tst_qquickstyledtext
4
354 textOut += square;-
355 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
356 }-
357 textOut += QString(2, QChar::Nbsp);-
358 }
executed 110 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
110
359 }
executed 110 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
110
360 return
executed 206 times by 3 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
false;
executed 206 times by 3 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
206
361 } else if (ch->isSpace()
ch->isSpace()Description
TRUEevaluated 938 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6110 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
) {
938-6110
362-
363 QStringRef tag(&textIn, tagStart, tagLength);-
364 if (tag == QLatin1String("font")
tag == QLatin1String("font")Description
TRUEevaluated 694 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 244 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
)
244-694
365 return
executed 694 times by 3 tests: return parseFontAttributes(ch, textIn, format);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
parseFontAttributes(ch, textIn, format);
executed 694 times by 3 tests: return parseFontAttributes(ch, textIn, format);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
694
366 if (tag == QLatin1String("ol")
tag == QLatin1String("ol")Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 234 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
10-234
367 parseOrderedListAttributes(ch, textIn);-
368 return
executed 10 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
10
369 }-
370 if (tag == QLatin1String("ul")
tag == QLatin1String("ul")Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 228 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
6-228
371 parseUnorderedListAttributes(ch, textIn);-
372 return
executed 6 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
6
373 }-
374 if (tag == QLatin1String("a")
tag == QLatin1String("a")Description
TRUEevaluated 130 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 98 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
98-130
375 return
executed 130 times by 2 tests: return parseAnchorAttributes(ch, textIn, format);
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
parseAnchorAttributes(ch, textIn, format);
executed 130 times by 2 tests: return parseAnchorAttributes(ch, textIn, format);
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
130
376 }-
377 if (tag == QLatin1String("img")
tag == QLatin1String("img")Description
TRUEevaluated 96 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-96
378 parseImageAttributes(ch, textIn, textOut);-
379 return
executed 96 times by 3 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
false;
executed 96 times by 3 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
96
380 }-
381 if (*
*ch == greaterThanDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch == greaterThan
*ch == greaterThanDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
|| ch->isNull()
ch->isNull()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
0-2
382 continue;
never executed: continue;
0
383 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (*
*ch != slashDescription
TRUEevaluated 5974 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
ch != slash
*ch != slashDescription
TRUEevaluated 5974 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
) {
2-5974
384 tagLength++;-
385 }
executed 5974 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
5974
386 ++ch;-
387 }
executed 6112 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
  • tst_qquicktextedit
6112
388 return
executed 4 times by 2 tests: return false;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
false;
executed 4 times by 2 tests: return false;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktextedit
4
389}-
390-
391bool QQuickStyledTextPrivate::parseCloseTag(const QChar *&ch, const QString &textIn, QString &textOut)-
392{-
393 skipSpace(ch);-
394-
395 int tagStart = ch - textIn.constData();-
396 int tagLength = 0;-
397 while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 7304 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
4-7304
398 if (*
*ch == greaterThanDescription
TRUEevaluated 2216 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 5088 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
ch == greaterThan
*ch == greaterThanDescription
TRUEevaluated 2216 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 5088 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
) {
2216-5088
399 if (tagLength == 0
tagLength == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 2214 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
)
2-2214
400 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
2
401 QStringRef tag(&textIn, tagStart, tagLength);-
402 const QChar char0 = tag.at(0);-
403 hasNewLine = false;-
404 if (char0 == QLatin1Char('b')
char0 == QLatin1Char('b')Description
TRUEevaluated 576 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 1638 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
576-1638
405 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 576 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
)
0-576
406 return
executed 576 times by 6 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 576 times by 6 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
576
407 else if (tag.at(1) == QLatin1Char('r')
tag.at(1) == QLatin1Char('r')Description
TRUEnever evaluated
FALSEnever evaluated
&& tagLength == 2
tagLength == 2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
408 return
never executed: return false;
false;
never executed: return false;
0
409 }
never executed: end of block
else if (char0 == QLatin1Char('i')
char0 == QLatin1Char('i')Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 1566 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
0-1566
410 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 70 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-70
411 return
executed 70 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 70 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
70
412 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (char0 == QLatin1Char('a')
char0 == QLatin1Char('a')Description
TRUEevaluated 130 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 1436 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
2-1436
413 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-128
414 return
executed 128 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 128 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
128
415 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
else if (char0 == QLatin1Char('p')
char0 == QLatin1Char('p')Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 1426 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
2-1426
416 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
4-6
417 textOut.append(QChar::LineSeparator);-
418 hasNewLine = true;-
419 hasSpace = true;-
420 return
executed 6 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
6
421 } else if (tag == QLatin1String("pre")
tag == QLatin1String("pre")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-4
422 preFormat = false;-
423 if (!hasNewLine
!hasNewLineDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
)
0-4
424 textOut.append(QChar::LineSeparator);
executed 4 times by 1 test: textOut.append(QChar::LineSeparator);
Executed by:
  • tst_qquickstyledtext
4
425 hasNewLine = true;-
426 hasSpace = true;-
427 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
4
428 }-
429 }
never executed: end of block
else if (char0 == QLatin1Char('u')
char0 == QLatin1Char('u')Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 1406 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
0-1406
430 if (tagLength == 1
tagLength == 1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
)
4-16
431 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
4
432 else if (tag == QLatin1String("ul")
tag == QLatin1String("ul")Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-16
433 if (!listStack.isEmpty()
!listStack.isEmpty()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-16
434 listStack.pop();-
435 if (!listStack.count()
!listStack.count()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEnever evaluated
)
0-16
436 textOut.append(QChar::LineSeparator);
executed 16 times by 2 tests: textOut.append(QChar::LineSeparator);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
16
437 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
16
438 return
executed 16 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
false;
executed 16 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
16
439 }-
440 }
never executed: end of block
else if (char0 == QLatin1Char('h')
char0 == QLatin1Char('h')Description
TRUEevaluated 644 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 762 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
&& tagLength == 2
tagLength == 2Description
TRUEevaluated 628 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
) {
0-762
441 textOut.append(QChar::LineSeparator);-
442 hasNewLine = true;-
443 hasSpace = true;-
444 return
executed 628 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 628 times by 2 tests: return true;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
628
445 } else if (tag == QLatin1String("font")
tag == QLatin1String("font")Description
TRUEevaluated 694 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 84 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
84-694
446 return
executed 694 times by 3 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
true;
executed 694 times by 3 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
694
447 } else if (tag == QLatin1String("strong")
tag == QLatin1String("strong")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 82 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
2-82
448 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qquickstyledtext
2
449 } else if (tag == QLatin1String("ol")
tag == QLatin1String("ol")Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
20-62
450 if (!listStack.isEmpty()
!listStack.isEmpty()Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-20
451 listStack.pop();-
452 if (!listStack.count()
!listStack.count()Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEnever evaluated
)
0-20
453 textOut.append(QChar::LineSeparator);
executed 20 times by 2 tests: textOut.append(QChar::LineSeparator);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
20
454 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
20
455 return
executed 20 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
false;
executed 20 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
20
456 } else if (tag == QLatin1String("li")
tag == QLatin1String("li")Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
) {
22-40
457 return
executed 40 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
false;
executed 40 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
40
458 }-
459 return
executed 26 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
false;
executed 26 times by 2 tests: return false;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
26
460 } else if (!ch->isSpace()
!ch->isSpace()Description
TRUEevaluated 5088 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
){
0-5088
461 tagLength++;-
462 }
executed 5088 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
5088
463 ++ch;-
464 }
executed 5088 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickstyledtext
  • tst_qquicktext
5088
465-
466 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qquickstyledtext
4
467}-
468-
469void QQuickStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textIn, QString &textOut)-
470{-
471 int entityStart = ch - textIn.constData();-
472 int entityLength = 0;-
473 while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 122 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-122
474 if (*
*ch == QLatin1Char(';')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch == QLatin1Char(';')
*ch == QLatin1Char(';')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
26-96
475 QStringRef entity(&textIn, entityStart, entityLength);-
476 if (entity == QLatin1String("gt")
entity == QLatin1String("gt")Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
6-20
477 textOut += QChar(62);
executed 6 times by 1 test: textOut += QChar(62);
Executed by:
  • tst_qquickstyledtext
6
478 else if (entity == QLatin1String("lt")
entity == QLatin1String("lt")Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
6-14
479 textOut += QChar(60);
executed 6 times by 1 test: textOut += QChar(60);
Executed by:
  • tst_qquickstyledtext
6
480 else if (entity == QLatin1String("amp")
entity == QLatin1String("amp")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
4-10
481 textOut += QChar(38);
executed 4 times by 1 test: textOut += QChar(38);
Executed by:
  • tst_qquickstyledtext
4
482 else if (entity == QLatin1String("quot")
entity == QLat...String("quot")Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
4-6
483 textOut += QChar(34);
executed 6 times by 1 test: textOut += QChar(34);
Executed by:
  • tst_qquickstyledtext
6
484 else if (entity == QLatin1String("nbsp")
entity == QLat...String("nbsp")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2
485 textOut += QChar(QChar::Nbsp);
executed 2 times by 1 test: textOut += QChar(QChar::Nbsp);
Executed by:
  • tst_qquickstyledtext
2
486 return;
executed 26 times by 1 test: return;
Executed by:
  • tst_qquickstyledtext
26
487 } else if (*
*ch == QLatin1Char(' ')Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch == QLatin1Char(' ')
*ch == QLatin1Char(' ')Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
4-92
488 QStringRef entity(&textIn, entityStart - 1, entityLength + 1);-
489 textOut += entity + *ch;-
490 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickstyledtext
4
491 }-
492 ++entityLength;-
493 ++ch;-
494 }
executed 92 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
92
495}
never executed: end of block
0
496-
497bool QQuickStyledTextPrivate::parseFontAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format)-
498{-
499 bool valid = false;-
500 QPair<QStringRef,QStringRef> attr;-
501 do {-
502 attr = parseAttribute(ch, textIn);-
503 if (attr.first == QLatin1String("color")
attr.first == ...tring("color")Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
FALSEevaluated 1370 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
16-1370
504 valid = true;-
505 format.setForeground(QColor(attr.second.toString()));-
506 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
else if (attr.first == QLatin1String("size")
attr.first == ...String("size")Description
TRUEevaluated 674 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 696 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
16-696
507 valid = true;-
508 int size = attr.second.toString().toInt();-
509 if (attr.second.at(0) == QLatin1Char('-')
attr.second.at...atin1Char('-')Description
TRUEnever evaluated
FALSEevaluated 674 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
|| attr.second.at(0) == QLatin1Char('+')
attr.second.at...atin1Char('+')Description
TRUEnever evaluated
FALSEevaluated 674 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
)
0-674
510 size += 3;
never executed: size += 3;
0
511 if (size >= 1
size >= 1Description
TRUEevaluated 674 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
&& size <= 7
size <= 7Description
TRUEevaluated 674 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
)
0-674
512 setFontSize(size, format);
executed 674 times by 2 tests: setFontSize(size, format);
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
674
513 }
executed 674 times by 2 tests: end of block
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
674
514 }
executed 1386 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 1384 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& !attr.first.isEmpty()
!attr.first.isEmpty()Description
TRUEevaluated 692 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 692 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
);
2-1386
515-
516 return
executed 694 times by 3 tests: return valid;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
valid;
executed 694 times by 3 tests: return valid;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
694
517}-
518-
519bool QQuickStyledTextPrivate::parseOrderedListAttributes(const QChar *&ch, const QString &textIn)-
520{-
521 bool valid = false;-
522-
523 List listItem;-
524 listItem.level = 0;-
525 listItem.type = Ordered;-
526 listItem.format = Decimal;-
527-
528 QPair<QStringRef,QStringRef> attr;-
529 do {-
530 attr = parseAttribute(ch, textIn);-
531 if (attr.first == QLatin1String("type")
attr.first == ...String("type")Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
10
532 valid = true;-
533 if (attr.second == QLatin1String("a")
attr.second ==...in1String("a")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-8
534 listItem.format = LowerAlpha;
executed 2 times by 1 test: listItem.format = LowerAlpha;
Executed by:
  • tst_qquickstyledtext
2
535 else if (attr.second == QLatin1String("A")
attr.second ==...in1String("A")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-6
536 listItem.format = UpperAlpha;
executed 2 times by 1 test: listItem.format = UpperAlpha;
Executed by:
  • tst_qquickstyledtext
2
537 else if (attr.second == QLatin1String("i")
attr.second ==...in1String("i")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-4
538 listItem.format = LowerRoman;
executed 2 times by 1 test: listItem.format = LowerRoman;
Executed by:
  • tst_qquickstyledtext
2
539 else if (attr.second == QLatin1String("I")
attr.second ==...in1String("I")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2
540 listItem.format = UpperRoman;
executed 2 times by 1 test: listItem.format = UpperRoman;
Executed by:
  • tst_qquickstyledtext
2
541 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
10
542 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
&& !attr.first.isEmpty()
!attr.first.isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
);
0-20
543-
544 listStack.push(listItem);-
545 return
executed 10 times by 1 test: return valid;
Executed by:
  • tst_qquickstyledtext
valid;
executed 10 times by 1 test: return valid;
Executed by:
  • tst_qquickstyledtext
10
546}-
547-
548bool QQuickStyledTextPrivate::parseUnorderedListAttributes(const QChar *&ch, const QString &textIn)-
549{-
550 bool valid = false;-
551-
552 List listItem;-
553 listItem.level = 0;-
554 listItem.type = Unordered;-
555 listItem.format = Bullet;-
556-
557 QPair<QStringRef,QStringRef> attr;-
558 do {-
559 attr = parseAttribute(ch, textIn);-
560 if (attr.first == QLatin1String("type")
attr.first == ...String("type")Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
6
561 valid = true;-
562 if (attr.second == QLatin1String("disc")
attr.second ==...String("disc")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-4
563 listItem.format = Disc;
executed 2 times by 1 test: listItem.format = Disc;
Executed by:
  • tst_qquickstyledtext
2
564 else if (attr.second == QLatin1String("square")
attr.second ==...ring("square")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2
565 listItem.format = Square;
executed 2 times by 1 test: listItem.format = Square;
Executed by:
  • tst_qquickstyledtext
2
566 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
6
567 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
&& !attr.first.isEmpty()
!attr.first.isEmpty()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
);
0-12
568-
569 listStack.push(listItem);-
570 return
executed 6 times by 1 test: return valid;
Executed by:
  • tst_qquickstyledtext
valid;
executed 6 times by 1 test: return valid;
Executed by:
  • tst_qquickstyledtext
6
571}-
572-
573bool QQuickStyledTextPrivate::parseAnchorAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format)-
574{-
575 bool valid = false;-
576-
577 QPair<QStringRef,QStringRef> attr;-
578 do {-
579 attr = parseAttribute(ch, textIn);-
580 if (attr.first == QLatin1String("href")
attr.first == ...String("href")Description
TRUEevaluated 124 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 132 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
) {
124-132
581 format.setAnchorHref(attr.second.toString());-
582 format.setAnchor(true);-
583 format.setFontUnderline(true);-
584 valid = true;-
585 }
executed 124 times by 2 tests: end of block
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
124
586 }
executed 256 times by 2 tests: end of block
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 256 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
&& !attr.first.isEmpty()
!attr.first.isEmpty()Description
TRUEevaluated 126 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 130 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
);
0-256
587-
588 return
executed 130 times by 2 tests: return valid;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
valid;
executed 130 times by 2 tests: return valid;
Executed by:
  • tst_qquickstyledtext
  • tst_qquicktext
130
589}-
590-
591void QQuickStyledTextPrivate::parseImageAttributes(const QChar *&ch, const QString &textIn, QString &textOut)-
592{-
593 qreal imgWidth = 0.0;-
594 QFontMetricsF fm(layout.font());-
595 const qreal spaceWidth = fm.width(QChar::Nbsp);-
596 const bool trailingSpace = textOut.endsWith(space);-
597-
598 if (!updateImagePositions
!updateImagePositionsDescription
TRUEevaluated 86 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
) {
10-86
599 QQuickStyledTextImgTag *image = new QQuickStyledTextImgTag;-
600 image->position = textOut.length() + (trailingSpace
trailingSpaceDescription
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 34 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
? 0 : 1);
34-52
601-
602 QPair<QStringRef,QStringRef> attr;-
603 do {-
604 attr = parseAttribute(ch, textIn);-
605 if (attr.first == QLatin1String("src")
attr.first == ...1String("src")Description
TRUEevaluated 86 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 180 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
86-180
606 image->url = QUrl(attr.second.toString());-
607 }
executed 86 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
else if (attr.first == QLatin1String("width")
attr.first == ...tring("width")Description
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 150 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
30-150
608 image->size.setWidth(attr.second.toString().toInt());-
609 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
else if (attr.first == QLatin1String("height")
attr.first == ...ring("height")Description
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 120 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
30-120
610 image->size.setHeight(attr.second.toString().toInt());-
611 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
else if (attr.first == QLatin1String("align")
attr.first == ...tring("align")Description
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 86 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
30-86
612 if (attr.second.toString() == QLatin1String("top")
attr.second.to...1String("top")Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
) {
8-26
613 image->align = QQuickStyledTextImgTag::Top;-
614 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
else if (attr.second.toString() == QLatin1String("middle")
attr.second.to...ring("middle")Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
) {
8-16
615 image->align = QQuickStyledTextImgTag::Middle;-
616 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
16
617 }
executed 34 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
34
618 }
executed 266 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 266 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
&& !attr.first.isEmpty()
!attr.first.isEmpty()Description
TRUEevaluated 180 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 86 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
);
0-266
619-
620 if (preloadImages
preloadImagesDescription
TRUEevaluated 80 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qquickstyledtext
  • tst_qquicktext
&& !image->size.isValid()
!image->size.isValid()Description
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
) {
6-80
621-
622-
623-
624 QUrl url = baseUrl.resolved(image->url);-
625 if (url.isLocalFile()
url.isLocalFile()Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
) {
8-44
626 image->pix = new QQuickPixmap(context->engine(), url, image->size);-
627 if (image->pix
image->pixDescription
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEnever evaluated
&& image->pix->isReady()
image->pix->isReady()Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEnever evaluated
) {
0-44
628 image->size = image->pix->implicitSize();-
629 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
else {
44
630 delete image->pix;-
631 image->pix = nullptr;-
632 }
never executed: end of block
0
633 }-
634 }
executed 52 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
52
635-
636 imgWidth = image->size.width();-
637 image->offset = -std::fmod(imgWidth, spaceWidth) / 2.0;-
638 imgTags->append(image);-
639-
640 }
executed 86 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
else {
86
641-
642-
643 QQuickStyledTextImgTag *image = imgTags->value(nbImages);-
644 image->position = textOut.length() + (trailingSpace
trailingSpaceDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
? 0 : 1);
4-6
645 imgWidth = image->size.width();-
646 image->offset = -std::fmod(imgWidth, spaceWidth) / 2.0;-
647 QPair<QStringRef,QStringRef> attr;-
648 do {-
649 attr = parseAttribute(ch, textIn);-
650 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEnever evaluated
&& !attr.first.isEmpty()
!attr.first.isEmpty()Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
);
0-22
651 nbImages++;-
652 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
10
653-
654 QString padding(qFloor(imgWidth / spaceWidth), QChar::Nbsp);-
655 if (!trailingSpace
!trailingSpaceDescription
TRUEevaluated 38 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
)
38-58
656 textOut += QLatin1Char(' ');
executed 38 times by 3 tests: textOut += QLatin1Char(' ');
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
38
657 textOut += padding + QLatin1Char(' ');-
658}
executed 96 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
96
659-
660QPair<QStringRef,QStringRef> QQuickStyledTextPrivate::parseAttribute(const QChar *&ch, const QString &textIn)-
661{-
662 skipSpace(ch);-
663-
664 int attrStart = ch - textIn.constData();-
665 int attrLength = 0;-
666 while (!ch->isNull()
!ch->isNull()Description
TRUEevaluated 6186 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEnever evaluated
) {
0-6186
667 if (*
*ch == greaterThanDescription
TRUEevaluated 930 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 5256 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
ch == greaterThan
*ch == greaterThanDescription
TRUEevaluated 930 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 5256 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
930-5256
668 break;
executed 930 times by 3 tests: break;
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
930
669 } else if (*
*ch == equalsDescription
TRUEevaluated 1032 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 4224 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
ch == equals
*ch == equalsDescription
TRUEevaluated 1032 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 4224 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
1032-4224
670 ++ch;-
671 if (*
*ch != singleQuoteDescription
TRUEevaluated 1028 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch != singleQuote
*ch != singleQuoteDescription
TRUEevaluated 1028 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& *
*ch != doubleQuoteDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 1024 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
ch != doubleQuote
*ch != doubleQuoteDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 1024 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
) {
4-1028
672 while (*
*ch != greaterThanDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch != greaterThan
*ch != greaterThanDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& !ch->isNull()
!ch->isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-4
673 ++
never executed: ++ch;
ch;
never executed: ++ch;
0
674 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
4
675 }-
676 ++ch;-
677 if (!attrLength
!attrLengthDescription
TRUEnever evaluated
FALSEevaluated 1028 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
)
0-1028
678 break;
never executed: break;
0
679 QStringRef attr(&textIn, attrStart, attrLength);-
680 QStringRef val = parseValue(ch, textIn);-
681 if (!val.isEmpty()
!val.isEmpty()Description
TRUEevaluated 1026 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
2-1026
682 return
executed 1026 times by 3 tests: return QPair<QStringRef,QStringRef>(attr,val);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
QPair<QStringRef,QStringRef>(attr,val);
executed 1026 times by 3 tests: return QPair<QStringRef,QStringRef>(attr,val);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
1026
683 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquickstyledtext
2
684 } else {-
685 ++attrLength;-
686 }
executed 4224 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
4224
687 ++ch;-
688 }
executed 4224 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
4224
689-
690 return
executed 936 times by 3 tests: return QPair<QStringRef,QStringRef>();
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
QPair<QStringRef,QStringRef>();
executed 936 times by 3 tests: return QPair<QStringRef,QStringRef>();
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
936
691}-
692-
693QStringRef QQuickStyledTextPrivate::parseValue(const QChar *&ch, const QString &textIn)-
694{-
695 int valStart = ch - textIn.constData();-
696 int valLength = 0;-
697 while (*
*ch != singleQuoteDescription
TRUEevaluated 7680 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
ch != singleQuote
*ch != singleQuoteDescription
TRUEevaluated 7680 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
&& *
*ch != doubleQuoteDescription
TRUEevaluated 6660 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 1020 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
ch != doubleQuote
*ch != doubleQuoteDescription
TRUEevaluated 6660 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 1020 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
&& !ch->isNull()
!ch->isNull()Description
TRUEevaluated 6658 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
2-7680
698 ++valLength;-
699 ++ch;-
700 }
executed 6658 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
6658
701 if (ch->isNull()
ch->isNull()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 1026 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
)
2-1026
702 return
executed 2 times by 1 test: return QStringRef();
Executed by:
  • tst_qquickstyledtext
QStringRef();
executed 2 times by 1 test: return QStringRef();
Executed by:
  • tst_qquickstyledtext
2
703 ++ch;-
704-
705 return
executed 1026 times by 3 tests: return QStringRef(&textIn, valStart, valLength);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
QStringRef(&textIn, valStart, valLength);
executed 1026 times by 3 tests: return QStringRef(&textIn, valStart, valLength);
Executed by:
  • tst_examples
  • tst_qquickstyledtext
  • tst_qquicktext
1026
706}-
707-
708QString QQuickStyledTextPrivate::toAlpha(int value, bool upper)-
709{-
710 const char baseChar = upper
upperDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
? 'A' : 'a';
4
711-
712 QString result;-
713 int c = value;-
714 while (c > 0
c > 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
8
715 c--;-
716 result.prepend(QChar(baseChar + (c % 26)));-
717 c /= 26;-
718 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
8
719 return
executed 8 times by 1 test: return result;
Executed by:
  • tst_qquickstyledtext
result;
executed 8 times by 1 test: return result;
Executed by:
  • tst_qquickstyledtext
8
720}-
721-
722QString QQuickStyledTextPrivate::toRoman(int value, bool upper)-
723{-
724 QString result = QLatin1String("?");-
725-
726 if (value < 5000
value < 5000Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEnever evaluated
) {
0-8
727 QByteArray romanNumeral;-
728-
729 static const char romanSymbolsLower[] = "iiivixxxlxcccdcmmmm";-
730 static const char romanSymbolsUpper[] = "IIIVIXXXLXCCCDCMMMM";-
731 QByteArray romanSymbols;-
732 if (!upper
!upperDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
)
4
733 romanSymbols = QByteArray::fromRawData(romanSymbolsLower, sizeof(romanSymbolsLower));
executed 4 times by 1 test: romanSymbols = QByteArray::fromRawData(romanSymbolsLower, sizeof(romanSymbolsLower));
Executed by:
  • tst_qquickstyledtext
4
734 else-
735 romanSymbols = QByteArray::fromRawData(romanSymbolsUpper, sizeof(romanSymbolsUpper));
executed 4 times by 1 test: romanSymbols = QByteArray::fromRawData(romanSymbolsUpper, sizeof(romanSymbolsUpper));
Executed by:
  • tst_qquickstyledtext
4
736-
737 int c[] = { 1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000 };-
738 int n = value;-
739 for (int i = 12; i >= 0
i >= 0Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
; n %= c[i], i--) {
8-104
740 int q = n / c[i];-
741 if (q > 0
q > 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
8-96
742 int startDigit = i + (i + 3) / 4;-
743 int numDigits;-
744 if (i % 4
i % 4Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickstyledtext
) {
0-8
745 if ((
(i - 2) % 4Description
TRUEnever evaluated
FALSEnever evaluated
i - 2) % 4
(i - 2) % 4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
746 numDigits = 2;
never executed: numDigits = 2;
0
747 else-
748 numDigits = 1;
never executed: numDigits = 1;
0
749 }-
750 else-
751 numDigits = q;
executed 8 times by 1 test: numDigits = q;
Executed by:
  • tst_qquickstyledtext
8
752 romanNumeral.append(romanSymbols.mid(startDigit, numDigits));-
753 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
8
754 }
executed 104 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
104
755 result = QString::fromLatin1(romanNumeral);-
756 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickstyledtext
8
757 return
executed 8 times by 1 test: return result;
Executed by:
  • tst_qquickstyledtext
result;
executed 8 times by 1 test: return result;
Executed by:
  • tst_qquickstyledtext
8
758}-
759-
760-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0