Skip to content
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

[MU3] Avoid deprecated assignment past the end of QString #7126

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

orivej
Copy link
Contributor

@orivej orivej commented Dec 20, 2020

https://doc.qt.io/qt-5/qstring.html#operator-5b-5d says this about
QCharRef QString::operator[](int position):

"Before Qt 5.14 it was possible to use this operator to access a
character at an out-of-bounds position in the string, and then assign
to such a position, causing the string to be automatically
resized. These behaviors are deprecated, and will be changed in a
future version of Qt."

Corresponding v4 PR: #7125

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

tok1[j] = s[i];
}
tok1.push_back(s[i]);
}
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz Dec 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is changing the old 3.x code style and its "banner style indent". Not a big deal though, more a nitpick...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I've brought the old style back.

https://doc.qt.io/qt-5/qstring.html#operator-5b-5d says this about
QCharRef QString::operator[](int position):

"Before Qt 5.14 it was possible to use this operator to access a
character at an out-of-bounds position in the string, and then assign
to such a position, causing the string to be automatically
resized. These behaviors are deprecated, and will be changed in a
future version of Qt."
@orivej orivej force-pushed the v3-no-assign-past-qstring-end branch from 64b8c87 to 00304c2 Compare December 20, 2020 19:31
@vpereverzev vpereverzev merged commit 5a03ffe into musescore:3.x Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants