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

在 Qt 5.8 以下版本中“实现”了 QMouseEvent::setLocalPos #50

Conversation

pzhlkj6612
Copy link
Member

@pzhlkj6612 pzhlkj6612 commented Jan 21, 2020

在 Qt < 5.8.0 版本中,QMouseEvent没有setLocalPos成员方法。为了实现相同效果,构造一个新的QMouseEvent并让传入的参数ev指向它。由于新的QMouseEvent在栈上,所以似乎不用考虑内存管理的问题。


完整讨论:#47 (review)
这是 78c4d78 的补丁。


Ref: c++ - how to check QT_VERSION to include different header? - Stack Overflow

Copy link
Member

@BensonLaur BensonLaur left a comment

Choose a reason for hiding this comment

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

已测

@BensonLaur BensonLaur merged commit b745606 into BesLyric-for-X:master Jan 29, 2020
@pzhlkj6612
Copy link
Member Author

pzhlkj6612 commented Jan 29, 2020

呃,请问你有尝试过 #47 (comment) 中提到的操作吗?如果觉得可以,我就把 conversation 标记为 resolved 了。

@pzhlkj6612 pzhlkj6612 deleted the QMouseEvent_functions_compatibility_less_than_Qt_5_8_0 branch January 29, 2020 09:39
@BensonLaur
Copy link
Member

呃,请问你有尝试过 #47 (comment) 中提到的操作吗?如果觉得可以,我就把 conversation 标记为 resolved 了。

嗯,是的,我有打开网易云对比,现在的点击拖动效果和网易云一样了

@pzhlkj6612 pzhlkj6612 added this to the Next Release milestone Feb 24, 2020
@BensonLaur BensonLaur mentioned this pull request Feb 29, 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.

None yet

2 participants