diff --git a/src/libs/qmljs/parser/qmljslexer.cpp b/src/libs/qmljs/parser/qmljslexer.cpp index 9fe13dffefc..b8c594f593a 100644 --- a/src/libs/qmljs/parser/qmljslexer.cpp +++ b/src/libs/qmljs/parser/qmljslexer.cpp @@ -986,7 +986,7 @@ int Lexer::scanString(ScanStringMode mode) _tokenText += QChar(QChar::highSurrogate(codePoint)); u = QChar::lowSurrogate(codePoint); } else { - u = codePoint; + u = QChar(codePoint); } } break; diff --git a/src/plugins/bineditor/bineditorwidget.cpp b/src/plugins/bineditor/bineditorwidget.cpp index 2c703512d19..f0fd2377927 100644 --- a/src/plugins/bineditor/bineditorwidget.cpp +++ b/src/plugins/bineditor/bineditorwidget.cpp @@ -61,6 +61,11 @@ using namespace Core; +namespace BinEditor { +namespace Internal { + +const QChar MidpointChar = QLatin1Char(0xB7); + static QByteArray calculateHexPattern(const QByteArray &pattern) { QByteArray result; @@ -78,9 +83,6 @@ static QByteArray calculateHexPattern(const QByteArray &pattern) return result; } -namespace BinEditor { -namespace Internal { - class BinEditorWidgetPrivate : public EditorService { public: @@ -567,7 +569,7 @@ Utils::optional BinEditorWidget::posAt(const QPoint &pos, bool includeEm break; QChar qc(QLatin1Char(dataAt(dataPos))); if (!qc.isPrint()) - qc = 0xB7; + qc = MidpointChar; x -= fontMetrics().horizontalAdvance(qc); if (x <= 0) break; @@ -863,7 +865,7 @@ void BinEditorWidget::paintEvent(QPaintEvent *e) break; QChar qc(QLatin1Char(dataAt(pos, isOld))); if (qc.unicode() >= 127 || !qc.isPrint()) - qc = 0xB7; + qc = MidpointChar; printable += qc; } } else { diff --git a/src/plugins/debugger/cdb/stringinputstream.h b/src/plugins/debugger/cdb/stringinputstream.h index 2d4e22413f9..7ed82b38785 100644 --- a/src/plugins/debugger/cdb/stringinputstream.h +++ b/src/plugins/debugger/cdb/stringinputstream.h @@ -84,7 +84,7 @@ void StringInputStream::appendInt(IntType i) if (hexPrefix) pad -= 2; if (pad > 0) - m_target.append(QString('0', pad)); + m_target.append(QString('0', QLatin1Char(pad))); } m_target.append(n); } diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index b62931705f7..30250f27d76 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -308,9 +308,9 @@ QString GdbMi::escapeCString(const QString &ba) default: if (c < 32 || c == 127) { ret += '\\'; - ret += ('0' + (c >> 6)); - ret += ('0' + ((c >> 3) & 7)); - ret += ('0' + (c & 7)); + ret += QLatin1Char('0' + (c >> 6)); + ret += QLatin1Char('0' + ((c >> 3) & 7)); + ret += QLatin1Char('0' + (c & 7)); } else { ret += c; } @@ -521,7 +521,7 @@ static QString quoteUnprintableLatin1(const QString &ba) for (int i = 0, n = ba.size(); i != n; ++i) { const unsigned char c = ba.at(i).unicode(); if (isprint(c)) { - res += c; + res += ba.at(i); } else { qsnprintf(buf, sizeof(buf) - 1, "\\%x", int(c)); res += QLatin1String(buf); diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index b6df43d18a6..c46fbe4663e 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1189,7 +1189,7 @@ public: return '\n'; if (m_key == Key_Escape) return QChar(27); - return m_xkey; + return QChar(m_xkey); } QString toString() const