aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-10-10 14:54:07 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-10-13 17:11:33 +0000
commiteff37a46ce33078f6f601bd724bbb7359b5db055 (patch)
treea00f7468816f84b641a7ca47b024198036e563ba /src/qml/types
parenta05fec277d0a122e03bb6c7756777729df50b1f2 (diff)
Qml, Imports: mark some methods as const
These methods do not modify objects. Change-Id: I67b1a10cfd0b32688500fca3265a96f53afd1b57 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmllistmodel.cpp4
-rw-r--r--src/qml/types/qqmllistmodel_p.h2
-rw-r--r--src/qml/types/qqmllistmodel_p_p.h10
3 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index c27c6ac26d..062f7a2a74 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -230,7 +230,7 @@ const ListLayout::Role *ListLayout::getRoleOrCreate(const QString &key, const QV
return &getRoleOrCreate(key, type);
}
-const ListLayout::Role *ListLayout::getExistingRole(const QString &key)
+const ListLayout::Role *ListLayout::getExistingRole(const QString &key) const
{
Role *r = 0;
QStringHash<Role *>::Node *node = roleHash.findNode(key);
@@ -239,7 +239,7 @@ const ListLayout::Role *ListLayout::getExistingRole(const QString &key)
return r;
}
-const ListLayout::Role *ListLayout::getExistingRole(QV4::String *key)
+const ListLayout::Role *ListLayout::getExistingRole(QV4::String *key) const
{
Role *r = 0;
QStringHash<Role *>::Node *node = roleHash.findNode(key);
diff --git a/src/qml/types/qqmllistmodel_p.h b/src/qml/types/qqmllistmodel_p.h
index 29b392f71e..b750d30676 100644
--- a/src/qml/types/qqmllistmodel_p.h
+++ b/src/qml/types/qqmllistmodel_p.h
@@ -195,7 +195,7 @@ private:
// returns true if a role was set
bool applyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex);
- bool definesEmptyList(const QString &);
+ static bool definesEmptyList(const QString &);
QString listElementTypeName;
};
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h
index f99b717c40..887f5a1edc 100644
--- a/src/qml/types/qqmllistmodel_p_p.h
+++ b/src/qml/types/qqmllistmodel_p_p.h
@@ -227,9 +227,9 @@ public:
const Role &getRoleOrCreate(QV4::String *key, Role::DataType type);
const Role &getRoleOrCreate(const QString &key, Role::DataType type);
- const Role &getExistingRole(int index) { return *roles.at(index); }
- const Role *getExistingRole(const QString &key);
- const Role *getExistingRole(QV4::String *key);
+ const Role &getExistingRole(int index) const { return *roles.at(index); }
+ const Role *getExistingRole(const QString &key) const;
+ const Role *getExistingRole(QV4::String *key) const;
int roleCount() const { return roles.count(); }
@@ -335,12 +335,12 @@ public:
return m_layout->roleCount();
}
- const ListLayout::Role &getExistingRole(int index)
+ const ListLayout::Role &getExistingRole(int index) const
{
return m_layout->getExistingRole(index);
}
- const ListLayout::Role *getExistingRole(QV4::String *key)
+ const ListLayout::Role *getExistingRole(QV4::String *key) const
{
return m_layout->getExistingRole(key);
}