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
Marco Bubke
flatpak-qt-creator
Commits
265118eb
Commit
265118eb
authored
Feb 17, 2010
by
Christian Kamm
Browse files
Add the onNameChanged signals that Qml properties generate implicitly.
parent
1f411118
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljsinterpreter.cpp
View file @
265118eb
...
...
@@ -2026,11 +2026,14 @@ bool ASTObjectValue::getSourceLocation(QString *fileName, int *line, int *column
void
ASTObjectValue
::
processMembers
(
MemberProcessor
*
processor
)
const
{
foreach
(
ASTPropertyReference
*
ref
,
_properties
)
foreach
(
ASTPropertyReference
*
ref
,
_properties
)
{
processor
->
processProperty
(
ref
->
ast
()
->
name
->
asString
(),
ref
);
// ### Should get a different value?
processor
->
processGeneratedSlot
(
ref
->
onChangedSlotName
(),
ref
);
}
foreach
(
ASTSignalReference
*
ref
,
_signals
)
{
// ### These two should get different values?
processor
->
processSignal
(
ref
->
ast
()
->
name
->
asString
(),
ref
);
// ### Should get a different value?
processor
->
processGeneratedSlot
(
ref
->
slotName
(),
ref
);
}
...
...
@@ -2125,6 +2128,11 @@ const Value *QmlPrototypeReference::value(Context *context) const
ASTPropertyReference
::
ASTPropertyReference
(
UiPublicMember
*
ast
,
const
QmlJS
::
Document
*
doc
,
Engine
*
engine
)
:
Reference
(
engine
),
_ast
(
ast
),
_doc
(
doc
)
{
const
QString
propertyName
=
ast
->
name
->
asString
();
_onChangedSlotName
=
QLatin1String
(
"on"
);
_onChangedSlotName
+=
propertyName
.
at
(
0
).
toUpper
();
_onChangedSlotName
+=
propertyName
.
midRef
(
1
);
_onChangedSlotName
+=
QLatin1String
(
"Changed"
);
}
ASTPropertyReference
::~
ASTPropertyReference
()
...
...
src/libs/qmljs/qmljsinterpreter.h
View file @
265118eb
...
...
@@ -685,12 +685,14 @@ class QMLJS_EXPORT ASTPropertyReference: public Reference
{
AST
::
UiPublicMember
*
_ast
;
const
Document
*
_doc
;
QString
_onChangedSlotName
;
public:
ASTPropertyReference
(
AST
::
UiPublicMember
*
ast
,
const
Document
*
doc
,
Engine
*
engine
);
virtual
~
ASTPropertyReference
();
AST
::
UiPublicMember
*
ast
()
const
{
return
_ast
;
}
QString
onChangedSlotName
()
const
{
return
_onChangedSlotName
;
}
virtual
bool
getSourceLocation
(
QString
*
fileName
,
int
*
line
,
int
*
column
)
const
;
virtual
const
Value
*
value
(
Context
*
context
)
const
;
...
...
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