QML JS Inspector: Improve warning messages

When a change is done to an element that cannot be changed due to
debugger/qdeclarative limitations, a warning is shown to the user in QML
JS Editor.

Reviewed-by: Olivier Goffart
This commit is contained in:
Lasse Holmstedt
2010-08-05 16:22:30 +02:00
parent 1c2af44ad8
commit 714a266cbe
4 changed files with 104 additions and 29 deletions

View File

@@ -382,7 +382,7 @@ void Delta::update(UiObjectDefinition* oldObject, const QmlJS::Document::Ptr& ol
if (!previousScript || _scriptCode(previousScript, oldDoc) != scriptCode) {
foreach (DebugId ref, debugReferences) {
if (ref != -1)
updateScriptBinding(ref, script, property, scriptCode);
updateScriptBinding(ref, newObject, script, property, scriptCode);
}
}
} else if (UiSourceElement *uiSource = cast<UiSourceElement*>(*it)) {
@@ -393,7 +393,7 @@ void Delta::update(UiObjectDefinition* oldObject, const QmlJS::Document::Ptr& ol
if (!previousSource || _methodCode(previousSource, oldDoc) != methodCode) {
foreach (DebugId ref, debugReferences) {
if (ref != -1)
updateMethodBody(ref, script, methodName, methodCode);
updateMethodBody(ref, newObject, script, methodName, methodCode);
}
}
}
@@ -506,10 +506,10 @@ void Delta::removeObject(int)
{}
void Delta::resetBindingForObject(int, const QString &)
{}
void Delta::updateMethodBody(DebugId, UiScriptBinding *, const QString &, const QString &)
void Delta::updateMethodBody(DebugId, UiObjectDefinition *, UiScriptBinding *, const QString &, const QString &)
{}
void Delta::updateScriptBinding(DebugId, UiScriptBinding *, const QString &, const QString &)
void Delta::updateScriptBinding(DebugId, UiObjectDefinition *, UiScriptBinding *, const QString &, const QString &)
{}
} //namespace QmlJs

View File

@@ -57,10 +57,12 @@ private:
protected:
virtual void updateScriptBinding(DebugId objectReference,
AST::UiObjectDefinition *parentObject,
AST::UiScriptBinding *scriptBinding,
const QString &propertyName,
const QString &scriptCode);
virtual void updateMethodBody(DebugId objectReference,
AST::UiObjectDefinition *parentObject,
AST::UiScriptBinding *scriptBinding,
const QString &methodName,
const QString &methodBody);