fix: add Qt6 version guard for cursor context handling#313
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Dec 5, 2025
Merged
fix: add Qt6 version guard for cursor context handling#313deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Added conditional compilation guards around cursor context management code that is specific to Qt6. The m_cursorContext member only exists in Qt6 version, so accessing it in Qt5 builds would cause compilation errors. This fix ensures the code only compiles the Qt6-specific cursor context cleanup and reinitialization when building with Qt6 or later. The changes include: 1. Wrapping cursor context freeing and reinitialization with #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 2. Added comment noting that m_cursorContext only exists in Qt6 3. Properly guards against accessing Qt6-specific APIs in Qt5 builds Influence: 1. Verify application compiles successfully with both Qt5 and Qt6 2. Test cursor functionality remains working in both Qt versions 3. Confirm cursor theme changes are properly handled in Qt6 builds 4. Validate no memory leaks in cursor context management for Qt6 fix: 为光标上下文处理添加 Qt6 版本保护 添加了条件编译保护,围绕特定于 Qt6 的光标上下文管理代码。m_cursorContext 成员仅存在于 Qt6 版本中,因此在 Qt5 构建中访问它会导致编译错误。此修复 确保代码仅在 Qt6 或更高版本构建时编译 Qt6 特定的光标上下文清理和重新初 始化。 更改包括: 1. 使用 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 包装光标上下文释放和 重新初始化 2. 添加注释说明 m_cursorContext 仅存在于 Qt6 3. 在 Qt5 构建中正确防止访问 Qt6 特定 API Influence: 1. 验证应用程序在 Qt5 和 Qt6 下都能成功编译 2. 测试光标功能在两个 Qt 版本中保持正常工作 3. 确认在 Qt6 构建中光标主题更改得到正确处理 4. 验证 Qt6 中光标上下文管理没有内存泄漏
deepin-ci-robot
added a commit
to linuxdeepin/qt6platform-plugins
that referenced
this pull request
Dec 5, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins. Source-pull-request: linuxdeepin/qt5platform-plugins#313
Contributor
deepin pr auto review我来对这个代码差异进行审查:
改进建议:
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define HAS_QT6_CURSOR_CONTEXT 1
#else
#define HAS_QT6_CURSOR_CONTEXT 0
#endif这样代码中可以使用
总体来说,这是一个很好的改动,正确处理了 Qt 版本兼容性问题,代码质量良好。 |
yixinshark
approved these changes
Dec 5, 2025
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: blocked) |
18202781743
pushed a commit
to linuxdeepin/qt6platform-plugins
that referenced
this pull request
Dec 9, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins. Source-pull-request: linuxdeepin/qt5platform-plugins#313
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added conditional compilation guards around cursor context management code that is specific to Qt6. The m_cursorContext member only exists in Qt6 version, so accessing it in Qt5 builds would cause compilation errors. This fix ensures the code only compiles the Qt6-specific cursor context cleanup and reinitialization when building with Qt6 or later.
The changes include:
Influence:
fix: 为光标上下文处理添加 Qt6 版本保护
添加了条件编译保护,围绕特定于 Qt6 的光标上下文管理代码。m_cursorContext
成员仅存在于 Qt6 版本中,因此在 Qt5 构建中访问它会导致编译错误。此修复
确保代码仅在 Qt6 或更高版本构建时编译 Qt6 特定的光标上下文清理和重新初
始化。
更改包括:
Influence: