fix unexpected "int -> QChar -> QString" conversion (#417)
This commit is contained in:
parent
d6c739d72e
commit
cc359651ef
|
@ -576,9 +576,11 @@ void CppScopes::addScope(int line, PStatement scopeStatement)
|
||||||
scope->statement = scopeStatement;
|
scope->statement = scopeStatement;
|
||||||
mScopes.append(scope);
|
mScopes.append(scope);
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
if (!mScopes.isEmpty() && mScopes.back()->startLine>line) {
|
if (!mScopes.isEmpty() && mScopes.back()->startLine > line) {
|
||||||
qDebug()<<QString("Error: new scope %1 at %2 which is less that last scope %3")
|
qDebug()<<QString("Error: new scope %1 at %2 which is less that last scope %3")
|
||||||
.arg(scopeStatement->fullName, line,mScopes.back()->startLine>line);
|
.arg(scopeStatement->fullName)
|
||||||
|
.arg(line)
|
||||||
|
.arg(mScopes.back()->startLine);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,7 +238,7 @@ QString variableExpansion(const QString &command, int &pos, const QMap<QString,
|
||||||
unescaped.append("\\u");
|
unescaped.append("\\u");
|
||||||
} else {
|
} else {
|
||||||
int hex = digits.toUInt(nullptr, 16);
|
int hex = digits.toUInt(nullptr, 16);
|
||||||
QByteArray encoded = QString(hex).toUtf8();
|
QByteArray encoded = QString(QChar(hex)).toUtf8();
|
||||||
unescaped.append(encoded);
|
unescaped.append(encoded);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -251,7 +251,8 @@ QString variableExpansion(const QString &command, int &pos, const QMap<QString,
|
||||||
unescaped.append("\\U");
|
unescaped.append("\\U");
|
||||||
} else {
|
} else {
|
||||||
int hex = digits.toUInt(nullptr, 16);
|
int hex = digits.toUInt(nullptr, 16);
|
||||||
QByteArray encoded = QString(hex).toUtf8();
|
char32_t s = hex;
|
||||||
|
QByteArray encoded = QString::fromUcs4(&s, 1).toUtf8();
|
||||||
unescaped.append(encoded);
|
unescaped.append(encoded);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -258,7 +258,7 @@ void BookmarkModel::save(const QString &filename, const QString& projectFolder)
|
||||||
} else {
|
} else {
|
||||||
PBookmark pTemp = list[idx];
|
PBookmark pTemp = list[idx];
|
||||||
if (pTemp->timestamp<=bookmark->timestamp) {
|
if (pTemp->timestamp<=bookmark->timestamp) {
|
||||||
bookmark->description = pTemp->timestamp;
|
bookmark->description = pTemp->description;
|
||||||
bookmark->timestamp = pTemp->timestamp;
|
bookmark->timestamp = pTemp->timestamp;
|
||||||
if (forProject == mIsForProject)
|
if (forProject == mIsForProject)
|
||||||
emit dataChanged(createIndex(idx,2),createIndex(idx,2));
|
emit dataChanged(createIndex(idx,2),createIndex(idx,2));
|
||||||
|
|
|
@ -3239,7 +3239,7 @@ void QSynEdit::recalcCharExtent()
|
||||||
|
|
||||||
QString QSynEdit::expandAtWideGlyphs(const QString &S)
|
QString QSynEdit::expandAtWideGlyphs(const QString &S)
|
||||||
{
|
{
|
||||||
QString Result(S.length()*2); // speed improvement
|
QString Result(S.length()*2, QChar(0)); // speed improvement
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (int i=0;i<S.length();i++) {
|
for (int i=0;i<S.length();i++) {
|
||||||
int CountOfAvgGlyphs = ceil(fontMetrics().horizontalAdvance(S[i])/(double)mCharWidth);
|
int CountOfAvgGlyphs = ceil(fontMetrics().horizontalAdvance(S[i])/(double)mCharWidth);
|
||||||
|
|
Loading…
Reference in New Issue