summaryrefslogtreecommitdiffstats
path: root/src/sql/models
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-01-11 20:18:23 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-01-16 19:16:42 +0000
commitccfd6872badaed768df14076dc46afcb2b3c861a (patch)
treef88e7a55ebee853650fdc7f22227e668e180b0fb /src/sql/models
parenta53500f5bf75a89e2a616781c806553568531e5a (diff)
QSqlRelationalDelegate: compile with QT_NO_CAST_FROM_BYTEARRAY
QSqlRelationalDelegate::setEditorData() does not compile when QT_NO_CAST_FROM_BYTEARRAY is defined. Since it's a public header this will break user code. Fix it by calling QByteArray::data() instead of relying on the implicit cast. Fixes: QTBUG-72764 Change-Id: I9c111dd25f48c9c9780d9f9a5b6b75eed0c8d6ed Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/sql/models')
-rw-r--r--src/sql/models/qsqlrelationaldelegate.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sql/models/qsqlrelationaldelegate.h b/src/sql/models/qsqlrelationaldelegate.h
index e8ae5a229d..ca5c46778f 100644
--- a/src/sql/models/qsqlrelationaldelegate.h
+++ b/src/sql/models/qsqlrelationaldelegate.h
@@ -109,11 +109,11 @@ QWidget *createEditor(QWidget *aParent,
// to present the DisplayRole and not the EditRole which
// is the id reference to the related model
QVariant v = index.data(Qt::DisplayRole);
- QByteArray n = editor->metaObject()->userProperty().name();
+ const QByteArray n = editor->metaObject()->userProperty().name();
if (!n.isEmpty()) {
if (!v.isValid())
- v = QVariant(editor->property(n).userType(), nullptr);
- editor->setProperty(n, v);
+ v = QVariant(editor->property(n.data()).userType(), nullptr);
+ editor->setProperty(n.data(), v);
return;
}
}