Skip to content

Commit

Permalink
replace QString::midRef with QStringView
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Oct 12, 2021
1 parent 44a1e4f commit 490f58b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dialog/dlgkeywheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ void DlgKeywheel::updateSvg() {

if (text.isText()) {
QDomText textNode = text.toText();
ChromaticKey key = static_cast<ChromaticKey>(id.midRef(2).toInt());
QStringView idView(id);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
idView = idView.sliced(2, idView.size() - 2);
#else
idView = idView.mid(2);
#endif
ChromaticKey key = static_cast<ChromaticKey>(idView.toInt());
QString keyString = KeyUtils::keyToString(key, m_notation);
textNode.setData(keyString);
}
Expand Down

0 comments on commit 490f58b

Please sign in to comment.