Skip to content

Commit

Permalink
Qt6: 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 38d6394
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dialog/dlgkeywheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ void DlgKeywheel::updateSvg() {

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

0 comments on commit 38d6394

Please sign in to comment.