Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
d61cca8e
Commit
d61cca8e
authored
Feb 10, 2010
by
Roberto Raggi
Browse files
Show the generated slots in the completion box for the attached property `Keys'.
parent
4d7444e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljseditor/qmlcodecompletion.cpp
View file @
d61cca8e
...
...
@@ -158,11 +158,13 @@ class EnumerateProperties: private Interpreter::MemberProcessor
QHash
<
QString
,
const
Interpreter
::
Value
*>
_properties
;
bool
_globalCompletion
;
Interpreter
::
Context
*
_context
;
const
Interpreter
::
ObjectValue
*
_currentObject
;
public:
EnumerateProperties
(
Interpreter
::
Context
*
context
)
:
_globalCompletion
(
false
),
_context
(
context
)
_context
(
context
),
_currentObject
(
0
)
{
}
...
...
@@ -175,6 +177,7 @@ public:
{
_processed
.
clear
();
_properties
.
clear
();
_currentObject
=
Interpreter
::
value_cast
<
const
Interpreter
::
ObjectValue
*>
(
value
);
enumerateProperties
(
value
);
...
...
@@ -185,6 +188,7 @@ public:
{
_processed
.
clear
();
_properties
.
clear
();
_currentObject
=
0
;
foreach
(
const
Interpreter
::
ObjectValue
*
scope
,
_context
->
scopeChain
())
enumerateProperties
(
scope
);
...
...
@@ -227,8 +231,10 @@ private:
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
);
}
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment