-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Qt deprecation fix #5619
Qt deprecation fix #5619
Conversation
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS
🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://8532-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.693-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8532?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://8531-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.693-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8531?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://8535-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.693-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8535?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/kar6d2ci9dhiso4a/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34922746"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/22xj1oha6ced97y0/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34922746"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://8533-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.693-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8533?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "be7fcaa185c32e15e981ee78835e5a8a99d1e712"} |
I recommend you looking at the Qt documentation to check the version compatibility of those functions. |
I am on it, got a bit sidetracked but I'm finishing up now. |
@DomClark The pragma warnings and style violations are gone. I think it's ready. |
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.
Looks good to me.
Just after some confirmation that this fixed the warnings you were seeing, since you opened the issue. Sounds like it does.
Resolved. Will merge tomorrow if there are no objections. |
Please wait, I have to check something about wheel events. |
It does work for Qt 5, but I think it's not a good idea.
|
To be clear, |
It doesn't handle horizontal well, but I made this #5174 which still needs to handle Qt version differences. |
The check was there before. I merely translated it into non-deprecated form.
I'm not sure what you mean by this. Qt 6 will remove the orientation function, and the angleDelta with x and y will be there. Comparing their absolute values is the fastest way to determine the orientation. Unless you're saying the orientation is not important, but there should be a design document on how you expect it to work. Should the modifiers work regardless of orientation? Which orientation would be prefered?... I think it is not in the scope of this PR. I would gladly change them if you post an issue detailing the problem. Now that I think of it, maybe we can put the desired behaviors in a unit test?
Unit tests could theoretically solve this across the board. No more manual testings. |
I mean, wheel events can have arbitrary orientation in Qt6(not restricted to horizontal or vertical). |
What's the desired behavior of wheel scroll on those windows? So I can write tests. |
A note on |
Ideally, A wheel event with |
The comparison is not there to differentiate between (dx, 0) and (0, dy), but to determine the right direction to scroll based on a single (dx, dy).
QWheelEvent::posF is deprecated. |
IMHO,
I know, but I mentioned it for |
How can one scroll (dx, dy) while holding Ctrl + Shift? There is only one scrolling dimension, but two inputs. They will have to combine, or selected. My code currently selects dy. |
Hi, what can I change to get this merged? |
I think the best way for now is reverting |
- replace QWheelEvent::delta with angleDelta - replace QWheelEvent::orientation with comparison of angleDelta.x and y
- use QFlag(0) instead of 0 when appropriate or prompted - use explicit enum when specifying QStyle state in ComboBox's paintEvent
- Use QElapsedTimer instead of QTime where appropriate - Use QAtomicPointer::loadRelaxed() instead of load() - Use QSet<T>(list.begin(), list.end()) instead of list.toSet() - Use Qt::endl in QTextStream - Use QString::isEmpty() instead of comparing to QString::null - Use QFontMetrics::horizontalAdvance instead of width - Use QWheelEvent::position() instead of pos()
I just added FIXME comments where orientation was replaced. |
Can anyone please summarize which points are still open in this PR? |
All deprecation warnings are fixed. The point about horizontal/vertical scrolling distinction is dealt with as suggested. I don't think there's anything left to do. |
@PhysSong Can you please check whether your suggestion was coded correctly, and if yes merge this PR? |
I'll check this again tomorrow and merge if looks okay. |
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.
approved from my side - no compiler warnings anymore
I'll merge it in a day unless there are any objections. |
QRandomGenerator::global()->seed(time(0)); | ||
m_serialNo = 0xD0000000 + QRandomGenerator::global()->generate() % 0x0FFFFFFF; |
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.
Reported on Discord: an user got the following error on OGG export.
Attempted to overwrite a QRandomGenerator to system() or global().
The documentation says QRandomGenerator::global()
is already seeded and can't be overwritten by seed()
.
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.
Open a new issue with this information so it gets attention and a PR can reference it?
Qt6 TODO: Orientation check by comparing angleDelta().x() and y() won't make sense because the direction is arbitrary in Qt 6.
Fix Qt deprecation warnings
Replace QWheelEvent::delta with angleDelta
Replace QWheelEvent::orientation with comparison of angleDelta.x and y
Remove Qt::WindowFlags parameters when adding SubWindows
Remove QFileDialog::Options parameters when opening files
These parameters are currently not used anywhere.
Use QFlag(0) when initializing items in ladspaPortDialog instead of 0
Use explicit enum when specifying QStyle state in ComboBox's paintEvent
Use QElapsedTimer instead of QTime where appropriate
Use QAtomicPointer::loadRelaxed() instead of load()
Use QSet(list.begin(), list.end()) instead of list.toSet()
Use Qt::endl in QTextStream
Use QString::isEmpty() instead of comparing to QString::null
Use QFontMetrics::horizontalAdvance instead of width
Use QWheelEvent::position() instead of pos()