为什么 QChar( Qt::Key_Right ) 现在出现段错误?
我正在更新一个名为 QFakeVim 的项目中的一些旧内容,它将键盘输入作为整数,然后根据该整数返回 QChar。除了这段代码曾经是有效的这一事实之外,这并不是特别重要。但我不确定自 Qt6 以来 QChar 发生了什么变化。
要复制该错误,只需要这一行代码:
QChar( Qt::key_Right );
正在调用这行代码:
constexpr QCHAR_MAYBE_IMPLICIT QChar(int rc) noexcept : QChar(uint(rc)) {}
// which calls:
constexpr QCHAR_MAYBE_IMPLICIT QChar(uint rc) noexcept : ucs((Q_ASSERT(rc <= 0xffff), char16_t(rc))) {}
哪一行失败了:
Q_ASSERT(rc <= 0xffff)
Qt6 对此有什么改变吗?为什么要在这里Q_ASSERT?谢谢。
I am updating some old cold from a project known as QFakeVim, and it is taking keyboard inputs as integers, and then returning QChar's based on that integer. That is not particularly important other than the fact that this code used to be functional. I am not sure however what has changed since Qt6 in regards to QChar.
To replicate the bug, one merely needs this line of code:
QChar( Qt::key_Right );
which is calling this line of code:
constexpr QCHAR_MAYBE_IMPLICIT QChar(int rc) noexcept : QChar(uint(rc)) {}
// which calls:
constexpr QCHAR_MAYBE_IMPLICIT QChar(uint rc) noexcept : ucs((Q_ASSERT(rc <= 0xffff), char16_t(rc))) {}
Which is failing this:
Q_ASSERT(rc <= 0xffff)
Did something change in Qt6 regarding this? Why does it wish to Q_ASSERT here? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论