aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-21 09:31:42 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-21 09:31:42 +0200
commit560bc348d86aba6cef5fdf88bc9d7304dd914bc8 (patch)
tree3eaab505c070f61ecf0022d36810dde5becb68d1 /src
parent7dc0de374300d66ed72f15820a4ebb78849ae0e7 (diff)
parent23a000f9a14889753a63cd73de2c61e49bb7e0d8 (diff)
Merge remote-tracking branch 'origin/5.14.2' into 5.14
Diffstat (limited to 'src')
-rw-r--r--src/qmlmodels/qqmltablemodel.cpp21
-rw-r--r--src/quick/items/qquicktextinput.cpp3
2 files changed, 18 insertions, 6 deletions
diff --git a/src/qmlmodels/qqmltablemodel.cpp b/src/qmlmodels/qqmltablemodel.cpp
index f190ad86b1..fab20f7410 100644
--- a/src/qmlmodels/qqmltablemodel.cpp
+++ b/src/qmlmodels/qqmltablemodel.cpp
@@ -1028,11 +1028,24 @@ bool QQmlTableModel::validateNewRow(const char *functionName, const QVariant &ro
}
const QVariant rolePropertyValue = rowAsMap.value(roleData.name);
+
if (rolePropertyValue.type() != 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 11a6600b74..ee51711d34 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -2901,8 +2901,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);