text/qtextoption.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4struct QTextOptionPrivate -
5{ -
6 QList<QTextOption::Tab> tabStops; -
7}; -
8 -
9 -
10 -
11 -
12 -
13 -
14 -
15QTextOption::QTextOption() -
16 : align(Qt::AlignLeft), -
17 wordWrap(QTextOption::WordWrap), -
18 design(false), -
19 unused(0), -
20 f(0), -
21 tab(-1), -
22 d(0) -
23{ -
24 direction = Qt::LayoutDirectionAuto; -
25}
executed: }
Execution Count:342777
342777
26 -
27 -
28 -
29 -
30 -
31 -
32QTextOption::QTextOption(Qt::Alignment alignment) -
33 : align(alignment), -
34 wordWrap(QTextOption::WordWrap), -
35 design(false), -
36 unused(0), -
37 f(0), -
38 tab(-1), -
39 d(0) -
40{ -
41 direction = QGuiApplication::layoutDirection(); -
42}
executed: }
Execution Count:3
3
43 -
44 -
45 -
46 -
47QTextOption::~QTextOption() -
48{ -
49 delete d; -
50}
executed: }
Execution Count:357950
357950
51 -
52 -
53 -
54 -
55 -
56 -
57QTextOption::QTextOption(const QTextOption &o) -
58 : align(o.align), -
59 wordWrap(o.wordWrap), -
60 design(o.design), -
61 direction(o.direction), -
62 unused(o.unused), -
63 f(o.f), -
64 tab(o.tab), -
65 d(0) -
66{ -
67 if (o.d)
evaluated: o.d
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:15199
1-15199
68 d = new QTextOptionPrivate(*o.d);
executed: d = new QTextOptionPrivate(*o.d);
Execution Count:1
1
69}
executed: }
Execution Count:15200
15200
70 -
71 -
72 -
73 -
74 -
75 -
76 -
77QTextOption &QTextOption::operator=(const QTextOption &o) -
78{ -
79 if (this == &o)
partially evaluated: this == &o
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:165757
0-165757
80 return *this;
never executed: return *this;
0
81 -
82 QTextOptionPrivate* dNew = 0; -
83 if (o.d)
evaluated: o.d
TRUEFALSE
yes
Evaluation Count:3617
yes
Evaluation Count:162140
3617-162140
84 dNew = new QTextOptionPrivate(*o.d);
executed: dNew = new QTextOptionPrivate(*o.d);
Execution Count:3617
3617
85 delete d; -
86 d = dNew; -
87 -
88 align = o.align; -
89 wordWrap = o.wordWrap; -
90 design = o.design; -
91 direction = o.direction; -
92 unused = o.unused; -
93 f = o.f; -
94 tab = o.tab; -
95 return *this;
executed: return *this;
Execution Count:165757
165757
96} -
97 -
98 -
99 -
100 -
101 -
102 -
103 -
104void QTextOption::setTabArray(const QList<qreal> &tabStops) -
105{ -
106 if (!d)
never evaluated: !d
0
107 d = new QTextOptionPrivate;
never executed: d = new QTextOptionPrivate;
0
108 QList<QTextOption::Tab> tabs; -
109 QTextOption::Tab tab; -
110 for (QForeachContainer<__typeof__(tabStops)> _container_(tabStops); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (qreal pos = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
111 tab.position = pos; -
112 tabs.append(tab); -
113 }
never executed: }
0
114 d->tabStops = tabs; -
115}
never executed: }
0
116void QTextOption::setTabs(const QList<QTextOption::Tab> &tabStops) -
117{ -
118 if (!d)
partially evaluated: !d
TRUEFALSE
yes
Evaluation Count:3613
no
Evaluation Count:0
0-3613
119 d = new QTextOptionPrivate;
executed: d = new QTextOptionPrivate;
Execution Count:3613
3613
120 d->tabStops = tabStops; -
121}
executed: }
Execution Count:3613
3613
122 -
123 -
124 -
125 -
126 -
127 -
128QList<qreal> QTextOption::tabArray() const -
129{ -
130 if (!d)
never evaluated: !d
0
131 return QList<qreal>();
never executed: return QList<qreal>();
0
132 -
133 QList<qreal> answer; -
134 QList<QTextOption::Tab>::ConstIterator iter = d->tabStops.constBegin(); -
135 while(iter != d->tabStops.constEnd()) {
never evaluated: iter != d->tabStops.constEnd()
0
136 answer.append( (*iter).position); -
137 ++iter; -
138 }
never executed: }
0
139 return answer;
never executed: return answer;
0
140} -
141 -
142 -
143QList<QTextOption::Tab> QTextOption::tabs() const -
144{ -
145 if (!d)
evaluated: !d
TRUEFALSE
yes
Evaluation Count:35645
yes
Evaluation Count:4
4-35645
146 return QList<QTextOption::Tab>();
executed: return QList<QTextOption::Tab>();
Execution Count:35645
35645
147 return d->tabStops;
executed: return d->tabStops;
Execution Count:4
4
148} -
149 -
150 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial