Skip to content

Conversation

@C14147
Copy link
Contributor

@C14147 C14147 commented Oct 18, 2025

  1. 我这里使用了宏来处理Qt5和Qt6的接口兼容性
  2. 加入#include 是因为部分情况下编译器无法正确找到QElapsedTimer

@royqh1979
Copy link
Owner

qt 6的checkStateChanged 代替 stateChanged 有点坑啊。这两个信号的参数类型实际上不同的

@royqh1979
Copy link
Owner

我看文档里stateChanged只是deprecated,应该不会导致编译失败吧

@C14147
Copy link
Contributor Author

C14147 commented Oct 18, 2025

我看文档里stateChanged只是deprecated,应该不会导致编译失败吧

@royqh1979
做兼容嘛,已废弃的函数就应尽快修改
您觉得有必要的话就接受,没必要的话我在我自己的仓库里改

@C14147
Copy link
Contributor Author

C14147 commented Oct 18, 2025

我看文档里stateChanged只是deprecated,应该不会导致编译失败吧

而且由于项目的connect函数使用了 新式连接语法(不使用SLOT和SINGLE宏包装信号和槽) ,更换是有必要的:Qt6会在将信号传输给槽时隐式转换为int

@royqh1979
Copy link
Owner

royqh1979 commented Oct 20, 2025

我看文档里stateChanged只是deprecated,应该不会导致编译失败吧

而且由于项目的connect函数使用了 新式连接语法(不使用SLOT和SINGLE宏包装信号和槽) ,更换是有必要的:Qt6会在将信号传输给槽时隐式转换为int

最好还是把两个slots的参数类型也一起改了 而不是依赖隐式转换

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.

2 participants