OpenCoverage

qqmlstringconverters.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlstringconverters.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QVariant QQmlStringConverters::variantFromString(const QString &s)-
6{-
7 if (s.isEmpty()
s.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 28 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
)
0-28
8 return
never executed: return QVariant(s);
QVariant(s);
never executed: return QVariant(s);
0
9-
10 bool ok = false;-
11 QRectF r = rectFFromString(s, &ok);-
12 if (ok
okDescription
TRUEnever evaluated
FALSEevaluated 28 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
) return
never executed: return QVariant(r);
QVariant(r);
never executed: return QVariant(r);
0-28
13 QPointF p = pointFFromString(s, &ok);-
14 if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlmetaobject
FALSEevaluated 26 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
) return
executed 2 times by 1 test: return QVariant(p);
Executed by:
  • tst_qqmlmetaobject
QVariant(p);
executed 2 times by 1 test: return QVariant(p);
Executed by:
  • tst_qqmlmetaobject
2-26
15 QSizeF sz = sizeFFromString(s, &ok);-
16 if (ok
okDescription
TRUEnever evaluated
FALSEevaluated 26 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
) return
never executed: return QVariant(sz);
QVariant(sz);
never executed: return QVariant(sz);
0-26
17-
18 return
executed 26 times by 6 tests: return QQml_valueTypeProvider()->createVariantFromString(s);
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
QQml_valueTypeProvider()->createVariantFromString(s);
executed 26 times by 6 tests: return QQml_valueTypeProvider()->createVariantFromString(s);
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
26
19}-
20-
21QVariant QQmlStringConverters::variantFromString(const QString &s, int preferredType, bool *ok)-
22{-
23 switch (preferredType) {-
24 case
executed 12 times by 1 test: case QMetaType::Int:
Executed by:
  • tst_qqmlecmascript
QMetaType::Int:
executed 12 times by 1 test: case QMetaType::Int:
Executed by:
  • tst_qqmlecmascript
12
25 return
executed 12 times by 1 test: return QVariant(int(qRound(s.toDouble(ok))));
Executed by:
  • tst_qqmlecmascript
QVariant(int(qRound(s.toDouble(ok))));
executed 12 times by 1 test: return QVariant(int(qRound(s.toDouble(ok))));
Executed by:
  • tst_qqmlecmascript
12
26 case
executed 4 times by 1 test: case QMetaType::UInt:
Executed by:
  • tst_qqmlecmascript
QMetaType::UInt:
executed 4 times by 1 test: case QMetaType::UInt:
Executed by:
  • tst_qqmlecmascript
4
27 return
executed 4 times by 1 test: return QVariant(uint(qRound(s.toDouble(ok))));
Executed by:
  • tst_qqmlecmascript
QVariant(uint(qRound(s.toDouble(ok))));
executed 4 times by 1 test: return QVariant(uint(qRound(s.toDouble(ok))));
Executed by:
  • tst_qqmlecmascript
4
28-
29 case
executed 8 times by 1 test: case QMetaType::QDate:
Executed by:
  • tst_qqmlecmascript
QMetaType::QDate:
executed 8 times by 1 test: case QMetaType::QDate:
Executed by:
  • tst_qqmlecmascript
8
30 return
executed 8 times by 1 test: return QVariant::fromValue(dateFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(dateFromString(s, ok));
executed 8 times by 1 test: return QVariant::fromValue(dateFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
8
31 case
executed 4 times by 1 test: case QMetaType::QTime:
Executed by:
  • tst_qqmlecmascript
QMetaType::QTime:
executed 4 times by 1 test: case QMetaType::QTime:
Executed by:
  • tst_qqmlecmascript
4
32 return
executed 4 times by 1 test: return QVariant::fromValue(timeFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(timeFromString(s, ok));
executed 4 times by 1 test: return QVariant::fromValue(timeFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
4
33 case
executed 12 times by 1 test: case QMetaType::QDateTime:
Executed by:
  • tst_qqmlecmascript
QMetaType::QDateTime:
executed 12 times by 1 test: case QMetaType::QDateTime:
Executed by:
  • tst_qqmlecmascript
12
34 return
executed 12 times by 1 test: return QVariant::fromValue(dateTimeFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(dateTimeFromString(s, ok));
executed 12 times by 1 test: return QVariant::fromValue(dateTimeFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
12
35-
36 case
executed 4 times by 1 test: case QMetaType::QPointF:
Executed by:
  • tst_qqmlecmascript
QMetaType::QPointF:
executed 4 times by 1 test: case QMetaType::QPointF:
Executed by:
  • tst_qqmlecmascript
4
37 return
executed 4 times by 1 test: return QVariant::fromValue(pointFFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(pointFFromString(s, ok));
executed 4 times by 1 test: return QVariant::fromValue(pointFFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
4
38 case
executed 4 times by 1 test: case QMetaType::QPoint:
Executed by:
  • tst_qqmlecmascript
QMetaType::QPoint:
executed 4 times by 1 test: case QMetaType::QPoint:
Executed by:
  • tst_qqmlecmascript
4
39 return
executed 4 times by 1 test: return QVariant::fromValue(pointFFromString(s, ok).toPoint());
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(pointFFromString(s, ok).toPoint());
executed 4 times by 1 test: return QVariant::fromValue(pointFFromString(s, ok).toPoint());
Executed by:
  • tst_qqmlecmascript
4
40 case
executed 4 times by 1 test: case QMetaType::QSizeF:
Executed by:
  • tst_qqmlecmascript
QMetaType::QSizeF:
executed 4 times by 1 test: case QMetaType::QSizeF:
Executed by:
  • tst_qqmlecmascript
4
41 return
executed 4 times by 1 test: return QVariant::fromValue(sizeFFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(sizeFFromString(s, ok));
executed 4 times by 1 test: return QVariant::fromValue(sizeFFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
4
42 case
executed 4 times by 1 test: case QMetaType::QSize:
Executed by:
  • tst_qqmlecmascript
QMetaType::QSize:
executed 4 times by 1 test: case QMetaType::QSize:
Executed by:
  • tst_qqmlecmascript
4
43 return
executed 4 times by 1 test: return QVariant::fromValue(sizeFFromString(s, ok).toSize());
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(sizeFFromString(s, ok).toSize());
executed 4 times by 1 test: return QVariant::fromValue(sizeFFromString(s, ok).toSize());
Executed by:
  • tst_qqmlecmascript
4
44 case
executed 4 times by 1 test: case QMetaType::QRectF:
Executed by:
  • tst_qqmlecmascript
QMetaType::QRectF:
executed 4 times by 1 test: case QMetaType::QRectF:
Executed by:
  • tst_qqmlecmascript
4
45 return
executed 4 times by 1 test: return QVariant::fromValue(rectFFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(rectFFromString(s, ok));
executed 4 times by 1 test: return QVariant::fromValue(rectFFromString(s, ok));
Executed by:
  • tst_qqmlecmascript
4
46 case
executed 4 times by 1 test: case QMetaType::QRect:
Executed by:
  • tst_qqmlecmascript
QMetaType::QRect:
executed 4 times by 1 test: case QMetaType::QRect:
Executed by:
  • tst_qqmlecmascript
4
47 return
executed 4 times by 1 test: return QVariant::fromValue(rectFFromString(s, ok).toRect());
Executed by:
  • tst_qqmlecmascript
QVariant::fromValue(rectFFromString(s, ok).toRect());
executed 4 times by 1 test: return QVariant::fromValue(rectFFromString(s, ok).toRect());
Executed by:
  • tst_qqmlecmascript
4
48 default
executed 80806 times by 33 tests: default:
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qjsonbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmlproperty
  • tst_qqmlvaluetypeproviders
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • ...
:
executed 80806 times by 33 tests: default:
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qjsonbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmlproperty
  • tst_qqmlvaluetypeproviders
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • ...
80806
49 return
executed 80806 times by 33 tests: return QQml_valueTypeProvider()->createVariantFromString(preferredType, s, ok);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qjsonbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmlproperty
  • tst_qqmlvaluetypeproviders
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • ...
QQml_valueTypeProvider()->createVariantFromString(preferredType, s, ok);
executed 80806 times by 33 tests: return QQml_valueTypeProvider()->createVariantFromString(preferredType, s, ok);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qjsonbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmlproperty
  • tst_qqmlvaluetypeproviders
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpathview
  • ...
80806
50 }-
51}-
52-
53QVariant QQmlStringConverters::colorFromString(const QString &s, bool *ok)-
54{-
55 return
executed 154 times by 2 tests: return QQml_colorProvider()->colorFromString(s, ok);
Executed by:
  • tst_examples
  • tst_qqmlqt
QQml_colorProvider()->colorFromString(s, ok);
executed 154 times by 2 tests: return QQml_colorProvider()->colorFromString(s, ok);
Executed by:
  • tst_examples
  • tst_qqmlqt
154
56}-
57-
58unsigned QQmlStringConverters::rgbaFromString(const QString &s, bool *ok)-
59{-
60 return
executed 36659 times by 83 tests: return QQml_colorProvider()->rgbaFromString(s, ok);
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmltypeloader
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • ...
QQml_colorProvider()->rgbaFromString(s, ok);
executed 36659 times by 83 tests: return QQml_colorProvider()->rgbaFromString(s, ok);
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmltypeloader
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • ...
36659
61}-
62-
63-
64QDate QQmlStringConverters::dateFromString(const QString &s, bool *ok)-
65{-
66 QDate d = QDate::fromString(s, Qt::ISODate);-
67 if (ok
okDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
FALSEnever evaluated
) *
executed 8 times by 1 test: *ok = d.isValid();
Executed by:
  • tst_qqmlecmascript
ok = d.isValid();
executed 8 times by 1 test: *ok = d.isValid();
Executed by:
  • tst_qqmlecmascript
0-8
68 return
executed 8 times by 1 test: return d;
Executed by:
  • tst_qqmlecmascript
d;
executed 8 times by 1 test: return d;
Executed by:
  • tst_qqmlecmascript
8
69}-
70-
71QTime QQmlStringConverters::timeFromString(const QString &s, bool *ok)-
72{-
73 QTime t = QTime::fromString(s, Qt::ISODate);-
74 if (ok
okDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
FALSEnever evaluated
) *
executed 4 times by 1 test: *ok = t.isValid();
Executed by:
  • tst_qqmlecmascript
ok = t.isValid();
executed 4 times by 1 test: *ok = t.isValid();
Executed by:
  • tst_qqmlecmascript
0-4
75 return
executed 4 times by 1 test: return t;
Executed by:
  • tst_qqmlecmascript
t;
executed 4 times by 1 test: return t;
Executed by:
  • tst_qqmlecmascript
4
76}-
77-
78QDateTime QQmlStringConverters::dateTimeFromString(const QString &s, bool *ok)-
79{-
80 QDateTime d = QDateTime::fromString(s, Qt::ISODate);-
81 if (ok
okDescription
TRUEevaluated 104 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
FALSEnever evaluated
) *
executed 104 times by 5 tests: *ok = d.isValid();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
ok = d.isValid();
executed 104 times by 5 tests: *ok = d.isValid();
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
0-104
82-
83 if (d.timeSpec() == Qt::LocalTime
d.timeSpec() == Qt::LocalTimeDescription
TRUEevaluated 96 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
)
8-96
84 d.setTimeSpec(Qt::UTC);
executed 96 times by 5 tests: d.setTimeSpec(Qt::UTC);
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
96
85 return
executed 104 times by 5 tests: return d;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
d;
executed 104 times by 5 tests: return d;
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qqmlqt
  • tst_qqmlsettings
104
86}-
87-
88-
89-
90QPointF QQmlStringConverters::pointFFromString(const QString &s, bool *ok)-
91{-
92 if (s.count(QLatin1Char(',')) != 1
s.count(QLatin1Char(',')) != 1Description
TRUEevaluated 26 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
) {
10-26
93 if (ok
okDescription
TRUEevaluated 26 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
FALSEnever evaluated
)
0-26
94 *
executed 26 times by 6 tests: *ok = false;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
ok = false;
executed 26 times by 6 tests: *ok = false;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
26
95 return
executed 26 times by 6 tests: return QPointF();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
QPointF();
executed 26 times by 6 tests: return QPointF();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
26
96 }-
97-
98 bool xGood, yGood;-
99 int index = s.indexOf(QLatin1Char(','));-
100 qreal xCoord = s.leftRef(index).toDouble(&xGood);-
101 qreal yCoord = s.midRef(index+1).toDouble(&yGood);-
102 if (!xGood
!xGoodDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
|| !yGood
!yGoodDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
) {
0-10
103 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
104 *
never executed: *ok = false;
ok = false;
never executed: *ok = false;
0
105 return
never executed: return QPointF();
QPointF();
never executed: return QPointF();
0
106 }-
107-
108 if (ok
okDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
FALSEnever evaluated
)
0-10
109 *
executed 10 times by 2 tests: *ok = true;
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
ok = true;
executed 10 times by 2 tests: *ok = true;
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
10
110 return
executed 10 times by 2 tests: return QPointF(xCoord, yCoord);
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
QPointF(xCoord, yCoord);
executed 10 times by 2 tests: return QPointF(xCoord, yCoord);
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
10
111}-
112-
113-
114QSizeF QQmlStringConverters::sizeFFromString(const QString &s, bool *ok)-
115{-
116 if (s.count(QLatin1Char('x')) != 1
s.count(QLatin1Char('x')) != 1Description
TRUEevaluated 26 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
) {
24-26
117 if (ok
okDescription
TRUEevaluated 26 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
FALSEnever evaluated
)
0-26
118 *
executed 26 times by 6 tests: *ok = false;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
ok = false;
executed 26 times by 6 tests: *ok = false;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
26
119 return
executed 26 times by 6 tests: return QSizeF();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
QSizeF();
executed 26 times by 6 tests: return QSizeF();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
26
120 }-
121-
122 bool wGood, hGood;-
123 int index = s.indexOf(QLatin1Char('x'));-
124 qreal width = s.leftRef(index).toDouble(&wGood);-
125 qreal height = s.midRef(index+1).toDouble(&hGood);-
126 if (!wGood
!wGoodDescription
TRUEnever evaluated
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
|| !hGood
!hGoodDescription
TRUEnever evaluated
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
) {
0-24
127 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
128 *
never executed: *ok = false;
ok = false;
never executed: *ok = false;
0
129 return
never executed: return QSizeF();
QSizeF();
never executed: return QSizeF();
0
130 }-
131-
132 if (ok
okDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
FALSEnever evaluated
)
0-24
133 *
executed 24 times by 2 tests: *ok = true;
Executed by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
ok = true;
executed 24 times by 2 tests: *ok = true;
Executed by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
24
134 return
executed 24 times by 2 tests: return QSizeF(width, height);
Executed by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
QSizeF(width, height);
executed 24 times by 2 tests: return QSizeF(width, height);
Executed by:
  • tst_qqmlecmascript
  • tst_qquickimageprovider
24
135}-
136-
137-
138QRectF QQmlStringConverters::rectFFromString(const QString &s, bool *ok)-
139{-
140 if (s.count(QLatin1Char(',')) != 2
s.count(QLatin1Char(',')) != 2Description
TRUEevaluated 28 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
|| s.count(QLatin1Char('x')) != 1
s.count(QLatin1Char('x')) != 1Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
) {
0-28
141 if (ok
okDescription
TRUEevaluated 28 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
FALSEnever evaluated
)
0-28
142 *
executed 28 times by 7 tests: *ok = false;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
ok = false;
executed 28 times by 7 tests: *ok = false;
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
28
143 return
executed 28 times by 7 tests: return QRectF();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
QRectF();
executed 28 times by 7 tests: return QRectF();
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlmetaobject
  • tst_qquickanimations
  • tst_qquickimage
  • tst_qquickitem
28
144 }-
145-
146 bool xGood, yGood, wGood, hGood;-
147 int index = s.indexOf(QLatin1Char(','));-
148 qreal x = s.leftRef(index).toDouble(&xGood);-
149 int index2 = s.indexOf(QLatin1Char(','), index+1);-
150 qreal y = s.midRef(index+1, index2-index-1).toDouble(&yGood);-
151 index = s.indexOf(QLatin1Char('x'), index2+1);-
152 qreal width = s.midRef(index2+1, index-index2-1).toDouble(&wGood);-
153 qreal height = s.midRef(index+1).toDouble(&hGood);-
154 if (!xGood
!xGoodDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
|| !yGood
!yGoodDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
|| !wGood
!wGoodDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
|| !hGood
!hGoodDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
) {
0-8
155 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
156 *
never executed: *ok = false;
ok = false;
never executed: *ok = false;
0
157 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
158 }-
159-
160 if (ok
okDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlecmascript
FALSEnever evaluated
)
0-8
161 *
executed 8 times by 1 test: *ok = true;
Executed by:
  • tst_qqmlecmascript
ok = true;
executed 8 times by 1 test: *ok = true;
Executed by:
  • tst_qqmlecmascript
8
162 return
executed 8 times by 1 test: return QRectF(x, y, width, height);
Executed by:
  • tst_qqmlecmascript
QRectF(x, y, width, height);
executed 8 times by 1 test: return QRectF(x, y, width, height);
Executed by:
  • tst_qqmlecmascript
8
163}-
164-
165bool QQmlStringConverters::createFromString(int type, const QString &s, void *data, size_t n)-
166{-
167 ((data) ? static_cast<void>(0) : qt_assert("data", __FILE__, 213));-
168-
169 bool ok = false;-
170-
171 switch (type) {-
172 case
never executed: case QMetaType::Int:
QMetaType::Int:
never executed: case QMetaType::Int:
0
173 {-
174 ((n >= sizeof(int)) ? static_cast<void>(0) : qt_assert("n >= sizeof(int)", __FILE__, 220));-
175 int *p = reinterpret_cast<int *>(data);-
176 *p = int(qRound(s.toDouble(&ok)));-
177 return
never executed: return ok;
ok;
never executed: return ok;
0
178 }-
179 case
never executed: case QMetaType::UInt:
QMetaType::UInt:
never executed: case QMetaType::UInt:
0
180 {-
181 ((n >= sizeof(uint)) ? static_cast<void>(0) : qt_assert("n >= sizeof(uint)", __FILE__, 227));-
182 uint *p = reinterpret_cast<uint *>(data);-
183 *p = uint(qRound(s.toDouble(&ok)));-
184 return
never executed: return ok;
ok;
never executed: return ok;
0
185 }-
186-
187 case
never executed: case QMetaType::QDate:
QMetaType::QDate:
never executed: case QMetaType::QDate:
0
188 {-
189 ((n >= sizeof(QDate)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QDate)", __FILE__, 235));-
190 QDate *p = reinterpret_cast<QDate *>(data);-
191 *p = dateFromString(s, &ok);-
192 return
never executed: return ok;
ok;
never executed: return ok;
0
193 }-
194 case
never executed: case QMetaType::QTime:
QMetaType::QTime:
never executed: case QMetaType::QTime:
0
195 {-
196 ((n >= sizeof(QTime)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QTime)", __FILE__, 242));-
197 QTime *p = reinterpret_cast<QTime *>(data);-
198 *p = timeFromString(s, &ok);-
199 return
never executed: return ok;
ok;
never executed: return ok;
0
200 }-
201 case
never executed: case QMetaType::QDateTime:
QMetaType::QDateTime:
never executed: case QMetaType::QDateTime:
0
202 {-
203 ((n >= sizeof(QDateTime)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QDateTime)", __FILE__, 249));-
204 QDateTime *p = reinterpret_cast<QDateTime *>(data);-
205 *p = dateTimeFromString(s, &ok);-
206 return
never executed: return ok;
ok;
never executed: return ok;
0
207 }-
208-
209 case
never executed: case QMetaType::QPointF:
QMetaType::QPointF:
never executed: case QMetaType::QPointF:
0
210 {-
211 ((n >= sizeof(QPointF)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QPointF)", __FILE__, 257));-
212 QPointF *p = reinterpret_cast<QPointF *>(data);-
213 *p = pointFFromString(s, &ok);-
214 return
never executed: return ok;
ok;
never executed: return ok;
0
215 }-
216 case
never executed: case QMetaType::QPoint:
QMetaType::QPoint:
never executed: case QMetaType::QPoint:
0
217 {-
218 ((n >= sizeof(QPoint)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QPoint)", __FILE__, 264));-
219 QPoint *p = reinterpret_cast<QPoint *>(data);-
220 *p = pointFFromString(s, &ok).toPoint();-
221 return
never executed: return ok;
ok;
never executed: return ok;
0
222 }-
223 case
never executed: case QMetaType::QSizeF:
QMetaType::QSizeF:
never executed: case QMetaType::QSizeF:
0
224 {-
225 ((n >= sizeof(QSizeF)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QSizeF)", __FILE__, 271));-
226 QSizeF *p = reinterpret_cast<QSizeF *>(data);-
227 *p = sizeFFromString(s, &ok);-
228 return
never executed: return ok;
ok;
never executed: return ok;
0
229 }-
230 case
never executed: case QMetaType::QSize:
QMetaType::QSize:
never executed: case QMetaType::QSize:
0
231 {-
232 ((n >= sizeof(QSize)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QSize)", __FILE__, 278));-
233 QSize *p = reinterpret_cast<QSize *>(data);-
234 *p = sizeFFromString(s, &ok).toSize();-
235 return
never executed: return ok;
ok;
never executed: return ok;
0
236 }-
237 case
never executed: case QMetaType::QRectF:
QMetaType::QRectF:
never executed: case QMetaType::QRectF:
0
238 {-
239 ((n >= sizeof(QRectF)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QRectF)", __FILE__, 285));-
240 QRectF *p = reinterpret_cast<QRectF *>(data);-
241 *p = rectFFromString(s, &ok);-
242 return
never executed: return ok;
ok;
never executed: return ok;
0
243 }-
244 case
never executed: case QMetaType::QRect:
QMetaType::QRect:
never executed: case QMetaType::QRect:
0
245 {-
246 ((n >= sizeof(QRect)) ? static_cast<void>(0) : qt_assert("n >= sizeof(QRect)", __FILE__, 292));-
247 QRect *p = reinterpret_cast<QRect *>(data);-
248 *p = rectFFromString(s, &ok).toRect();-
249 return
never executed: return ok;
ok;
never executed: return ok;
0
250 }-
251 default
never executed: default:
:
never executed: default:
0
252 return
never executed: return QQml_valueTypeProvider()->createValueFromString(type, s, data, n);
QQml_valueTypeProvider()->createValueFromString(type, s, data, n);
never executed: return QQml_valueTypeProvider()->createValueFromString(type, s, data, n);
0
253 }-
254}-
255-
256-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0