| 63 | private: |
| 64 | struct Section { |
| 65 | explicit Section(QString fullString) : m_fullString(std::move(fullString)) |
| 66 | { |
| 67 | qsizetype cutoff = m_fullString.size(); |
| 68 | for (int i = 0; i < m_fullString.size(); i++) { |
| 69 | if (!m_fullString[i].isDigit()) { |
| 70 | cutoff = i; |
| 71 | break; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 76 | auto numPart = QStringView{ m_fullString }.left(cutoff); |
| 77 | #else |
| 78 | auto numPart = m_fullString.leftRef(cutoff); |
| 79 | #endif |
| 80 | |
| 81 | if (!numPart.isEmpty()) { |
| 82 | m_isNull = false; |
| 83 | m_numPart = numPart.toInt(); |
| 84 | } |
| 85 | |
| 86 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 87 | auto stringPart = QStringView{ m_fullString }.mid(cutoff); |
| 88 | #else |
| 89 | auto stringPart = m_fullString.midRef(cutoff); |
| 90 | #endif |
| 91 | |
| 92 | if (!stringPart.isEmpty()) { |
| 93 | m_isNull = false; |
| 94 | m_stringPart = stringPart.toString(); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | explicit Section() = default; |
| 99 | |