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
d89b7ecb
Commit
d89b7ecb
authored
15 years ago
by
Erik Verbruggen
Browse files
Options
Downloads
Patches
Plain Diff
Changed hovering to use the new interpreter & binding code.
Done-with: Roberto Raggi
parent
a104d187
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qmljseditor/qmlhoverhandler.cpp
+20
-1
20 additions, 1 deletion
src/plugins/qmljseditor/qmlhoverhandler.cpp
src/plugins/qmljseditor/qmlhoverhandler.h
+8
-0
8 additions, 0 deletions
src/plugins/qmljseditor/qmlhoverhandler.h
with
28 additions
and
1 deletion
src/plugins/qmljseditor/qmlhoverhandler.cpp
+
20
−
1
View file @
d89b7ecb
...
...
@@ -202,7 +202,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
Interpreter
::
ObjectValue
*
scope
=
bind
(
declaringMember
);
Check
check
(
&
interp
);
const
Interpreter
::
Value
*
value
=
check
(
expression
,
scope
);
m_toolTip
=
interp
.
typeId
(
value
);
m_toolTip
=
prettyPrint
(
value
,
&
interp
);
#if 0
QmlLookupContext context(expressionUnderCursor.expressionScopes(), doc, m_modelManager->snapshot(), typeSystem);
...
...
@@ -241,3 +241,22 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
m_toolTip
=
QString
(
QLatin1String
(
"<nobr>No help available for
\"
%1
\"
"
)).
arg
(
symbolName
);
}
}
QString
QmlHoverHandler
::
prettyPrint
(
const
QmlJS
::
Interpreter
::
Value
*
value
,
QmlJS
::
Interpreter
::
Engine
*
interp
)
const
{
if
(
!
value
)
return
QString
();
if
(
const
Interpreter
::
ObjectValue
*
objectValue
=
value
->
asObjectValue
())
{
QString
className
=
objectValue
->
className
();
while
(
objectValue
&&
objectValue
->
prototype
()
&&
className
.
isEmpty
())
{
objectValue
=
objectValue
->
prototype
();
className
=
objectValue
->
className
();
}
return
className
;
}
return
interp
->
typeId
(
value
);
}
This diff is collapsed.
Click to expand it.
src/plugins/qmljseditor/qmlhoverhandler.h
+
8
−
0
View file @
d89b7ecb
...
...
@@ -43,6 +43,13 @@ namespace Core {
class
IEditor
;
}
namespace
QmlJS
{
namespace
Interpreter
{
class
Engine
;
class
Value
;
}
}
namespace
TextEditor
{
class
ITextEditor
;
}
...
...
@@ -66,6 +73,7 @@ private slots:
private:
void
updateHelpIdAndTooltip
(
TextEditor
::
ITextEditor
*
editor
,
int
pos
);
QString
prettyPrint
(
const
QmlJS
::
Interpreter
::
Value
*
value
,
QmlJS
::
Interpreter
::
Engine
*
interp
)
const
;
private:
QmlModelManagerInterface
*
m_modelManager
;
...
...
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