qsqlindex.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqlindex.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static_assert(bool((sizeof(QList<bool>) == sizeof(QVector<bool>))), "(sizeof(QList<bool>) == sizeof(QVector<bool>))");-
7QSqlIndex::QSqlIndex(const QString& cursorname, const QString& name)-
8 : cursor(cursorname), nm(name)-
9{-
10}
executed 695 times by 6 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
695
11-
12-
13-
14-
15-
16QSqlIndex::QSqlIndex(const QSqlIndex& other)-
17 : QSqlRecord(other), cursor(other.cursor), nm(other.nm), sorts(other.sorts)-
18{-
19}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSqlTableModel
1
20-
21-
22-
23-
24-
25QSqlIndex& QSqlIndex::operator=(const QSqlIndex& other)-
26{-
27 cursor = other.cursor;-
28 nm = other.nm;-
29 sorts = other.sorts;-
30 QSqlRecord::operator=(other);-
31 return
executed 187 times by 4 tests: return *this;
Executed by:
  • tst_QItemModel
  • tst_QSqlDriver
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
*this;
executed 187 times by 4 tests: return *this;
Executed by:
  • tst_QItemModel
  • tst_QSqlDriver
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
187
32}-
33-
34-
35-
36-
37-
38QSqlIndex::~QSqlIndex()-
39{-
40-
41}-
42-
43-
44-
45-
46-
47void QSqlIndex::setName(const QString& name)-
48{-
49 nm = name;-
50}
never executed: end of block
0
51void QSqlIndex::append(const QSqlField& field)-
52{-
53 append(field, false);-
54}
executed 967 times by 6 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
967
55void QSqlIndex::append(const QSqlField& field, bool desc)-
56{-
57 sorts.append(desc);-
58 QSqlRecord::append(field);-
59}
executed 967 times by 6 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
967
60-
61-
62-
63-
64-
65-
66-
67bool QSqlIndex::isDescending(int i) const-
68{-
69 if (i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& i < sorts.size()
i < sorts.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
70 return
never executed: return sorts[i];
sorts[i];
never executed: return sorts[i];
0
71 return
never executed: return false;
false;
never executed: return false;
0
72}-
73-
74-
75-
76-
77-
78-
79-
80void QSqlIndex::setDescending(int i, bool desc)-
81{-
82 if (i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& i < sorts.size()
i < sorts.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
83 sorts[i] = desc;
never executed: sorts[i] = desc;
0
84}
never executed: end of block
0
85QString QSqlIndex::createField(int i, const QString& prefix, bool verbose) const-
86{-
87 QString f;-
88 if (!prefix.isEmpty()
!prefix.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
89 f += prefix + QLatin1Char('.');
never executed: f += prefix + QLatin1Char('.');
0
90 f += field(i).name();-
91 if (verbose
verboseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
92 f += QLatin1Char(' ') + QString((isDescending(i)
never executed: f += QLatin1Char(' ') + QString((isDescending(i) ? QLatin1String("DESC") : QLatin1String("ASC")));
0
93 ? QLatin1String("DESC") : QLatin1String("ASC")));
never executed: f += QLatin1Char(' ') + QString((isDescending(i) ? QLatin1String("DESC") : QLatin1String("ASC")));
0
94 return
never executed: return f;
f;
never executed: return f;
0
95}-
96void QSqlIndex::setCursorName(const QString& cursorName)-
97{-
98 cursor = cursorName;-
99}
never executed: end of block
0
100-
101-
Switch to Source codePreprocessed file

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