diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-10-16 10:55:26 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-10-17 10:59:31 +0000 |
commit | b09bc0c0ebd8ff35ab5e77b21bd1fdd590347488 (patch) | |
tree | 59c058a6396b74583ce339946375d5fcddc13af8 /src/qml/util | |
parent | af4c0ee6c07f020e733574b1af99ab524bc41a9a (diff) |
QQmlAdaptorModel: return correct column count from the model
There is no reason for QQmlAdaptorModel to return the
wrong column count to the view. For models that are not
QAIM, the accessor that wraps the model will report the
column count to be 1 anyway. The same is also true
for QAbstractListModel.
Change-Id: Ia259b044201d76743e5f43d9f0999d3848912075
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/util')
-rw-r--r-- | src/qml/util/qqmladaptormodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index 2b50a0867c..831663fb7b 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -990,7 +990,7 @@ int QQmlAdaptorModel::rowCount() const int QQmlAdaptorModel::columnCount() const { - return qMax(isValid() ? 1 : 0, accessors->columnCount(*this)); + return qMax(0, accessors->columnCount(*this)); } int QQmlAdaptorModel::rowAt(int index) const |