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
d63199ca
Commit
d63199ca
authored
14 years ago
by
Thomas Hartmann
Committed by
Christian Kamm
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
QmlJS: Resolve property types within package.
Reviewed-by: Christian Kamm
parent
806c8a56
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/libs/qmljs/qmljsinterpreter.cpp
+17
-2
17 additions, 2 deletions
src/libs/qmljs/qmljsinterpreter.cpp
src/libs/qmljs/qmljsinterpreter.h
+3
-1
3 additions, 1 deletion
src/libs/qmljs/qmljsinterpreter.h
with
20 additions
and
3 deletions
src/libs/qmljs/qmljsinterpreter.cpp
+
17
−
2
View file @
d63199ca
...
...
@@ -858,8 +858,12 @@ const Value *QmlObjectValue::propertyValue(const FakeMetaProperty &prop) const
// ### Verify type resolving.
QmlObjectValue
*
objectValue
=
engine
()
->
cppQmlTypes
().
typeForImport
(
typeName
);
if
(
objectValue
)
if
(
objectValue
)
{
QString
packageClassName
=
objectValue
->
nameInPackage
(
packageName
());
if
(
!
packageClassName
.
isEmpty
())
objectValue
=
engine
()
->
cppQmlTypes
().
typeForImport
(
packageName
()
+
'.'
+
packageClassName
);
return
objectValue
;
}
const
Value
*
value
=
engine
()
->
undefinedValue
();
if
(
typeName
==
QLatin1String
(
"QByteArray"
)
...
...
@@ -910,6 +914,14 @@ const Value *QmlObjectValue::propertyValue(const FakeMetaProperty &prop) const
QString
QmlObjectValue
::
packageName
()
const
{
return
_packageName
;
}
QString
QmlObjectValue
::
nameInPackage
(
const
QString
&
packageName
)
const
{
foreach
(
const
FakeMetaObject
::
Export
&
exp
,
_metaObject
->
exports
())
if
(
exp
.
package
==
packageName
)
return
exp
.
type
;
return
QString
();
}
QmlJS
::
ComponentVersion
QmlObjectValue
::
version
()
const
{
return
_componentVersion
;
}
...
...
@@ -2190,7 +2202,8 @@ QList<QmlObjectValue *> CppQmlTypes::typesForImport(const QString &packageName,
return
objectValuesByName
.
values
();
}
QmlObjectValue
*
CppQmlTypes
::
typeForImport
(
const
QString
&
qualifiedName
)
const
QmlObjectValue
*
CppQmlTypes
::
typeForImport
(
const
QString
&
qualifiedName
,
QmlJS
::
ComponentVersion
version
)
const
{
QString
name
=
qualifiedName
;
QString
packageName
;
...
...
@@ -2205,6 +2218,8 @@ QmlObjectValue *CppQmlTypes::typeForImport(const QString &qualifiedName) const
const
QString
typeName
=
qmlObjectValue
->
className
();
if
(
typeName
!=
name
)
continue
;
if
(
version
.
isValid
()
&&
version
<
qmlObjectValue
->
version
())
continue
;
if
(
previousCandidate
)
{
// check if our new candidate is newer than the one we found previously
...
...
This diff is collapsed.
Click to expand it.
src/libs/qmljs/qmljsinterpreter.h
+
3
−
1
View file @
d63199ca
...
...
@@ -420,6 +420,7 @@ public:
const
Value
*
propertyValue
(
const
FakeMetaProperty
&
prop
)
const
;
QString
packageName
()
const
;
QString
nameInPackage
(
const
QString
&
packageName
)
const
;
ComponentVersion
version
()
const
;
QString
defaultPropertyName
()
const
;
QString
propertyType
(
const
QString
&
propertyName
)
const
;
...
...
@@ -563,7 +564,8 @@ public:
void
load
(
Interpreter
::
Engine
*
interpreter
,
const
QList
<
const
FakeMetaObject
*>
&
objects
);
QList
<
Interpreter
::
QmlObjectValue
*>
typesForImport
(
const
QString
&
prefix
,
ComponentVersion
version
)
const
;
Interpreter
::
QmlObjectValue
*
typeForImport
(
const
QString
&
qualifiedName
)
const
;
Interpreter
::
QmlObjectValue
*
typeForImport
(
const
QString
&
qualifiedName
,
ComponentVersion
version
=
ComponentVersion
())
const
;
bool
hasPackage
(
const
QString
&
package
)
const
;
...
...
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