aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2020-04-22 18:04:39 +0200
committerLiang Qi <liang.qi@qt.io>2020-04-22 18:04:39 +0200
commita42144610b1e268e82c0aa972e957fd24ac4cc6a (patch)
treeb63d3344952f34d76e0991e3ac0ecbe629c77702 /src
parent796f6e1e8e99ea1046ffe2a744cfd1dca1248258 (diff)
parent560bc348d86aba6cef5fdf88bc9d7304dd914bc8 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15.0
Conflicts: src/imports/labsmodels/qqmltablemodel.cpp tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp This follows edc8512580fa16892dc13034e93300cc6a2bba59. Change-Id: I42d1a977d33043045558118948db9151d03950c7
Diffstat (limited to 'src')
-rw-r--r--src/imports/labsmodels/qqmltablemodel.cpp21
-rw-r--r--src/quick/items/qquicktextinput.cpp3
2 files changed, 18 insertions, 6 deletions
diff --git a/src/imports/labsmodels/qqmltablemodel.cpp b/src/imports/labsmodels/qqmltablemodel.cpp
index 6ba2cecf19..5a2d68780c 100644
--- a/src/imports/labsmodels/qqmltablemodel.cpp
+++ b/src/imports/labsmodels/qqmltablemodel.cpp
@@ -1043,11 +1043,24 @@ bool QQmlTableModel::validateNewRow(const char *functionName, const QVariant &ro
}
const QVariant rolePropertyValue = rowAsMap.value(roleData.name);
+
if (rolePropertyValue.userType() != roleData.type) {
- qmlWarning(this).quote() << functionName << ": expected the property named "
- << roleData.name << " to be of type " << roleData.typeName
- << ", but got " << QString::fromLatin1(rolePropertyValue.typeName()) << " instead";
- return false;
+ if (!rolePropertyValue.canConvert(int(roleData.type))) {
+ qmlWarning(this).quote() << functionName << ": expected the property named "
+ << roleData.name << " to be of type " << roleData.typeName
+ << ", but got " << QString::fromLatin1(rolePropertyValue.typeName())
+ << " instead";
+ return false;
+ }
+
+ QVariant effectiveValue = rolePropertyValue;
+ if (!effectiveValue.convert(int(roleData.type))) {
+ qmlWarning(this).nospace() << functionName << ": failed converting value "
+ << rolePropertyValue << " set at column " << columnIndex << " with role "
+ << QString::fromLatin1(rolePropertyValue.typeName()) << " to "
+ << roleData.typeName;
+ return false;
+ }
}
}
}
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 8f306daed2..06a9f134ac 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -2895,8 +2895,7 @@ void QQuickTextInputPrivate::updateDisplayText(bool forceUpdate)
// characters)
QChar* uc = str.data();
for (int i = 0; i < str.length(); ++i) {
- if ((uc[i].unicode() < 0x20 && uc[i] != QChar::Tabulation)
- || uc[i] == QChar::LineSeparator
+ if (uc[i] == QChar::LineSeparator
|| uc[i] == QChar::ParagraphSeparator
|| uc[i] == QChar::ObjectReplacementCharacter)
uc[i] = QChar(0x0020);