Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
1cbee8cd
Commit
1cbee8cd
authored
15 years ago
by
Roberto Raggi
Browse files
Options
Downloads
Patches
Plain Diff
Fixed EnumerateProperties to enumerate properties of the base object.
Done with: ckamm
parent
038b7582
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/qmljseditor/qmlcodecompletion.cpp
+17
-9
17 additions, 9 deletions
src/plugins/qmljseditor/qmlcodecompletion.cpp
with
17 additions
and
9 deletions
src/plugins/qmljseditor/qmlcodecompletion.cpp
+
17
−
9
View file @
1cbee8cd
...
@@ -143,16 +143,24 @@ public:
...
@@ -143,16 +143,24 @@ public:
_globalCompletion
=
globalCompletion
;
_globalCompletion
=
globalCompletion
;
}
}
QHash
<
QString
,
const
Interpreter
::
Value
*>
operator
()(
bool
lookAtScope
=
f
al
s
e
)
QHash
<
QString
,
const
Interpreter
::
Value
*>
operator
()(
const
Interpreter
::
Value
*
v
al
u
e
)
{
{
_processed
.
clear
();
_processed
.
clear
();
_properties
.
clear
();
_properties
.
clear
();
if
(
!
lookAtScope
)
{
enumerateProperties
(
_link
->
scopeChain
().
first
());
enumerateProperties
(
value
);
}
else
{
foreach
(
const
Interpreter
::
ObjectValue
*
scope
,
_link
->
scopeChain
())
return
_properties
;
enumerateProperties
(
scope
);
}
}
QHash
<
QString
,
const
Interpreter
::
Value
*>
operator
()()
{
_processed
.
clear
();
_properties
.
clear
();
foreach
(
const
Interpreter
::
ObjectValue
*
scope
,
_link
->
scopeChain
())
enumerateProperties
(
scope
);
return
_properties
;
return
_properties
;
}
}
...
@@ -650,7 +658,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
...
@@ -650,7 +658,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
// It's a global completion.
// It's a global completion.
EnumerateProperties
enumerateProperties
(
&
link
);
EnumerateProperties
enumerateProperties
(
&
link
);
enumerateProperties
.
setGlobalCompletion
(
true
);
enumerateProperties
.
setGlobalCompletion
(
true
);
QHashIterator
<
QString
,
const
Interpreter
::
Value
*>
it
(
enumerateProperties
(
/* lookAtScope = */
true
));
QHashIterator
<
QString
,
const
Interpreter
::
Value
*>
it
(
enumerateProperties
());
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
it
.
next
();
it
.
next
();
...
@@ -679,7 +687,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
...
@@ -679,7 +687,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
if
(
value
&&
completionOperator
==
QLatin1Char
(
'.'
))
{
// member completion
if
(
value
&&
completionOperator
==
QLatin1Char
(
'.'
))
{
// member completion
EnumerateProperties
enumerateProperties
(
&
link
);
EnumerateProperties
enumerateProperties
(
&
link
);
QHashIterator
<
QString
,
const
Interpreter
::
Value
*>
it
(
enumerateProperties
());
QHashIterator
<
QString
,
const
Interpreter
::
Value
*>
it
(
enumerateProperties
(
value
));
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
it
.
next
();
it
.
next
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment