qmljs: fix build with Qt 6.9

Commit 9ef4c123c39c642357c9e8530d59f32f220a7824 in qtbase disabled
implicit conversions from other types via integer types to QChar.

And for some reason uchar is not one of those types.

Change-Id: I5921372d3a508fa02166fffd6a96f37bc9a09d69
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Thiago Macieira
2024-10-18 10:01:36 -07:00
parent d78f39b9bb
commit 6618feff25
2 changed files with 3 additions and 2 deletions

View File

@@ -1018,7 +1018,8 @@ again:
int Lexer::scanString(ScanStringMode mode) int Lexer::scanString(ScanStringMode mode)
{ {
QChar quote = (mode == TemplateContinuation) ? QChar(TemplateHead) : QChar(mode); char quoteChar = (mode == TemplateContinuation) ? TemplateHead : mode;
QChar quote(quoteChar);
// we actually use T_STRING_LITERAL also for multiline strings, should we want to // we actually use T_STRING_LITERAL also for multiline strings, should we want to
// change that we should set it to: // change that we should set it to:
// _state.tokenKind == T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL || // _state.tokenKind == T_PARTIAL_SINGLE_QUOTE_STRING_LITERAL ||

View File

@@ -658,7 +658,7 @@ static QString reformatCharacter(int code, int size, bool isSigned)
QChar c; QChar c;
switch (size) { switch (size) {
case 1: c = QChar(uchar(code)); break; case 1: c = QChar(char(code)); break;
case 2: c = QChar(uint16_t(code)); break; case 2: c = QChar(uint16_t(code)); break;
case 4: c = QChar(uint32_t(code)); break; case 4: c = QChar(uint32_t(code)); break;
default: c = QChar(uint(code)); break; default: c = QChar(uint(code)); break;