diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-01-17 13:48:59 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-01-17 15:55:08 +0000 |
commit | f375f222f511bc67deb8a5fcc533b51d846c68e6 (patch) | |
tree | c54d49c17b8f816152fdb1114f58449f76756180 | |
parent | 0295c86166ae8335d448d26f2ae50d542f6e133b (diff) |
QAbstractItemModelReplicaImplementation::fetchPendingData(): Fix compiler warning
Add braces, fixing:
remoteobjectabstractitemmodelreplica.cpp: In member function ‘void QAbstractItemModelReplicaImplementation::fetchPendingData()’:
qremoteobjectabstractitemmodelreplica.cpp:603:16: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
Change-Id: I399fef3f19b0ac3b585acb9e8e3dd7bd6587723f
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
-rw-r--r-- | src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp b/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp index 5b13081..a2c9376 100644 --- a/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp +++ b/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp @@ -600,10 +600,12 @@ void QAbstractItemModelReplicaImplementation::fetchPendingData() const ModelIndex resStart(std::min(curIndStart.row, dataIndStart.row), std::min(curIndStart.column, dataIndStart.column)); const ModelIndex resEnd(std::max(curIndEnd.row, dataIndEnd.row), std::max(curIndEnd.column, dataIndEnd.column)); QVector<int> roles = curData.roles; - if (!curData.roles.isEmpty()) - Q_FOREACH (int role, data.roles) + if (!curData.roles.isEmpty()) { + Q_FOREACH (int role, data.roles) { if (!curData.roles.contains(role)) roles.append(role); + } + } QRect firstRect( QPoint(curIndStart.row, curIndStart.column), QPoint(curIndEnd.row, curIndEnd.column)); QRect secondRect( QPoint(dataIndStart.row, dataIndStart.column), QPoint(dataIndEnd.row, dataIndEnd.column)); |