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

@@ -62,7 +62,6 @@ class QmlJSLiveTextPreview : public QObject
public:
explicit QmlJSLiveTextPreview(const QmlJS::Document::Ptr &doc, const QmlJS::Document::Ptr &initDoc, QObject *parent = 0);
static QmlJS::ModelManagerInterface *modelManager();
//void updateDocuments();
void associateEditor(Core::IEditor *editor);
@@ -71,6 +70,12 @@ public:
void mapObjectToQml(const QDeclarativeDebugObjectReference &object);
void resetInitialDoc(const QmlJS::Document::Ptr &doc);
enum UnsyncronizableChangeType {
NoUnsyncronizableChanges,
AttributeChangeWarning,
ElementChangeWarning
};
signals:
void selectedItemsChanged(const QList<QDeclarativeDebugObjectReference> &objects);
void reloadQmlViewerRequested();
@@ -87,9 +92,11 @@ private slots:
void reloadQmlViewer();
private:
static QmlJS::ModelManagerInterface *modelManager();
QList<int> objectReferencesForOffset(quint32 offset) const;
QVariant castToLiteral(const QString &expression, QmlJS::AST::UiScriptBinding *scriptBinding);
void showSyncWarning(unsigned line, unsigned column);
void showSyncWarning(UnsyncronizableChangeType unsyncronizableChangeType, const QString &elementName,
unsigned line, unsigned column);
void showExperimentalWarning();
private: