forked from qt-creator/qt-creator
Show the generated slots in the completion box for the attached property `Keys'.
This commit is contained in:
@@ -158,11 +158,13 @@ class EnumerateProperties: private Interpreter::MemberProcessor
|
|||||||
QHash<QString, const Interpreter::Value *> _properties;
|
QHash<QString, const Interpreter::Value *> _properties;
|
||||||
bool _globalCompletion;
|
bool _globalCompletion;
|
||||||
Interpreter::Context *_context;
|
Interpreter::Context *_context;
|
||||||
|
const Interpreter::ObjectValue *_currentObject;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EnumerateProperties(Interpreter::Context *context)
|
EnumerateProperties(Interpreter::Context *context)
|
||||||
: _globalCompletion(false),
|
: _globalCompletion(false),
|
||||||
_context(context)
|
_context(context),
|
||||||
|
_currentObject(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +177,7 @@ public:
|
|||||||
{
|
{
|
||||||
_processed.clear();
|
_processed.clear();
|
||||||
_properties.clear();
|
_properties.clear();
|
||||||
|
_currentObject = Interpreter::value_cast<const Interpreter::ObjectValue *>(value);
|
||||||
|
|
||||||
enumerateProperties(value);
|
enumerateProperties(value);
|
||||||
|
|
||||||
@@ -185,6 +188,7 @@ public:
|
|||||||
{
|
{
|
||||||
_processed.clear();
|
_processed.clear();
|
||||||
_properties.clear();
|
_properties.clear();
|
||||||
|
_currentObject = 0;
|
||||||
|
|
||||||
foreach (const Interpreter::ObjectValue *scope, _context->scopeChain())
|
foreach (const Interpreter::ObjectValue *scope, _context->scopeChain())
|
||||||
enumerateProperties(scope);
|
enumerateProperties(scope);
|
||||||
@@ -227,8 +231,10 @@ private:
|
|||||||
|
|
||||||
virtual bool processGeneratedSlot(const QString &name, const Interpreter::Value *value)
|
virtual bool processGeneratedSlot(const QString &name, const Interpreter::Value *value)
|
||||||
{
|
{
|
||||||
if (_globalCompletion)
|
if (_globalCompletion || (_currentObject && _currentObject->className().endsWith(QLatin1String("Keys")))) {
|
||||||
|
// ### FIXME: add support for attached properties.
|
||||||
insertProperty(name, value);
|
insertProperty(name, value);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user