diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index b094c114a8..754e4e339f 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1208,44 +1208,44 @@ QString QWidgetLineControl::maskString(int pos, const QString &str, bool clear) if (strIndex < str.length()) { if (m_maskData[i].separator) { s += m_maskData[i].maskChar; - if (str[(int)strIndex] == m_maskData[i].maskChar) + if (str[strIndex] == m_maskData[i].maskChar) strIndex++; ++i; } else { - if (isValidInput(str[(int)strIndex], m_maskData[i].maskChar)) { + if (isValidInput(str[strIndex], m_maskData[i].maskChar)) { switch (m_maskData[i].caseMode) { case MaskInputData::Upper: - s += str[(int)strIndex].toUpper(); + s += str[strIndex].toUpper(); break; case MaskInputData::Lower: - s += str[(int)strIndex].toLower(); + s += str[strIndex].toLower(); break; default: - s += str[(int)strIndex]; + s += str[strIndex]; } ++i; } else { // search for separator first - int n = findInMask(i, true, true, str[(int)strIndex]); + int n = findInMask(i, true, true, str[strIndex]); if (n != -1) { - if (str.length() != 1 || i == 0 || (i > 0 && (!m_maskData[i-1].separator || m_maskData[i-1].maskChar != str[(int)strIndex]))) { + if (str.length() != 1 || i == 0 || (i > 0 && (!m_maskData[i-1].separator || m_maskData[i-1].maskChar != str[strIndex]))) { s += QStringView{fill}.mid(i, n - i + 1); i = n + 1; // update i to find + 1 } } else { // search for valid m_blank if not - n = findInMask(i, true, false, str[(int)strIndex]); + n = findInMask(i, true, false, str[strIndex]); if (n != -1) { s += QStringView{fill}.mid(i, n - i); switch (m_maskData[n].caseMode) { case MaskInputData::Upper: - s += str[(int)strIndex].toUpper(); + s += str[strIndex].toUpper(); break; case MaskInputData::Lower: - s += str[(int)strIndex].toLower(); + s += str[strIndex].toLower(); break; default: - s += str[(int)strIndex]; + s += str[strIndex]; } i = n + 1; // updates i to find + 1 }