OpenCoverage

qquicktextnodeengine.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktextnodeengine.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qquicktextnodeengine_p.h"-
41-
42#include <QtCore/qpoint.h>-
43#include <QtGui/qabstracttextdocumentlayout.h>-
44#include <QtGui/qrawfont.h>-
45#include <QtGui/qtextdocument.h>-
46#include <QtGui/qtextlayout.h>-
47#include <QtGui/qtextobject.h>-
48#include <QtGui/qtexttable.h>-
49#include <QtGui/qtextlist.h>-
50-
51#include <private/qquicktext_p.h>-
52#include <private/qquicktextdocument_p.h>-
53#include <private/qtextdocumentlayout_p.h>-
54#include <private/qtextimagehandler_p.h>-
55#include <private/qrawfont_p.h>-
56#include <private/qglyphrun_p.h>-
57-
58QT_BEGIN_NAMESPACE-
59-
60QQuickTextNodeEngine::BinaryTreeNodeKey::BinaryTreeNodeKey(BinaryTreeNode *node)-
61 : fontEngine(QRawFontPrivate::get(node->glyphRun.rawFont())->fontEngine)-
62 , clipNode(node->clipNode)-
63 , color(node->color.rgba())-
64 , selectionState(node->selectionState)-
65{-
66}
executed 500019 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
500019
67-
68QQuickTextNodeEngine::BinaryTreeNode::BinaryTreeNode(const QGlyphRun &g,-
69 SelectionState selState,-
70 const QRectF &brect,-
71 const Decorations &decs,-
72 const QColor &c,-
73 const QColor &bc,-
74 const QPointF &pos, qreal a)-
75 : glyphRun(g)-
76 , boundingRect(brect)-
77 , selectionState(selState)-
78 , clipNode(nullptr)-
79 , decorations(decs)-
80 , color(c)-
81 , backgroundColor(bc)-
82 , position(pos)-
83 , ascent(a)-
84 , leftChildIndex(-1)-
85 , rightChildIndex(-1)-
86{-
87 QGlyphRunPrivate *d = QGlyphRunPrivate::get(g);-
88 ranges.append(qMakePair(d->textRangeStart, d->textRangeEnd));-
89}
executed 250924 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250924
90-
91-
92void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState,-
93 Decorations decorations, const QColor &textColor,-
94 const QColor &backgroundColor, const QPointF &position)-
95{-
96 QRectF searchRect = glyphRun.boundingRect();-
97 searchRect.translate(position);-
98-
99 if (qFuzzyIsNull(searchRect.width()) || qFuzzyIsNull(searchRect.height()))
qFuzzyIsNull(s...hRect.width())Description
TRUEnever evaluated
FALSEevaluated 250924 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
qFuzzyIsNull(s...Rect.height())Description
TRUEnever evaluated
FALSEevaluated 250924 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250924
100 return;
never executed: return;
0
101-
102 decorations |= (glyphRun.underline() ? Decoration::Underline : Decoration::NoDecoration);
glyphRun.underline()Description
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 250908 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
16-250908
103 decorations |= (glyphRun.overline() ? Decoration::Overline : Decoration::NoDecoration);
glyphRun.overline()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 250912 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250912
104 decorations |= (glyphRun.strikeOut() ? Decoration::StrikeOut : Decoration::NoDecoration);
glyphRun.strikeOut()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 250912 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250912
105 decorations |= (backgroundColor.isValid() ? Decoration::Background : Decoration::NoDecoration);
backgroundColor.isValid()Description
TRUEnever evaluated
FALSEevaluated 250924 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250924
106-
107 qreal ascent = glyphRun.rawFont().ascent();-
108 insert(binaryTree, BinaryTreeNode(glyphRun,-
109 selectionState,-
110 searchRect,-
111 decorations,-
112 textColor,-
113 backgroundColor,-
114 position,-
115 ascent));-
116}
executed 250924 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250924
117-
118void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const BinaryTreeNode &binaryTreeNode)-
119{-
120 int newIndex = binaryTree->size();-
121 binaryTree->append(binaryTreeNode);-
122 if (newIndex == 0)
newIndex == 0Description
TRUEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 306 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
306-250622
123 return;
executed 250622 times by 24 tests: return;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622
124-
125 int searchIndex = 0;-
126 forever {-
127 BinaryTreeNode *node = binaryTree->data() + searchIndex;-
128 if (binaryTreeNode.boundingRect.left() < node->boundingRect.left()) {
binaryTreeNode...ingRect.left()Description
TRUEnever evaluated
FALSEevaluated 600 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
0-600
129 if (node->leftChildIndex < 0) {
node->leftChildIndex < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
130 node->leftChildIndex = newIndex;-
131 break;
never executed: break;
0
132 } else {-
133 searchIndex = node->leftChildIndex;-
134 }
never executed: end of block
0
135 } else {-
136 if (node->rightChildIndex < 0) {
node->rightChildIndex < 0Description
TRUEevaluated 306 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 294 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
294-306
137 node->rightChildIndex = newIndex;-
138 break;
executed 306 times by 4 tests: break;
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
306
139 } else {-
140 searchIndex = node->rightChildIndex;-
141 }
executed 294 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
294
142 }-
143 }-
144}
executed 306 times by 4 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
306
145-
146void QQuickTextNodeEngine::BinaryTreeNode::inOrder(const QVarLengthArray<BinaryTreeNode, 16> &binaryTree,-
147 QVarLengthArray<int> *sortedIndexes, int currentIndex)-
148{-
149 Q_ASSERT(currentIndex < binaryTree.size());-
150-
151 const BinaryTreeNode *node = binaryTree.data() + currentIndex;-
152 if (node->leftChildIndex >= 0)
node->leftChildIndex >= 0Description
TRUEnever evaluated
FALSEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250928
153 inOrder(binaryTree, sortedIndexes, node->leftChildIndex);
never executed: inOrder(binaryTree, sortedIndexes, node->leftChildIndex);
0
154-
155 sortedIndexes->append(currentIndex);-
156-
157 if (node->rightChildIndex >= 0)
node->rightChildIndex >= 0Description
TRUEevaluated 306 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
306-250622
158 inOrder(binaryTree, sortedIndexes, node->rightChildIndex);
executed 306 times by 4 tests: inOrder(binaryTree, sortedIndexes, node->rightChildIndex);
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
306
159}
executed 250928 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250928
160-
161-
162int QQuickTextNodeEngine::addText(const QTextBlock &block,-
163 const QTextCharFormat &charFormat,-
164 const QColor &textColor,-
165 const QVarLengthArray<QTextLayout::FormatRange> &colorChanges,-
166 int textPos, int fragmentEnd,-
167 int selectionStart, int selectionEnd)-
168{-
169 if (charFormat.foreground().style() != Qt::NoBrush)
charFormat.for...!= Qt::NoBrushDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextedit
FALSEevaluated 566 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
4-566
170 setTextColor(charFormat.foreground().color());
executed 4 times by 2 tests: setTextColor(charFormat.foreground().color());
Executed by:
  • tst_examples
  • tst_qquicktextedit
4
171 else-
172 setTextColor(textColor);
executed 566 times by 5 tests: setTextColor(textColor);
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
566
173-
174 while (textPos < fragmentEnd) {
textPos < fragmentEndDescription
TRUEevaluated 674 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 570 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
570-674
175 int blockRelativePosition = textPos - block.position();-
176 QTextLine line = block.layout()->lineForTextPosition(blockRelativePosition);-
177 if (!currentLine().isValid()
!currentLine().isValid()Description
TRUEevaluated 508 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 166 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
166-508
178 || line.lineNumber() != currentLine().lineNumber()) {
line.lineNumbe...).lineNumber()Description
TRUEevaluated 104 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 62 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
62-104
179 setCurrentLine(line);-
180 }
executed 612 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
612
181-
182 Q_ASSERT(line.textLength() > 0);-
183 int lineEnd = line.textStart() + block.position() + line.textLength();-
184-
185 int len = qMin(lineEnd - textPos, fragmentEnd - textPos);-
186 Q_ASSERT(len > 0);-
187-
188 int currentStepEnd = textPos + len;-
189-
190 addGlyphsForRanges(colorChanges,-
191 textPos - block.position(),-
192 currentStepEnd - block.position(),-
193 selectionStart - block.position(),-
194 selectionEnd - block.position());-
195-
196 textPos = currentStepEnd;-
197 }
executed 674 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
674
198 return textPos;
executed 570 times by 5 tests: return textPos;
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
570
199}-
200-
201void QQuickTextNodeEngine::addTextDecorations(const QVarLengthArray<TextDecoration> &textDecorations,-
202 qreal offset, qreal thickness)-
203{-
204 for (int i=0; i<textDecorations.size(); ++i) {
i<textDecorations.size()Description
TRUEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
40
205 TextDecoration textDecoration = textDecorations.at(i);-
206-
207 {-
208 QRectF &rect = textDecoration.rect;-
209 rect.setY(qRound(rect.y()-
210 + m_currentLine.ascent()-
211 + (m_currentLine.leadingIncluded() ? m_currentLine.leading() : qreal(0.0f))-
212 + offset));-
213 rect.setHeight(thickness);-
214 }-
215-
216 m_lines.append(textDecoration);-
217 }
executed 40 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
40
218}
executed 40 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
40
219-
220void QQuickTextNodeEngine::processCurrentLine()-
221{-
222 // No glyphs, do nothing-
223 if (m_currentLineTree.isEmpty())
m_currentLineTree.isEmpty()Description
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34-250622
224 return;
executed 34 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquicktext
34
225-
226 // 1. Go through current line and get correct decoration position for each node based on-
227 // neighbouring decorations. Add decoration to global list-
228 // 2. Create clip nodes for all selected text. Try to merge as many as possible within-
229 // the line.-
230 // 3. Add QRects to a list of selection rects.-
231 // 4. Add all nodes to a global processed list-
232 QVarLengthArray<int> sortedIndexes; // Indexes in tree sorted by x position-
233 BinaryTreeNode::inOrder(m_currentLineTree, &sortedIndexes);-
234-
235 Q_ASSERT(sortedIndexes.size() == m_currentLineTree.size());-
236-
237 SelectionState currentSelectionState = Unselected;-
238 QRectF currentRect;-
239-
240 Decorations currentDecorations = Decoration::NoDecoration;-
241 qreal underlineOffset = 0.0;-
242 qreal underlineThickness = 0.0;-
243-
244 qreal overlineOffset = 0.0;-
245 qreal overlineThickness = 0.0;-
246-
247 qreal strikeOutOffset = 0.0;-
248 qreal strikeOutThickness = 0.0;-
249-
250 QRectF decorationRect = currentRect;-
251-
252 QColor lastColor;-
253 QColor lastBackgroundColor;-
254-
255 QVarLengthArray<TextDecoration> pendingUnderlines;-
256 QVarLengthArray<TextDecoration> pendingOverlines;-
257 QVarLengthArray<TextDecoration> pendingStrikeOuts;-
258 if (!sortedIndexes.isEmpty()) {
!sortedIndexes.isEmpty()Description
TRUEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEnever evaluated
0-250622
259 QQuickDefaultClipNode *currentClipNode = m_hasSelection ? new QQuickDefaultClipNode(QRectF()) : nullptr;
m_hasSelectionDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250564 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
58-250564
260 bool currentClipNodeUsed = false;-
261 for (int i=0; i<=sortedIndexes.size(); ++i) {
i<=sortedIndexes.size()Description
TRUEevaluated 501550 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622-501550
262 BinaryTreeNode *node = nullptr;-
263 if (i < sortedIndexes.size()) {
i < sortedIndexes.size()Description
TRUEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622-250928
264 int sortedIndex = sortedIndexes.at(i);-
265 Q_ASSERT(sortedIndex < m_currentLineTree.size());-
266-
267 node = m_currentLineTree.data() + sortedIndex;-
268 }
executed 250928 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250928
269-
270 if (i == 0)
i == 0Description
TRUEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622-250928
271 currentSelectionState = node->selectionState;
executed 250622 times by 24 tests: currentSelectionState = node->selectionState;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622
272-
273 // Update decorations-
274 if (currentDecorations != Decoration::NoDecoration) {
currentDecorat...::NoDecorationDescription
TRUEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 501510 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
40-501510
275 decorationRect.setY(m_position.y() + m_currentLine.y());-
276 decorationRect.setHeight(m_currentLine.height());-
277-
278 if (node != nullptr)
node != nullptrDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qquicktext
  • tst_qquicktextedit
2-38
279 decorationRect.setRight(node->boundingRect.left());
executed 2 times by 1 test: decorationRect.setRight(node->boundingRect.left());
Executed by:
  • tst_examples
2
280-
281 TextDecoration textDecoration(currentSelectionState, decorationRect, lastColor);-
282 if (currentDecorations & Decoration::Underline)
currentDecorat...ion::UnderlineDescription
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquicktext
16-24
283 pendingUnderlines.append(textDecoration);
executed 16 times by 3 tests: pendingUnderlines.append(textDecoration);
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
16
284-
285 if (currentDecorations & Decoration::Overline)
currentDecorat...tion::OverlineDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 28 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
12-28
286 pendingOverlines.append(textDecoration);
executed 12 times by 1 test: pendingOverlines.append(textDecoration);
Executed by:
  • tst_qquicktext
12
287-
288 if (currentDecorations & Decoration::StrikeOut)
currentDecorat...ion::StrikeOutDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 28 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
12-28
289 pendingStrikeOuts.append(textDecoration);
executed 12 times by 1 test: pendingStrikeOuts.append(textDecoration);
Executed by:
  • tst_qquicktext
12
290-
291 if (currentDecorations & Decoration::Background)
currentDecorat...on::BackgroundDescription
TRUEnever evaluated
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
0-40
292 m_backgrounds.append(qMakePair(decorationRect, lastBackgroundColor));
never executed: m_backgrounds.append(qMakePair(decorationRect, lastBackgroundColor));
0
293 }
executed 40 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
40
294-
295 // If we've reached an unselected node from a selected node, we add the-
296 // selection rect to the graph, and we add decoration every time the-
297 // selection state changes, because that means the text color changes-
298 if (node == nullptr || node->selectionState != currentSelectionState) {
node == nullptrDescription
TRUEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
node->selectio...SelectionStateDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250862 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
66-250928
299 currentRect.setY(m_position.y() + m_currentLine.y());-
300 currentRect.setHeight(m_currentLine.height());-
301-
302 if (currentSelectionState == Selected)
currentSelecti...te == SelectedDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250630 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
58-250630
303 m_selectionRects.append(currentRect);
executed 58 times by 2 tests: m_selectionRects.append(currentRect);
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
304-
305 if (currentClipNode != nullptr) {
currentClipNode != nullptrDescription
TRUEevaluated 124 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250564 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
124-250564
306 if (!currentClipNodeUsed) {
!currentClipNodeUsedDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58-66
307 delete currentClipNode;-
308 } else {
executed 66 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
66
309 currentClipNode->setIsRectangular(true);-
310 currentClipNode->setRect(currentRect);-
311 currentClipNode->update();-
312 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
313 }-
314-
315 if (node != nullptr && m_hasSelection)
node != nullptrDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
m_hasSelectionDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-250622
316 currentClipNode = new QQuickDefaultClipNode(QRectF());
executed 66 times by 2 tests: currentClipNode = new QQuickDefaultClipNode(QRectF());
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
66
317 else-
318 currentClipNode = nullptr;
executed 250622 times by 24 tests: currentClipNode = nullptr;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622
319 currentClipNodeUsed = false;-
320-
321 if (node != nullptr) {
node != nullptrDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
66-250622
322 currentSelectionState = node->selectionState;-
323 currentRect = node->boundingRect;-
324-
325 // Make sure currentRect is valid, otherwise the unite won't work-
326 if (currentRect.isNull())
currentRect.isNull()Description
TRUEnever evaluated
FALSEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
0-66
327 currentRect.setSize(QSizeF(1, 1));
never executed: currentRect.setSize(QSizeF(1, 1));
0
328 }
executed 66 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
66
329 } else {
executed 250688 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250688
330 if (currentRect.isNull())
currentRect.isNull()Description
TRUEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 240 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
240-250622
331 currentRect = node->boundingRect;
executed 250622 times by 24 tests: currentRect = node->boundingRect;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622
332 else-
333 currentRect = currentRect.united(node->boundingRect);
executed 240 times by 3 tests: currentRect = currentRect.united(node->boundingRect);
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
240
334 }-
335-
336 if (node != nullptr) {
node != nullptrDescription
TRUEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 250622 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622-250928
337 if (node->selectionState == Selected) {
node->selectio...te == SelectedDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250870 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
58-250870
338 node->clipNode = currentClipNode;-
339 currentClipNodeUsed = true;-
340 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
341-
342 decorationRect = node->boundingRect;-
343-
344 // If previous item(s) had underline and current does not, then we add the-
345 // pending lines to the lists and likewise for overlines and strikeouts-
346 if (!pendingUnderlines.isEmpty()
!pendingUnderlines.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 250926 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
2-250926
347 && !(node->decorations & Decoration::Underline)) {
!(node->decora...on::Underline)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-2
348 addTextDecorations(pendingUnderlines, underlineOffset, underlineThickness);-
349-
350 pendingUnderlines.clear();-
351-
352 underlineOffset = 0.0;-
353 underlineThickness = 0.0;-
354 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
355-
356 // ### Add pending when overlineOffset/thickness changes to minimize number of-
357 // nodes-
358 if (!pendingOverlines.isEmpty()) {
!pendingOverlines.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250928
359 addTextDecorations(pendingOverlines, overlineOffset, overlineThickness);-
360-
361 pendingOverlines.clear();-
362-
363 overlineOffset = 0.0;-
364 overlineThickness = 0.0;-
365 }
never executed: end of block
0
366-
367 // ### Add pending when overlineOffset/thickness changes to minimize number of-
368 // nodes-
369 if (!pendingStrikeOuts.isEmpty()) {
!pendingStrikeOuts.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250928
370 addTextDecorations(pendingStrikeOuts, strikeOutOffset, strikeOutThickness);-
371-
372 pendingStrikeOuts.clear();-
373-
374 strikeOutOffset = 0.0;-
375 strikeOutThickness = 0.0;-
376 }
never executed: end of block
0
377-
378 // Merge current values with previous. Prefer greatest thickness-
379 QRawFont rawFont = node->glyphRun.rawFont();-
380 if (node->decorations & Decoration::Underline) {
node->decorati...ion::UnderlineDescription
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 250912 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
16-250912
381 if (rawFont.lineThickness() > underlineThickness) {
rawFont.lineTh...rlineThicknessDescription
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
0-16
382 underlineThickness = rawFont.lineThickness();-
383 underlineOffset = rawFont.underlinePosition();-
384 }
executed 16 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
16
385 }
executed 16 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
16
386-
387 if (node->decorations & Decoration::Overline) {
node->decorati...tion::OverlineDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 250916 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250916
388 overlineOffset = -rawFont.ascent();-
389 overlineThickness = rawFont.lineThickness();-
390 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktext
12
391-
392 if (node->decorations & Decoration::StrikeOut) {
node->decorati...ion::StrikeOutDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 250916 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250916
393 strikeOutThickness = rawFont.lineThickness();-
394 strikeOutOffset = rawFont.ascent() / -3.0;-
395 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquicktext
12
396-
397 currentDecorations = node->decorations;-
398 lastColor = node->color;-
399 lastBackgroundColor = node->backgroundColor;-
400 m_processedNodes.append(*node);-
401 }
executed 250928 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250928
402 }
executed 501550 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
501550
403-
404 if (!pendingUnderlines.isEmpty())
!pendingUnderlines.isEmpty()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 250608 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
14-250608
405 addTextDecorations(pendingUnderlines, underlineOffset, underlineThickness);
executed 14 times by 2 tests: addTextDecorations(pendingUnderlines, underlineOffset, underlineThickness);
Executed by:
  • tst_qquicktext
  • tst_qquicktextedit
14
406-
407 if (!pendingOverlines.isEmpty())
!pendingOverlines.isEmpty()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 250610 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250610
408 addTextDecorations(pendingOverlines, overlineOffset, overlineThickness);
executed 12 times by 1 test: addTextDecorations(pendingOverlines, overlineOffset, overlineThickness);
Executed by:
  • tst_qquicktext
12
409-
410 if (!pendingStrikeOuts.isEmpty())
!pendingStrikeOuts.isEmpty()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 250610 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250610
411 addTextDecorations(pendingStrikeOuts, strikeOutOffset, strikeOutThickness);
executed 12 times by 1 test: addTextDecorations(pendingStrikeOuts, strikeOutOffset, strikeOutThickness);
Executed by:
  • tst_qquicktext
12
412 }
executed 250622 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622
413-
414 m_currentLineTree.clear();-
415 m_currentLine = QTextLine();-
416 m_hasSelection = false;-
417}
executed 250622 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250622
418-
419void QQuickTextNodeEngine::addImage(const QRectF &rect, const QImage &image, qreal ascent,-
420 SelectionState selectionState,-
421 QTextFrameFormat::Position layoutPosition)-
422{-
423 QRectF searchRect = rect;-
424 if (layoutPosition == QTextFrameFormat::InFlow) {
layoutPosition...Format::InFlowDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-4
425 if (m_currentLineTree.isEmpty()) {
m_currentLineTree.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-4
426 if (m_currentTextDirection == Qt::RightToLeft)
m_currentTextD...t::RightToLeftDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
0-4
427 searchRect.moveTopRight(m_position + m_currentLine.rect().topRight() + QPointF(0, 1));
never executed: searchRect.moveTopRight(m_position + m_currentLine.rect().topRight() + QPointF(0, 1));
0
428 else-
429 searchRect.moveTopLeft(m_position + m_currentLine.position() + QPointF(0,1));
executed 4 times by 1 test: searchRect.moveTopLeft(m_position + m_currentLine.position() + QPointF(0,1));
Executed by:
  • tst_qquicktext
4
430 } else {-
431 const BinaryTreeNode *lastNode = m_currentLineTree.data() + m_currentLineTree.size() - 1;-
432 if (lastNode->glyphRun.isRightToLeft()) {
lastNode->glyp...sRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
0
433 QPointF lastPos = lastNode->boundingRect.topLeft();-
434 searchRect.moveTopRight(lastPos - QPointF(0, ascent - lastNode->ascent));-
435 } else {
never executed: end of block
0
436 QPointF lastPos = lastNode->boundingRect.topRight();-
437 searchRect.moveTopLeft(lastPos - QPointF(0, ascent - lastNode->ascent));-
438 }
never executed: end of block
0
439 }-
440 }-
441-
442 BinaryTreeNode::insert(&m_currentLineTree, searchRect, image, ascent, selectionState);-
443 m_hasContents = true;-
444}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
445-
446void QQuickTextNodeEngine::addTextObject(const QPointF &position, const QTextCharFormat &format,-
447 SelectionState selectionState,-
448 QTextDocument *textDocument, int pos,-
449 QTextFrameFormat::Position layoutPosition)-
450{-
451 QTextObjectInterface *handler = textDocument->documentLayout()->handlerForObject(format.objectType());-
452 if (handler != nullptr) {
handler != nullptrDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-6
453 QImage image;-
454 QSizeF size = handler->intrinsicSize(textDocument, pos, format);-
455-
456 if (format.objectType() == QTextFormat::ImageObject) {
format.objectT...t::ImageObjectDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-6
457 QTextImageFormat imageFormat = format.toImageFormat();-
458 if (QQuickTextDocumentWithImageResources *imageDoc = qobject_cast<QQuickTextDocumentWithImageResources *>(textDocument)) {
QQuickTextDocu...(textDocument)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-6
459 image = imageDoc->image(imageFormat);-
460-
461 if (image.isNull())
image.isNull()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
2-4
462 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicktext
2
463 } else {
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
464 QTextImageHandler *imageHandler = static_cast<QTextImageHandler *>(handler);-
465 image = imageHandler->image(textDocument, imageFormat);-
466 }
never executed: end of block
0
467 }-
468-
469 if (image.isNull()) {
image.isNull()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
0-4
470 image = QImage(size.toSize(), QImage::Format_ARGB32_Premultiplied);-
471 image.fill(Qt::transparent);-
472 {-
473 QPainter painter(&image);-
474 handler->drawObject(&painter, image.rect(), textDocument, pos, format);-
475 }-
476 }
never executed: end of block
0
477-
478 qreal ascent;-
479 QFontMetrics m(format.font());-
480 switch (format.verticalAlignment())-
481 {-
482 case QTextCharFormat::AlignMiddle:
never executed: case QTextCharFormat::AlignMiddle:
0
483 ascent = size.height() / 2 - 1;-
484 break;
never executed: break;
0
485 case QTextCharFormat::AlignBaseline:
never executed: case QTextCharFormat::AlignBaseline:
0
486 ascent = size.height() - m.descent() - 1;-
487 break;
never executed: break;
0
488 default:
executed 4 times by 1 test: default:
Executed by:
  • tst_qquicktext
4
489 ascent = size.height() - 1;-
490 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
491-
492 addImage(QRectF(position, size), image, ascent, selectionState, layoutPosition);-
493 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
494}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
495-
496void QQuickTextNodeEngine::addUnselectedGlyphs(const QGlyphRun &glyphRun)-
497{-
498 BinaryTreeNode::insert(&m_currentLineTree,-
499 glyphRun,-
500 Unselected,-
501 Decoration::NoDecoration,-
502 m_textColor,-
503 m_backgroundColor,-
504 m_position);-
505}
executed 250866 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250866
506-
507void QQuickTextNodeEngine::addSelectedGlyphs(const QGlyphRun &glyphRun)-
508{-
509 int currentSize = m_currentLineTree.size();-
510 BinaryTreeNode::insert(&m_currentLineTree,-
511 glyphRun,-
512 Selected,-
513 Decoration::NoDecoration,-
514 m_textColor,-
515 m_backgroundColor,-
516 m_position);-
517 m_hasSelection = m_hasSelection || m_currentLineTree.size() > currentSize;
m_hasSelectionDescription
TRUEnever evaluated
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
m_currentLineT... > currentSizeDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-58
518}
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
519-
520void QQuickTextNodeEngine::addGlyphsForRanges(const QVarLengthArray<QTextLayout::FormatRange> &ranges,-
521 int start, int end,-
522 int selectionStart, int selectionEnd)-
523{-
524 int currentPosition = start;-
525 int remainingLength = end - start;-
526 for (int j=0; j<ranges.size(); ++j) {
j<ranges.size()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 250664 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250664
527 const QTextLayout::FormatRange &range = ranges.at(j);-
528 if (range.start + range.length >= currentPosition
range.start + ...urrentPositionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-12
529 && range.start < currentPosition + remainingLength) {
range.start < ...emainingLengthDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-12
530-
531 if (range.start > currentPosition) {
range.start > currentPositionDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
0-12
532 addGlyphsInRange(currentPosition, range.start - currentPosition,-
533 QColor(), QColor(), selectionStart, selectionEnd);-
534 }
never executed: end of block
0
535 int rangeEnd = qMin(range.start + range.length, currentPosition + remainingLength);-
536 QColor rangeColor;-
537 if (range.format.hasProperty(QTextFormat::ForegroundBrush))
range.format.h...regroundBrush)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-12
538 rangeColor = range.format.foreground().color();
executed 12 times by 1 test: rangeColor = range.format.foreground().color();
Executed by:
  • tst_examples
12
539 else if (range.format.isAnchor())
range.format.isAnchor()Description
TRUEnever evaluated
FALSEnever evaluated
0
540 rangeColor = m_anchorColor;
never executed: rangeColor = m_anchorColor;
0
541 QColor rangeBackgroundColor = range.format.hasProperty(QTextFormat::BackgroundBrush)
range.format.h...ckgroundBrush)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
0-12
542 ? range.format.background().color()-
543 : QColor();-
544-
545 addGlyphsInRange(range.start, rangeEnd - range.start,-
546 rangeColor, rangeBackgroundColor,-
547 selectionStart, selectionEnd);-
548-
549 currentPosition = range.start + range.length;-
550 remainingLength = end - currentPosition;-
551-
552 } else if (range.start > currentPosition + remainingLength || remainingLength <= 0) {
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
range.start > ...emainingLengthDescription
TRUEnever evaluated
FALSEnever evaluated
remainingLength <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0-12
553 break;
never executed: break;
0
554 }-
555 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
556-
557 if (remainingLength > 0) {
remainingLength > 0Description
TRUEevaluated 250648 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
16-250648
558 addGlyphsInRange(currentPosition, remainingLength, QColor(), QColor(),-
559 selectionStart, selectionEnd);-
560 }
executed 250648 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250648
561-
562}
executed 250664 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250664
563-
564void QQuickTextNodeEngine::addGlyphsInRange(int rangeStart, int rangeLength,-
565 const QColor &color, const QColor &backgroundColor,-
566 int selectionStart, int selectionEnd)-
567{-
568 QColor oldColor;-
569 if (color.isValid()) {
color.isValid()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 250648 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250648
570 oldColor = m_textColor;-
571 m_textColor = color;-
572 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
573-
574 QColor oldBackgroundColor = m_backgroundColor;-
575 if (backgroundColor.isValid()) {
backgroundColor.isValid()Description
TRUEnever evaluated
FALSEevaluated 250660 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250660
576 oldBackgroundColor = m_backgroundColor;-
577 m_backgroundColor = backgroundColor;-
578 }
never executed: end of block
0
579-
580 bool hasSelection = selectionEnd >= 0
selectionEnd >= 0Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 250588 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
72-250588
581 && selectionStart <= selectionEnd;
selectionStart <= selectionEndDescription
TRUEevaluated 62 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquicktextedit
10-62
582-
583 QTextLine &line = m_currentLine;-
584 int rangeEnd = rangeStart + rangeLength;-
585 if (!hasSelection || (selectionStart > rangeEnd || selectionEnd < rangeStart)) {
!hasSelectionDescription
TRUEevaluated 250598 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
selectionStart > rangeEndDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktextedit
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
selectionEnd < rangeStartDescription
TRUEnever evaluated
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
0-250598
586 QList<QGlyphRun> glyphRuns = line.glyphRuns(rangeStart, rangeLength);-
587 for (int j=0; j<glyphRuns.size(); ++j) {
j<glyphRuns.size()Description
TRUEevaluated 250752 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 250602 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250602-250752
588 const QGlyphRun &glyphRun = glyphRuns.at(j);-
589 addUnselectedGlyphs(glyphRun);-
590 }
executed 250752 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250752
591 } else {
executed 250602 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250602
592 if (rangeStart < selectionStart) {
rangeStart < selectionStartDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28-30
593 int length = qMin(selectionStart - rangeStart, rangeLength);-
594 QList<QGlyphRun> glyphRuns = line.glyphRuns(rangeStart, length);-
595 for (int j=0; j<glyphRuns.size(); ++j) {
j<glyphRuns.size()Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28
596 const QGlyphRun &glyphRun = glyphRuns.at(j);-
597 addUnselectedGlyphs(glyphRun);-
598 }
executed 28 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28
599 }
executed 28 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28
600-
601 if (rangeEnd > selectionStart) {
rangeEnd > selectionStartDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-58
602 int start = qMax(selectionStart, rangeStart);-
603 int length = qMin(selectionEnd - start + 1, rangeEnd - start);-
604 QList<QGlyphRun> glyphRuns = line.glyphRuns(start, length);-
605-
606 for (int j=0; j<glyphRuns.size(); ++j) {
j<glyphRuns.size()Description
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
607 const QGlyphRun &glyphRun = glyphRuns.at(j);-
608 addSelectedGlyphs(glyphRun);-
609 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
610 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
611-
612 if (selectionEnd >= rangeStart && selectionEnd < rangeEnd) {
selectionEnd >= rangeStartDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
selectionEnd < rangeEndDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-58
613 int start = selectionEnd + 1;-
614 int length = rangeEnd - selectionEnd - 1;-
615 QList<QGlyphRun> glyphRuns = line.glyphRuns(start, length);-
616 for (int j=0; j<glyphRuns.size(); ++j) {
j<glyphRuns.size()Description
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
38-58
617 const QGlyphRun &glyphRun = glyphRuns.at(j);-
618 addUnselectedGlyphs(glyphRun);-
619 }
executed 38 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
38
620 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
621 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
622-
623 if (backgroundColor.isValid())
backgroundColor.isValid()Description
TRUEnever evaluated
FALSEevaluated 250660 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-250660
624 m_backgroundColor = oldBackgroundColor;
never executed: m_backgroundColor = oldBackgroundColor;
0
625-
626 if (oldColor.isValid())
oldColor.isValid()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 250648 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
12-250648
627 m_textColor = oldColor;
executed 12 times by 1 test: m_textColor = oldColor;
Executed by:
  • tst_examples
12
628}
executed 250660 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250660
629-
630void QQuickTextNodeEngine::addBorder(const QRectF &rect, qreal border,-
631 QTextFrameFormat::BorderStyle borderStyle,-
632 const QBrush &borderBrush)-
633{-
634 QColor color = borderBrush.color();-
635-
636 // Currently we don't support other styles than solid-
637 Q_UNUSED(borderStyle);-
638-
639 m_backgrounds.append(qMakePair(QRectF(rect.left(), rect.top(), border, rect.height() + border), color));-
640 m_backgrounds.append(qMakePair(QRectF(rect.left() + border, rect.top(), rect.width(), border), color));-
641 m_backgrounds.append(qMakePair(QRectF(rect.right(), rect.top() + border, border, rect.height() - border), color));-
642 m_backgrounds.append(qMakePair(QRectF(rect.left() + border, rect.bottom(), rect.width(), border), color));-
643}
never executed: end of block
0
644-
645void QQuickTextNodeEngine::addFrameDecorations(QTextDocument *document, QTextFrame *frame)-
646{-
647 QTextDocumentLayout *documentLayout = qobject_cast<QTextDocumentLayout *>(document->documentLayout());-
648 if (Q_UNLIKELY(!documentLayout))
__builtin_expe...ayout), false)Description
TRUEnever evaluated
FALSEevaluated 382 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-382
649 return;
never executed: return;
0
650-
651 QTextFrameFormat frameFormat = frame->format().toFrameFormat();-
652 QTextTable *table = qobject_cast<QTextTable *>(frame);-
653-
654 QRectF boundingRect = table == nullptr
table == nullptrDescription
TRUEevaluated 382 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
0-382
655 ? documentLayout->frameBoundingRect(frame)-
656 : documentLayout->tableBoundingRect(table);-
657-
658 QBrush bg = frame->frameFormat().background();-
659 if (bg.style() != Qt::NoBrush)
bg.style() != Qt::NoBrushDescription
TRUEnever evaluated
FALSEevaluated 382 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-382
660 m_backgrounds.append(qMakePair(boundingRect, bg.color()));
never executed: m_backgrounds.append(qMakePair(boundingRect, bg.color()));
0
661-
662 if (!frameFormat.hasProperty(QTextFormat::FrameBorder))
!frameFormat.h...::FrameBorder)Description
TRUEevaluated 382 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
0-382
663 return;
executed 382 times by 5 tests: return;
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
382
664-
665 qreal borderWidth = frameFormat.border();-
666 if (qFuzzyIsNull(borderWidth))
qFuzzyIsNull(borderWidth)Description
TRUEnever evaluated
FALSEnever evaluated
0
667 return;
never executed: return;
0
668-
669 QBrush borderBrush = frameFormat.borderBrush();-
670 QTextFrameFormat::BorderStyle borderStyle = frameFormat.borderStyle();-
671 if (borderStyle == QTextFrameFormat::BorderStyle_None)
borderStyle ==...rderStyle_NoneDescription
TRUEnever evaluated
FALSEnever evaluated
0
672 return;
never executed: return;
0
673-
674 addBorder(boundingRect.adjusted(frameFormat.leftMargin(), frameFormat.topMargin(),-
675 -frameFormat.rightMargin(), -frameFormat.bottomMargin()),-
676 borderWidth, borderStyle, borderBrush);-
677 if (table != nullptr) {
table != nullptrDescription
TRUEnever evaluated
FALSEnever evaluated
0
678 int rows = table->rows();-
679 int columns = table->columns();-
680-
681 for (int row=0; row<rows; ++row) {
row<rowsDescription
TRUEnever evaluated
FALSEnever evaluated
0
682 for (int column=0; column<columns; ++column) {
column<columnsDescription
TRUEnever evaluated
FALSEnever evaluated
0
683 QTextTableCell cell = table->cellAt(row, column);-
684-
685 QRectF cellRect = documentLayout->tableCellBoundingRect(table, cell);-
686 addBorder(cellRect.adjusted(-borderWidth, -borderWidth, 0, 0), borderWidth,-
687 borderStyle, borderBrush);-
688 }
never executed: end of block
0
689 }
never executed: end of block
0
690 }
never executed: end of block
0
691}
never executed: end of block
0
692-
693uint qHash(const QQuickTextNodeEngine::BinaryTreeNodeKey &key)-
694{-
695 // Just use the default hash for pairs-
696 return qHash(qMakePair(key.fontEngine, qMakePair(key.clipNode,
executed 500019 times by 24 tests: return qHash(qMakePair(key.fontEngine, qMakePair(key.clipNode, qMakePair(key.color, key.selectionState))));
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
500019
697 qMakePair(key.color, key.selectionState))));
executed 500019 times by 24 tests: return qHash(qMakePair(key.fontEngine, qMakePair(key.clipNode, qMakePair(key.color, key.selectionState))));
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
500019
698}-
699-
700void QQuickTextNodeEngine::mergeProcessedNodes(QList<BinaryTreeNode *> *regularNodes,-
701 QList<BinaryTreeNode *> *imageNodes)-
702{-
703 QHash<BinaryTreeNodeKey, QList<BinaryTreeNode *> > map;-
704-
705 for (int i = 0; i < m_processedNodes.size(); ++i) {
i < m_processedNodes.size()Description
TRUEevaluated 250928 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249381-250928
706 BinaryTreeNode *node = m_processedNodes.data() + i;-
707-
708 if (node->image.isNull()) {
node->image.isNull()Description
TRUEevaluated 250924 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
4-250924
709 BinaryTreeNodeKey key(node);-
710-
711 QList<BinaryTreeNode *> &nodes = map[key];-
712 if (nodes.isEmpty())
nodes.isEmpty()Description
TRUEevaluated 249095 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 1829 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
1829-249095
713 regularNodes->append(node);
executed 249095 times by 24 tests: regularNodes->append(node);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095
714-
715 nodes.append(node);-
716 } else {
executed 250924 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250924
717 imageNodes->append(node);-
718 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
719 }-
720-
721 for (int i = 0; i < regularNodes->size(); ++i) {
i < regularNodes->size()Description
TRUEevaluated 249095 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095-249381
722 BinaryTreeNode *primaryNode = regularNodes->at(i);-
723 BinaryTreeNodeKey key(primaryNode);-
724-
725 const QList<BinaryTreeNode *> &nodes = map.value(key);-
726 Q_ASSERT(nodes.first() == primaryNode);-
727-
728 int count = 0;-
729 for (int j = 0; j < nodes.size(); ++j)
j < nodes.size()Description
TRUEevaluated 250924 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 249095 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095-250924
730 count += nodes.at(j)->glyphRun.glyphIndexes().size();
executed 250924 times by 24 tests: count += nodes.at(j)->glyphRun.glyphIndexes().size();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
250924
731-
732 if (count != primaryNode->glyphRun.glyphIndexes().size()) {
count != prima...dexes().size()Description
TRUEevaluated 633 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
FALSEevaluated 248462 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
633-248462
733 QGlyphRun &glyphRun = primaryNode->glyphRun;-
734 QVector<quint32> glyphIndexes = glyphRun.glyphIndexes();-
735 glyphIndexes.reserve(count);-
736-
737 QVector<QPointF> glyphPositions = glyphRun.positions();-
738 glyphPositions.reserve(count);-
739-
740 QRectF glyphBoundingRect = glyphRun.boundingRect();-
741-
742 for (int j = 1; j < nodes.size(); ++j) {
j < nodes.size()Description
TRUEevaluated 1829 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
FALSEevaluated 633 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
633-1829
743 BinaryTreeNode *otherNode = nodes.at(j);-
744 glyphIndexes += otherNode->glyphRun.glyphIndexes();-
745 primaryNode->ranges += otherNode->ranges;-
746 glyphBoundingRect = glyphBoundingRect.united(otherNode->boundingRect);-
747-
748 QVector<QPointF> otherPositions = otherNode->glyphRun.positions();-
749 for (int k = 0; k < otherPositions.size(); ++k)
k < otherPositions.size()Description
TRUEevaluated 21352 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
FALSEevaluated 1829 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
1829-21352
750 glyphPositions += otherPositions.at(k) + (otherNode->position - primaryNode->position);
executed 21352 times by 7 tests: glyphPositions += otherPositions.at(k) + (otherNode->position - primaryNode->position);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
21352
751 }
executed 1829 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
1829
752-
753 Q_ASSERT(glyphPositions.size() == count);-
754 Q_ASSERT(glyphIndexes.size() == count);-
755-
756 glyphRun.setGlyphIndexes(glyphIndexes);-
757 glyphRun.setPositions(glyphPositions);-
758 glyphRun.setBoundingRect(glyphBoundingRect);-
759 }
executed 633 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
633
760 }
executed 249095 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095
761}
executed 249381 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249381
762-
763void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode,-
764 QQuickText::TextStyle style,-
765 const QColor &styleColor)-
766{-
767 if (m_currentLine.isValid())
m_currentLine.isValid()Description
TRUEevaluated 248443 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 938 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
938-248443
768 processCurrentLine();
executed 248443 times by 24 tests: processCurrentLine();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
248443
769-
770 QList<BinaryTreeNode *> nodes;-
771 QList<BinaryTreeNode *> imageNodes;-
772 mergeProcessedNodes(&nodes, &imageNodes);-
773-
774 for (int i = 0; i < m_backgrounds.size(); ++i) {
i < m_backgrounds.size()Description
TRUEnever evaluated
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-249381
775 const QRectF &rect = m_backgrounds.at(i).first;-
776 const QColor &color = m_backgrounds.at(i).second;-
777-
778 parentNode->addRectangleNode(rect, color);-
779 }
never executed: end of block
0
780-
781 // Add all text with unselected color first-
782 for (int i = 0; i < nodes.size(); ++i) {
i < nodes.size()Description
TRUEevaluated 249095 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095-249381
783 const BinaryTreeNode *node = nodes.at(i);-
784 parentNode->addGlyphs(node->position, node->glyphRun, node->color, style, styleColor, nullptr);-
785 }
executed 249095 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095
786-
787 for (int i = 0; i < imageNodes.size(); ++i) {
i < imageNodes.size()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
4-249381
788 const BinaryTreeNode *node = imageNodes.at(i);-
789 if (node->selectionState == Unselected)
node->selectio... == UnselectedDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-4
790 parentNode->addImage(node->boundingRect, node->image);
executed 4 times by 1 test: parentNode->addImage(node->boundingRect, node->image);
Executed by:
  • tst_qquicktext
4
791 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
792-
793 // Then, prepend all selection rectangles to the tree-
794 for (int i = 0; i < m_selectionRects.size(); ++i) {
i < m_selectionRects.size()Description
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
58-249381
795 const QRectF &rect = m_selectionRects.at(i);-
796-
797 parentNode->addRectangleNode(rect, m_selectionColor);-
798 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
799-
800 // Add decorations for each node to the tree.-
801 for (int i = 0; i < m_lines.size(); ++i) {
i < m_lines.size()Description
TRUEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
40-249381
802 const TextDecoration &textDecoration = m_lines.at(i);-
803-
804 QColor color = textDecoration.selectionState == Selected
textDecoration...te == SelectedDescription
TRUEnever evaluated
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
0-40
805 ? m_selectedTextColor-
806 : textDecoration.color;-
807-
808 parentNode->addRectangleNode(textDecoration.rect, color);-
809 }
executed 40 times by 3 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
  • tst_qquicktextedit
40
810-
811 // Finally add the selected text on top of everything-
812 for (int i = 0; i < nodes.size(); ++i) {
i < nodes.size()Description
TRUEevaluated 249095 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095-249381
813 const BinaryTreeNode *node = nodes.at(i);-
814 QQuickDefaultClipNode *clipNode = node->clipNode;-
815 if (clipNode != nullptr && clipNode->parent() == nullptr)
clipNode != nullptrDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 249037 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
clipNode->parent() == nullptrDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-249037
816 parentNode->appendChildNode(clipNode);
executed 58 times by 2 tests: parentNode->appendChildNode(clipNode);
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
817-
818 if (node->selectionState == Selected) {
node->selectio...te == SelectedDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 249037 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
58-249037
819 QColor color = m_selectedTextColor;-
820 int previousNodeIndex = i - 1;-
821 int nextNodeIndex = i + 1;-
822 const BinaryTreeNode *previousNode = previousNodeIndex < 0 ? 0 : nodes.at(previousNodeIndex);
previousNodeIndex < 0Description
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28-30
823 while (previousNode != nullptr && qFuzzyCompare(previousNode->boundingRect.left(), node->boundingRect.left()))
previousNode != nullptrDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
qFuzzyCompare(...ngRect.left())Description
TRUEnever evaluated
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
0-30
824 previousNode = --previousNodeIndex < 0 ? 0 : nodes.at(previousNodeIndex);
never executed: previousNode = --previousNodeIndex < 0 ? 0 : nodes.at(previousNodeIndex);
--previousNodeIndex < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
825-
826 const BinaryTreeNode *nextNode = nextNodeIndex == nodes.size() ? 0 : nodes.at(nextNodeIndex);
nextNodeIndex == nodes.size()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
22-36
827-
828 if (previousNode != nullptr && previousNode->selectionState == Unselected)
previousNode != nullptrDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
previousNode->... == UnselectedDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-30
829 parentNode->addGlyphs(previousNode->position, previousNode->glyphRun, color, style, styleColor, clipNode);
executed 28 times by 2 tests: parentNode->addGlyphs(previousNode->position, previousNode->glyphRun, color, style, styleColor, clipNode);
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28
830-
831 if (nextNode != nullptr && nextNode->selectionState == Unselected)
nextNode != nullptrDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
nextNode->sele... == UnselectedDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-36
832 parentNode->addGlyphs(nextNode->position, nextNode->glyphRun, color, style, styleColor, clipNode);
executed 22 times by 2 tests: parentNode->addGlyphs(nextNode->position, nextNode->glyphRun, color, style, styleColor, clipNode);
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
22
833-
834 // If the previous or next node completely overlaps this one, then we have already drawn the glyphs of-
835 // this node-
836 bool drawCurrent = false;-
837 if (previousNode != nullptr || nextNode != nullptr) {
previousNode != nullptrDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
nextNode != nullptrDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquicktextedit
8-30
838 for (int i = 0; i < node->ranges.size(); ++i) {
i < node->ranges.size()Description
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-50
839 const QPair<int, int> &range = node->ranges.at(i);-
840-
841 int rangeLength = range.second - range.first + 1;-
842 if (previousNode != nullptr) {
previousNode != nullptrDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
22-28
843 for (int j = 0; j < previousNode->ranges.size(); ++j) {
j < previousNo...>ranges.size()Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28-44
844 const QPair<int, int> &otherRange = previousNode->ranges.at(j);-
845-
846 if (range.first < otherRange.second && range.second > otherRange.first) {
range.first < ...erRange.secondDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
range.second >...herRange.firstDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
0-28
847 int start = qMax(range.first, otherRange.first);-
848 int end = qMin(range.second, otherRange.second);-
849 rangeLength -= end - start + 1;-
850 if (rangeLength == 0)
rangeLength == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
851 break;
never executed: break;
0
852 }
never executed: end of block
0
853 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
44
854 }
executed 28 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
28
855-
856 if (nextNode != nullptr && rangeLength > 0) {
nextNode != nullptrDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
rangeLength > 0Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-28
857 for (int j = 0; j < nextNode->ranges.size(); ++j) {
j < nextNode->ranges.size()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
22
858 const QPair<int, int> &otherRange = nextNode->ranges.at(j);-
859-
860 if (range.first < otherRange.second && range.second > otherRange.first) {
range.first < ...erRange.secondDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
range.second >...herRange.firstDescription
TRUEnever evaluated
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
0-22
861 int start = qMax(range.first, otherRange.first);-
862 int end = qMin(range.second, otherRange.second);-
863 rangeLength -= end - start + 1;-
864 if (rangeLength == 0)
rangeLength == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
865 break;
never executed: break;
0
866 }
never executed: end of block
0
867 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
22
868 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
22
869-
870 if (rangeLength > 0) {
rangeLength > 0Description
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-50
871 drawCurrent = true;-
872 break;
executed 50 times by 2 tests: break;
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
50
873 }-
874 }
never executed: end of block
0
875 } else {
executed 50 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
50
876 drawCurrent = true;-
877 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquicktextedit
8
878-
879 if (drawCurrent)
drawCurrentDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_qquicktextedit
  • tst_qquicktextinput
FALSEnever evaluated
0-58
880 parentNode->addGlyphs(node->position, node->glyphRun, color, style, styleColor, clipNode);
executed 58 times by 2 tests: parentNode->addGlyphs(node->position, node->glyphRun, color, style, styleColor, clipNode);
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
881 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_qquicktextedit
  • tst_qquicktextinput
58
882 }
executed 249095 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249095
883-
884 for (int i = 0; i < imageNodes.size(); ++i) {
i < imageNodes.size()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 249381 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
4-249381
885 const BinaryTreeNode *node = imageNodes.at(i);-
886 if (node->selectionState == Selected) {
node->selectio...te == SelectedDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquicktext
0-4
887 parentNode->addImage(node->boundingRect, node->image);-
888 if (node->selectionState == Selected) {
node->selectio...te == SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
0
889 QColor color = m_selectionColor;-
890 color.setAlpha(128);-
891 parentNode->addRectangleNode(node->boundingRect, color);-
892 }
never executed: end of block
0
893 }
never executed: end of block
0
894 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquicktext
4
895}
executed 249381 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249381
896-
897void QQuickTextNodeEngine::mergeFormats(QTextLayout *textLayout, QVarLengthArray<QTextLayout::FormatRange> *mergedFormats)-
898{-
899 Q_ASSERT(mergedFormats != nullptr);-
900 if (textLayout == nullptr)
textLayout == nullptrDescription
TRUEnever evaluated
FALSEevaluated 249113 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-249113
901 return;
never executed: return;
0
902-
903 QVector<QTextLayout::FormatRange> additionalFormats = textLayout->formats();-
904 for (int i=0; i<additionalFormats.size(); ++i) {
i<additionalFormats.size()Description
TRUEevaluated 188 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
FALSEevaluated 249113 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
188-249113
905 QTextLayout::FormatRange additionalFormat = additionalFormats.at(i);-
906 if (additionalFormat.format.hasProperty(QTextFormat::ForegroundBrush)
additionalForm...regroundBrush)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
12-176
907 || additionalFormat.format.hasProperty(QTextFormat::BackgroundBrush)
additionalForm...ckgroundBrush)Description
TRUEnever evaluated
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
0-176
908 || additionalFormat.format.isAnchor()) {
additionalForm...mat.isAnchor()Description
TRUEnever evaluated
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktext
0-176
909 // Merge overlapping formats-
910 if (!mergedFormats->isEmpty()) {
!mergedFormats->isEmpty()Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
0-12
911 QTextLayout::FormatRange *lastFormat = mergedFormats->data() + mergedFormats->size() - 1;-
912-
913 if (additionalFormat.start < lastFormat->start + lastFormat->length) {
additionalForm...Format->lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
914 QTextLayout::FormatRange *mergedRange = nullptr;-
915-
916 int length = additionalFormat.length;-
917 if (additionalFormat.start > lastFormat->start) {
additionalForm...tFormat->startDescription
TRUEnever evaluated
FALSEnever evaluated
0
918 lastFormat->length = additionalFormat.start - lastFormat->start;-
919 length -= lastFormat->length;-
920-
921 mergedFormats->append(QTextLayout::FormatRange());-
922 mergedRange = mergedFormats->data() + mergedFormats->size() - 1;-
923 lastFormat = mergedFormats->data() + mergedFormats->size() - 2;-
924 } else {
never executed: end of block
0
925 mergedRange = lastFormat;-
926 }
never executed: end of block
0
927-
928 mergedRange->format = lastFormat->format;-
929 mergedRange->format.merge(additionalFormat.format);-
930 mergedRange->start = additionalFormat.start;-
931-
932 int end = qMin(additionalFormat.start + additionalFormat.length,-
933 lastFormat->start + lastFormat->length);-
934-
935 mergedRange->length = end - mergedRange->start;-
936 length -= mergedRange->length;-
937-
938 additionalFormat.start = end;-
939 additionalFormat.length = length;-
940 }
never executed: end of block
0
941 }
never executed: end of block
0
942-
943 if (additionalFormat.length > 0)
additionalFormat.length > 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-12
944 mergedFormats->append(additionalFormat);
executed 12 times by 1 test: mergedFormats->append(additionalFormat);
Executed by:
  • tst_examples
12
945 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
946 }
executed 188 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquicktext
188
947-
948}
executed 249113 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249113
949-
950void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QTextBlock &block, const QPointF &position, const QColor &textColor, const QColor &anchorColor, int selectionStart, int selectionEnd)-
951{-
952 Q_ASSERT(textDocument);-
953#if QT_CONFIG(im)-
954 int preeditLength = block.isValid() ? block.layout()->preeditAreaText().length() : 0;
block.isValid()Description
TRUEevaluated 670 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
0-670
955 int preeditPosition = block.isValid() ? block.layout()->preeditAreaPosition() : -1;
block.isValid()Description
TRUEevaluated 670 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
0-670
956#endif-
957-
958 setCurrentTextDirection(block.textDirection());-
959-
960 QVarLengthArray<QTextLayout::FormatRange> colorChanges;-
961 mergeFormats(block.layout(), &colorChanges);-
962-
963 QPointF blockPosition = textDocument->documentLayout()->blockBoundingRect(block).topLeft() + position;-
964 if (QTextList *textList = block.textList()) {
QTextList *tex...ock.textList()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 622 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
48-622
965 QPointF pos = blockPosition;-
966 QTextLayout *layout = block.layout();-
967 if (layout->lineCount() > 0) {
layout->lineCount() > 0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-48
968 QTextLine firstLine = layout->lineAt(0);-
969 Q_ASSERT(firstLine.isValid());-
970-
971 setCurrentLine(firstLine);-
972-
973 QRectF textRect = firstLine.naturalTextRect();-
974 pos += textRect.topLeft();-
975 if (block.textDirection() == Qt::RightToLeft)
block.textDire...t::RightToLeftDescription
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktext
0-48
976 pos.rx() += textRect.width();
never executed: pos.rx() += textRect.width();
0
977-
978 const QTextCharFormat charFormat = block.charFormat();-
979 QFont font(charFormat.font());-
980 QFontMetricsF fontMetrics(font);-
981 QTextListFormat listFormat = textList->format();-
982-
983 QString listItemBullet;-
984 switch (listFormat.style()) {-
985 case QTextListFormat::ListCircle:
never executed: case QTextListFormat::ListCircle:
0
986 listItemBullet = QChar(0x25E6); // White bullet-
987 break;
never executed: break;
0
988 case QTextListFormat::ListSquare:
executed 4 times by 1 test: case QTextListFormat::ListSquare:
Executed by:
  • tst_qquicktext
4
989 listItemBullet = QChar(0x25AA); // Black small square-
990 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qquicktext
4
991 case QTextListFormat::ListDecimal:
executed 12 times by 1 test: case QTextListFormat::ListDecimal:
Executed by:
  • tst_qquicktext
12
992 case QTextListFormat::ListLowerAlpha:
executed 4 times by 1 test: case QTextListFormat::ListLowerAlpha:
Executed by:
  • tst_qquicktext
4
993 case QTextListFormat::ListUpperAlpha:
executed 4 times by 1 test: case QTextListFormat::ListUpperAlpha:
Executed by:
  • tst_qquicktext
4
994 case QTextListFormat::ListLowerRoman:
executed 4 times by 1 test: case QTextListFormat::ListLowerRoman:
Executed by:
  • tst_qquicktext
4
995 case QTextListFormat::ListUpperRoman:
executed 4 times by 1 test: case QTextListFormat::ListUpperRoman:
Executed by:
  • tst_qquicktext
4
996 listItemBullet = textList->itemText(block);-
997 break;
executed 28 times by 1 test: break;
Executed by:
  • tst_qquicktext
28
998 default:
executed 16 times by 1 test: default:
Executed by:
  • tst_qquicktext
16
999 listItemBullet = QChar(0x2022); // Black bullet-
1000 break;
executed 16 times by 1 test: break;
Executed by:
  • tst_qquicktext
16
1001 };-
1002-
1003 QSizeF size(fontMetrics.width(listItemBullet), fontMetrics.height());-
1004 qreal xoff = fontMetrics.width(QLatin1Char(' '));-
1005 if (block.textDirection() == Qt::LeftToRight)
block.textDire...t::LeftToRightDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-48
1006 xoff = -xoff - size.width();
executed 48 times by 1 test: xoff = -xoff - size.width();
Executed by:
  • tst_qquicktext
48
1007 setPosition(pos + QPointF(xoff, 0));-
1008-
1009 QTextLayout layout;-
1010 layout.setFont(font);-
1011 layout.setText(listItemBullet); // Bullet-
1012 layout.beginLayout();-
1013 QTextLine line = layout.createLine();-
1014 line.setPosition(QPointF(0, 0));-
1015 layout.endLayout();-
1016-
1017 QList<QGlyphRun> glyphRuns = layout.glyphRuns();-
1018 for (int i=0; i<glyphRuns.size(); ++i)
i<glyphRuns.size()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquicktext
48
1019 addUnselectedGlyphs(glyphRuns.at(i));
executed 48 times by 1 test: addUnselectedGlyphs(glyphRuns.at(i));
Executed by:
  • tst_qquicktext
48
1020 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquicktext
48
1021 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qquicktext
48
1022-
1023 int textPos = block.position();-
1024 QTextBlock::iterator blockIterator = block.begin();-
1025-
1026 while (!blockIterator.atEnd()) {
!blockIterator.atEnd()Description
TRUEevaluated 576 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEevaluated 670 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
576-670
1027 QTextFragment fragment = blockIterator.fragment();-
1028 QString text = fragment.text();-
1029 if (text.isEmpty())
text.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 576 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-576
1030 continue;
never executed: continue;
0
1031-
1032 QTextCharFormat charFormat = fragment.charFormat();-
1033 QFont font(charFormat.font());-
1034 QFontMetricsF fontMetrics(font);-
1035-
1036 int fontHeight = fontMetrics.descent() + fontMetrics.ascent();-
1037 int valign = charFormat.verticalAlignment();-
1038 if (valign == QTextCharFormat::AlignSuperScript)
valign == QTex...ignSuperScriptDescription
TRUEnever evaluated
FALSEevaluated 576 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-576
1039 setPosition(QPointF(blockPosition.x(), blockPosition.y() - fontHeight / 2));
never executed: setPosition(QPointF(blockPosition.x(), blockPosition.y() - fontHeight / 2));
0
1040 else if (valign == QTextCharFormat::AlignSubScript)
valign == QTex...AlignSubScriptDescription
TRUEnever evaluated
FALSEevaluated 576 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-576
1041 setPosition(QPointF(blockPosition.x(), blockPosition.y() + fontHeight / 6));
never executed: setPosition(QPointF(blockPosition.x(), blockPosition.y() + fontHeight / 6));
0
1042 else-
1043 setPosition(blockPosition);
executed 576 times by 5 tests: setPosition(blockPosition);
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
576
1044-
1045 if (text.contains(QChar::ObjectReplacementCharacter)) {
text.contains(...mentCharacter)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEevaluated 570 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
6-570
1046 QTextFrame *frame = qobject_cast<QTextFrame *>(textDocument->objectForFormat(charFormat));-
1047 if (frame && frame->frameFormat().position() == QTextFrameFormat::InFlow) {
frameDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
frame->frameFo...Format::InFlowDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-6
1048 int blockRelativePosition = textPos - block.position();-
1049 QTextLine line = block.layout()->lineForTextPosition(blockRelativePosition);-
1050 if (!currentLine().isValid()
!currentLine().isValid()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-6
1051 || line.lineNumber() != currentLine().lineNumber()) {
line.lineNumbe...).lineNumber()Description
TRUEnever evaluated
FALSEnever evaluated
0
1052 setCurrentLine(line);-
1053 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktext
6
1054-
1055 QQuickTextNodeEngine::SelectionState selectionState =-
1056 (selectionStart < textPos + text.length()
selectionStart... text.length()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
FALSEnever evaluated
0-6
1057 && selectionEnd >= textPos)
selectionEnd >= textPosDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquicktext
0-6
1058 ? QQuickTextNodeEngine::Selected-
1059 : QQuickTextNodeEngine::Unselected;-
1060-
1061 addTextObject(QPointF(), charFormat, selectionState, textDocument, textPos);-
1062 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktext
6
1063 textPos += text.length();-
1064 } else {
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquicktext
6
1065 if (charFormat.foreground().style() != Qt::NoBrush)
charFormat.for...!= Qt::NoBrushDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicktextedit
FALSEevaluated 566 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
4-566
1066 setTextColor(charFormat.foreground().color());
executed 4 times by 2 tests: setTextColor(charFormat.foreground().color());
Executed by:
  • tst_examples
  • tst_qquicktextedit
4
1067 else if (charFormat.isAnchor())
charFormat.isAnchor()Description
TRUEnever evaluated
FALSEevaluated 566 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-566
1068 setTextColor(anchorColor);
never executed: setTextColor(anchorColor);
0
1069 else-
1070 setTextColor(textColor);
executed 566 times by 5 tests: setTextColor(textColor);
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
566
1071-
1072 int fragmentEnd = textPos + fragment.length();-
1073#if QT_CONFIG(im)-
1074 if (preeditPosition >= 0
preeditPosition >= 0Description
TRUEnever evaluated
FALSEevaluated 570 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-570
1075 && (preeditPosition + block.position()) >= textPos
(preeditPositi...()) >= textPosDescription
TRUEnever evaluated
FALSEnever evaluated
0
1076 && (preeditPosition + block.position()) <= fragmentEnd) {
(preeditPositi...<= fragmentEndDescription
TRUEnever evaluated
FALSEnever evaluated
0
1077 fragmentEnd += preeditLength;-
1078 }
never executed: end of block
0
1079#endif-
1080 if (charFormat.background().style() != Qt::NoBrush) {
charFormat.bac...!= Qt::NoBrushDescription
TRUEnever evaluated
FALSEevaluated 570 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-570
1081 QTextLayout::FormatRange additionalFormat;-
1082 additionalFormat.start = textPos - block.position();-
1083 additionalFormat.length = fragmentEnd - textPos;-
1084 additionalFormat.format = charFormat;-
1085 colorChanges << additionalFormat;-
1086 }
never executed: end of block
0
1087-
1088 textPos = addText(block, charFormat, textColor, colorChanges, textPos, fragmentEnd,-
1089 selectionStart, selectionEnd);-
1090 }
executed 570 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
570
1091-
1092 ++blockIterator;-
1093 }
executed 576 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
576
1094-
1095#if QT_CONFIG(im)-
1096 if (preeditLength >= 0 && textPos <= block.position() + preeditPosition) {
preeditLength >= 0Description
TRUEevaluated 670 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
textPos <= blo...reeditPositionDescription
TRUEnever evaluated
FALSEevaluated 670 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
0-670
1097 setPosition(blockPosition);-
1098 textPos = block.position() + preeditPosition;-
1099 QTextLine line = block.layout()->lineForTextPosition(preeditPosition);-
1100 if (!currentLine().isValid()
!currentLine().isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1101 || line.lineNumber() != currentLine().lineNumber()) {
line.lineNumbe...).lineNumber()Description
TRUEnever evaluated
FALSEnever evaluated
0
1102 setCurrentLine(line);-
1103 }
never executed: end of block
0
1104 textPos = addText(block, block.charFormat(), textColor, colorChanges,-
1105 textPos, textPos + preeditLength,-
1106 selectionStart, selectionEnd);-
1107 }
never executed: end of block
0
1108#endif-
1109-
1110 setCurrentLine(QTextLine()); // Reset current line because the text layout changed-
1111 m_hasContents = true;-
1112}
executed 670 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickfocusscope
  • tst_qquickitem2
  • tst_qquicktext
  • tst_qquicktextedit
670
1113-
1114-
1115QT_END_NAMESPACE-
1116-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0