diff options
author | Karsten Heimrich <[email protected]> | 2020-06-16 10:23:19 +0200 |
---|---|---|
committer | Karsten Heimrich <[email protected]> | 2020-06-16 22:46:16 +0200 |
commit | 1b10ce6a08edbc2ac7e8fd7e97e3fc691f2081df (patch) | |
tree | 34ab485d1dd9435369709b5e77c11af6dec78c22 /src/quick/util/qquickglobal.cpp | |
parent | b65eee039092fa664e781cdd98a4bb5e66815218 (diff) |
Port QtDeclarative from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
Diffstat (limited to 'src/quick/util/qquickglobal.cpp')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index f5d4a54e74..2c20f1c76a 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -178,8 +178,8 @@ public: int index = s.indexOf(QLatin1Char(',')); bool xGood, yGood; - float xCoord = s.leftRef(index).toFloat(&xGood); - float yCoord = s.midRef(index + 1).toFloat(&yGood); + float xCoord = QStringView{s}.left(index).toFloat(&xGood); + float yCoord = QStringView{s}.mid(index + 1).toFloat(&yGood); if (xGood && yGood) { if (ok) *ok = true; @@ -198,9 +198,9 @@ public: int index2 = s.indexOf(QLatin1Char(','), index+1); bool xGood, yGood, zGood; - float xCoord = s.leftRef(index).toFloat(&xGood); - float yCoord = s.midRef(index + 1, index2 - index - 1).toFloat(&yGood); - float zCoord = s.midRef(index2 + 1).toFloat(&zGood); + float xCoord = QStringView{s}.left(index).toFloat(&xGood); + float yCoord = QStringView{s}.mid(index + 1, index2 - index - 1).toFloat(&yGood); + float zCoord = QStringView{s}.mid(index2 + 1).toFloat(&zGood); if (xGood && yGood && zGood) { if (ok) *ok = true; @@ -220,10 +220,10 @@ public: int index3 = s.indexOf(QLatin1Char(','), index2+1); bool xGood, yGood, zGood, wGood; - float xCoord = s.leftRef(index).toFloat(&xGood); - float yCoord = s.midRef(index + 1, index2 - index - 1).toFloat(&yGood); - float zCoord = s.midRef(index2 + 1, index3 - index2 - 1).toFloat(&zGood); - float wCoord = s.midRef(index3 + 1).toFloat(&wGood); + float xCoord = QStringView{s}.left(index).toFloat(&xGood); + float yCoord = QStringView{s}.mid(index + 1, index2 - index - 1).toFloat(&yGood); + float zCoord = QStringView{s}.mid(index2 + 1, index3 - index2 - 1).toFloat(&zGood); + float wCoord = QStringView{s}.mid(index3 + 1).toFloat(&wGood); if (xGood && yGood && zGood && wGood) { if (ok) *ok = true; @@ -243,10 +243,10 @@ public: int index3 = s.indexOf(QLatin1Char(','), index2+1); bool sGood, xGood, yGood, zGood; - qreal sCoord = s.leftRef(index).toDouble(&sGood); - qreal xCoord = s.midRef(index+1, index2-index-1).toDouble(&xGood); - qreal yCoord = s.midRef(index2+1, index3-index2-1).toDouble(&yGood); - qreal zCoord = s.midRef(index3+1).toDouble(&zGood); + qreal sCoord = QStringView{s}.left(index).toDouble(&sGood); + qreal xCoord = QStringView{s}.mid(index+1, index2-index-1).toDouble(&xGood); + qreal yCoord = QStringView{s}.mid(index2+1, index3-index2-1).toDouble(&yGood); + qreal zCoord = QStringView{s}.mid(index3+1).toDouble(&zGood); if (sGood && xGood && yGood && zGood) { if (ok) *ok = true; @@ -263,7 +263,7 @@ public: if (s.count(QLatin1Char(',')) == 15) { float matValues[16]; bool vOK = true; - QStringRef mutableStr(&s); + QStringView mutableStr(s); for (int i = 0; vOK && i < 16; ++i) { int cidx = mutableStr.indexOf(QLatin1Char(',')); matValues[i] = mutableStr.left(cidx).toDouble(&vOK); |