forked from qt-creator/qt-creator
Qml&Js: properties/methods/enums inspection
.. of builtIn qml and cpp code over "Inspect API For Element Under Cursor" action. Change-Id: I70d5bec2933b682295c5242248a2b0f95dba4e76 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -83,10 +83,10 @@ class UnknownValue;
|
||||
class UrlValue;
|
||||
class Value;
|
||||
class ValueOwner;
|
||||
class MetaFunction;
|
||||
typedef QSharedPointer<const Context> ContextPtr;
|
||||
|
||||
namespace Internal {
|
||||
class MetaFunction;
|
||||
class QtObjectPrototypeReference;
|
||||
} // namespace Internal
|
||||
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
virtual const ASTSignal *asAstSignal() const;
|
||||
virtual const ASTFunctionValue *asAstFunctionValue() const;
|
||||
virtual const Function *asFunction() const;
|
||||
virtual const Internal::MetaFunction *asMetaFunction() const;
|
||||
virtual const MetaFunction *asMetaFunction() const;
|
||||
virtual const JSImportScope *asJSImportScope() const;
|
||||
virtual const TypeScope *asTypeScope() const;
|
||||
|
||||
@@ -304,7 +304,7 @@ template <> Q_INLINE_TEMPLATE const Function *value_cast(const Value *v)
|
||||
else return 0;
|
||||
}
|
||||
|
||||
template <> Q_INLINE_TEMPLATE const Internal::MetaFunction*value_cast(const Value *v)
|
||||
template <> Q_INLINE_TEMPLATE const MetaFunction *value_cast(const Value *v)
|
||||
{
|
||||
if (v) return v->asMetaFunction();
|
||||
else return 0;
|
||||
@@ -1110,6 +1110,20 @@ private:
|
||||
bool m_importFailed;
|
||||
};
|
||||
|
||||
class QMLJS_EXPORT MetaFunction: public FunctionValue
|
||||
{
|
||||
LanguageUtils::FakeMetaMethod m_method;
|
||||
|
||||
public:
|
||||
MetaFunction(const LanguageUtils::FakeMetaMethod &method, ValueOwner *valueOwner);
|
||||
|
||||
int namedArgumentCount() const override;
|
||||
QString argumentName(int index) const override;
|
||||
bool isVariadic() const override;
|
||||
const MetaFunction *asMetaFunction() const override;
|
||||
const LanguageUtils::FakeMetaMethod &fakeMetaMethod() const;
|
||||
};
|
||||
|
||||
} // namespace QmlJS
|
||||
|
||||
#endif // QMLJS_INTERPRETER_H
|
||||
|
||||
Reference in New Issue
Block a user