Skip to content

Qt 5x6

shenleban tongying requested to merge slbtongying/kcalc:feat/Qt6 into master

The breakage is subtle and tricky:

kcalcdisplay

in Qt5 QLocale.zeroDigit() -> QChar thus .unicode() -> ushort

in Qt6 QLocale.zeroDigit() -> QString thus .unicode() -> QChar *

The parameter is changed to auto, because QChar is ushort in Qt5 and char16_t in Qt6.


KNumber

the String[] operator in Qt5 has a bug that allow out-of-bound access. (The bug is documented in 5.15 https://doc.qt.io/qt-5/qstring.html#operator-5b-5d)

In Qt6, this assert will crash immediately which exposes a bug.

Changed to at() which doesn't have this bug in Qt5.

KCalc has been running an undefined behaviour here.

Edited by shenleban tongying

Merge request reports