sync: from linuxdeepin/qt5integration#97
Merged
18202781743 merged 1 commit intomasterfrom Oct 15, 2025
Merged
Conversation
Contributor
Author
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot 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
deepin pr auto review我对这个diff进行仔细审查,发现了一些需要改进的地方:
改进建议: if(PROJECT_VERSION_MAJOR EQUAL 6)
set(VERSION_SUFFIX 6)
find_package(Qt6 ${MIN_QT6_VERSION} REQUIRED COMPONENTS Core)
# 仅在需要使用私有API时查找
if(USE_PRIVATE_API)
find_package(Qt6 COMPONENTS CorePrivate GuiPrivate WidgetsPrivate REQUIRED)
endif()
else()
set(VERSION_SUFFIX)
find_package(Qt5 ${MIN_QT5_VERSION} REQUIRED COMPONENTS Core)
endif()
改进建议: // 定义版本检查常量
#define MIN_QT_VERSION QT_VERSION_CHECK(5, 15, 0)
#define MIN_QT6_VERSION QT_VERSION_CHECK(6, 0, 0)
// 根据Qt版本选择适当的头文件
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
#include <private/qgenericunixtheme_p.h>
#else
#include <private/qgenericunixthemes_p.h>
#endif
// 或者封装成宏提高可读性
#ifdef USE_QT6_PRIVATE_THEME
#include <private/qgenericunixtheme_p.h>
#else
#include <private/qgenericunixthemes_p.h>
#endif
总结:这个修改主要是为了适配 Qt6 版本,但需要更好的版本兼容性处理和错误处理机制。同时,使用私有 API 时需要格外小心,并确保有充分的理由和必要的错误处理。 |
Contributor
|
Note
详情{
"CMakeLists.txt": [
{
"line": " HOMEPAGE_URL \"https://github.com/linuxdeepin/qt5integration\"",
"line_number": 15,
"rule": "S35",
"reason": "Url link | cc21178aa0"
}
]
} |
Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: linuxdeepin/qt5integration#284
def179a to
6ce40c6
Compare
Contributor
|
Note
详情{
"CMakeLists.txt": [
{
"line": " HOMEPAGE_URL \"https://github.com/linuxdeepin/qt5integration\"",
"line_number": 15,
"rule": "S35",
"reason": "Url link | cc21178aa0"
}
]
} |
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.
Synchronize source files from linuxdeepin/qt5integration.
Source-pull-request: linuxdeepin/qt5integration#284