-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use QString::mid instead of QString::midRef #4372
Conversation
4568f4a
to
490f58b
Compare
src/dialog/dlgkeywheel.cpp
Outdated
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) | ||
idView = idView.sliced(2, idView.size() - 2); | ||
#else | ||
idView = idView.mid(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this method is deprecated in Qt6. It is much more concise than the new sliced
method in Qt6.
490f58b
to
0d63976
Compare
0d63976
to
fe31d05
Compare
src/dialog/dlgkeywheel.cpp
Outdated
@@ -155,7 +155,14 @@ 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) | |||
QStringView idView(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the simplified expression I proposed? Didn't that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I did not see the variant of QStringView::sliced that omits the second parameter.
fe31d05
to
c24af34
Compare
QString::midRef was removed in Qt6 https://doc.qt.io/qt-6/qtcore-changes-qt6.html#the-qstringview-class
c24af34
to
38d6394
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM
QString::midRef was removed in Qt 6.