diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-15 17:48:02 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-15 18:48:47 +0100 |
commit | 87bee5aa79176c124d771d0a92f794e820168e48 (patch) | |
tree | 30d047c47e03432cd71959afdf505863f37449d5 | |
parent | d17a49a5c593947a3a2f7aaa39137375e508a8fd (diff) |
Make a few member functions const
They don't change anything.
Change-Id: Iba7ecdc0658d44db5fd2060d23150e704e9446ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 2 | ||||
-rw-r--r-- | src/qml/compiler/qv4compiler_p.h | 2 | ||||
-rw-r--r-- | src/qmlcompiler/qqmljstyperesolver_p.h | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 02e2470850..538ce715c1 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -223,7 +223,7 @@ int QV4::Compiler::JSUnitGenerator::registerConstant(QV4::ReturnedValue v) return constants.size() - 1; } -QV4::ReturnedValue QV4::Compiler::JSUnitGenerator::constant(int idx) +QV4::ReturnedValue QV4::Compiler::JSUnitGenerator::constant(int idx) const { return constants.at(idx); } diff --git a/src/qml/compiler/qv4compiler_p.h b/src/qml/compiler/qv4compiler_p.h index 5155c25c06..ff5cd3f18e 100644 --- a/src/qml/compiler/qv4compiler_p.h +++ b/src/qml/compiler/qv4compiler_p.h @@ -131,7 +131,7 @@ struct Q_QMLCOMPILER_PRIVATE_EXPORT JSUnitGenerator { int registerRegExp(QQmlJS::AST::RegExpLiteral *regexp); int registerConstant(ReturnedValue v); - ReturnedValue constant(int idx); + ReturnedValue constant(int idx) const; int registerJSClass(const QStringList &members); diff --git a/src/qmlcompiler/qqmljstyperesolver_p.h b/src/qmlcompiler/qqmljstyperesolver_p.h index a6ddc9445e..3d723daac7 100644 --- a/src/qmlcompiler/qqmljstyperesolver_p.h +++ b/src/qmlcompiler/qqmljstyperesolver_p.h @@ -89,7 +89,10 @@ public: QQmlJSScope::ConstPtr scopeForLocation(const QV4::CompiledData::Location &location) const; QQmlJSScope::ConstPtr scopeForId(const QString &id) const; - bool isPrefix(const QString &name) { return m_imports.contains(name) && !m_imports[name]; } + bool isPrefix(const QString &name) const + { + return m_imports.contains(name) && !m_imports[name]; + } QQmlJSScope::ConstPtr typeForName(const QString &name) const { return m_imports[name]; } QQmlJSScope::ConstPtr typeFromAST(QQmlJS::AST::Type *type) const; @@ -137,7 +140,7 @@ public: ComponentIsGeneric allowComponent = ComponentIsGeneric::No) const; const QHash<QString, QQmlJSScope::ConstPtr> &objectsById() { return m_objectsById; } - const QHash<QQmlJS::SourceLocation, QQmlJSMetaSignalHandler> &signalHandlers() + const QHash<QQmlJS::SourceLocation, QQmlJSMetaSignalHandler> &signalHandlers() const { return m_signalHandlers; } |