qsqlrecord.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqlrecord.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5class QSqlRecordPrivate-
6{-
7public:-
8 QSqlRecordPrivate();-
9 QSqlRecordPrivate(const QSqlRecordPrivate &other);-
10-
11 inline bool contains(int index) { return
executed 3290 times by 7 tests: return index >= 0 && index < fields.count();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
index >= 0 && index < fields.count();
executed 3290 times by 7 tests: return index >= 0 && index < fields.count();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
}
3290
12 QString createField(int index, const QString &prefix) const;-
13-
14 QVector<QSqlField> fields;-
15 QAtomicInt ref;-
16};-
17-
18QSqlRecordPrivate::QSqlRecordPrivate() : ref(1)-
19{-
20}
executed 15179 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
15179
21-
22QSqlRecordPrivate::QSqlRecordPrivate(const QSqlRecordPrivate &other): fields(other.fields), ref(1)-
23{-
24}
executed 1024 times by 8 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
1024
25-
26-
27-
28-
29QString QSqlRecordPrivate::createField(int index, const QString &prefix) const-
30{-
31 QString f;-
32 if (!prefix.isEmpty()
!prefix.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
33 f = prefix + QLatin1Char('.');
never executed: f = prefix + QLatin1Char('.');
0
34 f += fields.at(index).name();-
35 return
never executed: return f;
f;
never executed: return f;
0
36}-
37QSqlRecord::QSqlRecord()-
38{-
39 d = new QSqlRecordPrivate();-
40}
executed 15179 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
15179
41QSqlRecord::QSqlRecord(const QSqlRecord& other)-
42{-
43 d = other.d;-
44 d->ref.ref();-
45}
executed 20192 times by 8 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
20192
46QSqlRecord& QSqlRecord::operator=(const QSqlRecord& other)-
47{-
48 qAtomicAssign(d, other.d);-
49 return
executed 1738 times by 8 tests: return *this;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
*this;
executed 1738 times by 8 tests: return *this;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
1738
50}-
51-
52-
53-
54-
55-
56QSqlRecord::~QSqlRecord()-
57{-
58 if (!d->ref.deref()
!d->ref.deref()Description
TRUEevaluated 14532 times by 10 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
FALSEevaluated 20839 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
)
14532-20839
59 delete d;
executed 14532 times by 10 tests: delete d;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
14532
60}
executed 35371 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
35371
61bool QSqlRecord::operator==(const QSqlRecord &other) const-
62{-
63 return
executed 382 times by 4 tests: return d->fields == other.d->fields;
Executed by:
  • tst_QItemModel
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
d->fields == other.d->fields;
executed 382 times by 4 tests: return d->fields == other.d->fields;
Executed by:
  • tst_QItemModel
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
382
64}-
65QVariant QSqlRecord::value(int index) const-
66{-
67 return
executed 1320 times by 5 tests: return d->fields.value(index).value();
Executed by:
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
d->fields.value(index).value();
executed 1320 times by 5 tests: return d->fields.value(index).value();
Executed by:
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
1320
68}-
69QVariant QSqlRecord::value(const QString& name) const-
70{-
71 return
executed 280 times by 3 tests: return value(indexOf(name));
Executed by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
value(indexOf(name));
executed 280 times by 3 tests: return value(indexOf(name));
Executed by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
280
72}-
73QString QSqlRecord::fieldName(int index) const-
74{-
75 return
executed 2572 times by 8 tests: return d->fields.value(index).name();
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
d->fields.value(index).name();
executed 2572 times by 8 tests: return d->fields.value(index).name();
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
2572
76}-
77int QSqlRecord::indexOf(const QString& name) const-
78{-
79 QString nm = name.toUpper();-
80 for (int i = 0; i < count()
i < count()Description
TRUEevaluated 1543 times by 5 tests
Evaluated by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
FALSEevaluated 28 times by 4 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
; ++i) {
28-1543
81 if (d->fields.at(i).name().toUpper() == nm
d->fields.at(i...oUpper() == nmDescription
TRUEevaluated 814 times by 5 tests
Evaluated by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
FALSEevaluated 729 times by 5 tests
Evaluated by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
)
729-814
82 return
executed 814 times by 5 tests: return i;
Executed by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
i;
executed 814 times by 5 tests: return i;
Executed by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
814
83 }
executed 729 times by 5 tests: end of block
Executed by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
729
84 return
executed 28 times by 4 tests: return -1;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
-1;
executed 28 times by 4 tests: return -1;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
28
85}-
86-
87-
88-
89-
90-
91-
92QSqlField QSqlRecord::field(int index) const-
93{-
94 return
executed 1674 times by 8 tests: return d->fields.value(index);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
d->fields.value(index);
executed 1674 times by 8 tests: return d->fields.value(index);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
1674
95}-
96-
97-
98-
99-
100QSqlField QSqlRecord::field(const QString &name) const-
101{-
102 return
executed 284 times by 4 tests: return field(indexOf(name));
Executed by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_qsqlrecord - unknown status
field(indexOf(name));
executed 284 times by 4 tests: return field(indexOf(name));
Executed by:
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_qsqlrecord - unknown status
284
103}-
104void QSqlRecord::append(const QSqlField& field)-
105{-
106 detach();-
107 d->fields.append(field);-
108}
executed 5623 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
5623
109-
110-
111-
112-
113-
114-
115void QSqlRecord::insert(int pos, const QSqlField& field)-
116{-
117 detach();-
118 d->fields.insert(pos, field);-
119}
executed 117 times by 3 tests: end of block
Executed by:
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
117
120void QSqlRecord::replace(int pos, const QSqlField& field)-
121{-
122 if (!d->contains(pos)
!d->contains(pos)Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_QSqlRelationalTableModel
)
0-34
123 return;
never executed: return;
0
124-
125 detach();-
126 d->fields[pos] = field;-
127}
executed 34 times by 1 test: end of block
Executed by:
  • tst_QSqlRelationalTableModel
34
128void QSqlRecord::remove(int pos)-
129{-
130 if (!d->contains(pos)
!d->contains(pos)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsqlrecord - unknown status
FALSEevaluated 24 times by 4 tests
Evaluated by:
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
)
1-24
131 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_qsqlrecord - unknown status
1
132-
133 detach();-
134 d->fields.remove(pos);-
135}
executed 24 times by 4 tests: end of block
Executed by:
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
24
136-
137-
138-
139-
140-
141-
142-
143void QSqlRecord::clear()-
144{-
145 detach();-
146 d->fields.clear();-
147}
executed 124421 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
124421
148bool QSqlRecord::isEmpty() const-
149{-
150 return
executed 89869 times by 10 tests: return d->fields.isEmpty();
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
d->fields.isEmpty();
executed 89869 times by 10 tests: return d->fields.isEmpty();
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
89869
151}-
152-
153-
154-
155-
156-
157-
158-
159bool QSqlRecord::contains(const QString& name) const-
160{-
161 return
executed 6 times by 1 test: return indexOf(name) >= 0;
Executed by:
  • tst_qsqlrecord - unknown status
indexOf(name) >= 0;
executed 6 times by 1 test: return indexOf(name) >= 0;
Executed by:
  • tst_qsqlrecord - unknown status
6
162}-
163void QSqlRecord::clearValues()-
164{-
165 detach();-
166 int count = d->fields.count();-
167 for (int i = 0; i < count
i < countDescription
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
; ++i)
24-72
168 d->fields[i].clear();
executed 72 times by 2 tests: d->fields[i].clear();
Executed by:
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
72
169}
executed 24 times by 2 tests: end of block
Executed by:
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
24
170void QSqlRecord::setGenerated(const QString& name, bool generated)-
171{-
172 setGenerated(indexOf(name), generated);-
173}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qsqlrecord - unknown status
2
174void QSqlRecord::setGenerated(int index, bool generated)-
175{-
176 if (!d->contains(index)
!d->contains(index)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qsqlrecord - unknown status
FALSEevaluated 1678 times by 3 tests
Evaluated by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
)
6-1678
177 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_qsqlrecord - unknown status
6
178 detach();-
179 d->fields[index].setGenerated(generated);-
180}
executed 1678 times by 3 tests: end of block
Executed by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
1678
181-
182-
183-
184-
185-
186-
187-
188bool QSqlRecord::isNull(int index) const-
189{-
190 return
executed 532 times by 4 tests: return d->fields.value(index).isNull();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
d->fields.value(index).isNull();
executed 532 times by 4 tests: return d->fields.value(index).isNull();
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
532
191}-
192-
193-
194-
195-
196-
197-
198-
199bool QSqlRecord::isNull(const QString& name) const-
200{-
201 return
executed 20 times by 1 test: return isNull(indexOf(name));
Executed by:
  • tst_qsqlrecord - unknown status
isNull(indexOf(name));
executed 20 times by 1 test: return isNull(indexOf(name));
Executed by:
  • tst_qsqlrecord - unknown status
20
202}-
203-
204-
205-
206-
207-
208-
209-
210void QSqlRecord::setNull(int index)-
211{-
212 if (!d->contains(index)
!d->contains(index)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsqlrecord - unknown status
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qsqlrecord - unknown status
)
4-48
213 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qsqlrecord - unknown status
4
214 detach();-
215 d->fields[index].clear();-
216}
executed 48 times by 1 test: end of block
Executed by:
  • tst_qsqlrecord - unknown status
48
217-
218-
219-
220-
221-
222-
223-
224void QSqlRecord::setNull(const QString& name)-
225{-
226 setNull(indexOf(name));-
227}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qsqlrecord - unknown status
10
228bool QSqlRecord::isGenerated(const QString& name) const-
229{-
230 return
executed 16 times by 1 test: return isGenerated(indexOf(name));
Executed by:
  • tst_qsqlrecord - unknown status
isGenerated(indexOf(name));
executed 16 times by 1 test: return isGenerated(indexOf(name));
Executed by:
  • tst_qsqlrecord - unknown status
16
231}-
232bool QSqlRecord::isGenerated(int index) const-
233{-
234 return
executed 8549 times by 6 tests: return d->fields.value(index).isGenerated();
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
d->fields.value(index).isGenerated();
executed 8549 times by 6 tests: return d->fields.value(index).isGenerated();
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
8549
235}-
236-
237-
238-
239-
240-
241-
242-
243int QSqlRecord::count() const-
244{-
245 return
executed 146486 times by 9 tests: return d->fields.count();
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
d->fields.count();
executed 146486 times by 9 tests: return d->fields.count();
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
146486
246}-
247void QSqlRecord::setValue(int index, const QVariant& val)-
248{-
249 if (!d->contains(index)
!d->contains(index)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlTableModel
FALSEevaluated 1493 times by 7 tests
Evaluated by:
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
)
2-1493
250 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QSqlTableModel
2
251 detach();-
252 d->fields[index].setValue(val);-
253}
executed 1493 times by 7 tests: end of block
Executed by:
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
1493
254void QSqlRecord::setValue(const QString& name, const QVariant& val)-
255{-
256 setValue(indexOf(name), val);-
257}
executed 15 times by 2 tests: end of block
Executed by:
  • tst_QSqlTableModel
  • tst_qsqlrecord - unknown status
15
258-
259-
260-
261-
262void QSqlRecord::detach()-
263{-
264 qAtomicDetach(d);-
265}
executed 133462 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlrecord - unknown status
133462
266-
267-
268QDebug operator<<(QDebug dbg, const QSqlRecord &r)-
269{-
270 QDebugStateSaver saver(dbg);-
271 dbg.nospace();-
272 const int count = r.count();-
273 dbg << "QSqlRecord(" << count << ')';-
274 for (int i = 0; i < count
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
275 dbg.nospace();-
276 dbg << '\n' << qSetFieldWidth(2) << right << i << left << qSetFieldWidth(0) << ':';-
277 dbg.space();-
278 dbg << r.field(i) << r.value(i).toString();-
279 }
never executed: end of block
0
280 return
never executed: return dbg;
dbg;
never executed: return dbg;
0
281}-
282-
283-
284-
285-
286-
287-
288-
289QSqlRecord QSqlRecord::keyValues(const QSqlRecord &keyFields) const-
290{-
291 QSqlRecord retValues(keyFields);-
292-
293 for (int i = retValues.count() - 1; i >= 0
i >= 0Description
TRUEevaluated 278 times by 2 tests
Evaluated by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
FALSEevaluated 133 times by 2 tests
Evaluated by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
; --i)
133-278
294 retValues.setValue(i, value(retValues.fieldName(i)));
executed 278 times by 2 tests: retValues.setValue(i, value(retValues.fieldName(i)));
Executed by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
278
295-
296 return
executed 133 times by 2 tests: return retValues;
Executed by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
retValues;
executed 133 times by 2 tests: return retValues;
Executed by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
133
297}-
298-
299-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9