Qml JS Live Preview: Show warnings when running Live Preview

Two kinds of warnings are now shown: one for warning about the Live
Preview itself, as it is experimental, and another when user changes
id's of objects during runtime, as this is not supported at the moment.

More warnings will be added later for other unsupported changes.
This commit is contained in:
Lasse Holmstedt
2010-07-30 15:28:05 +02:00
parent 07ac6bcaa4
commit 2c15b30a20
8 changed files with 104 additions and 3 deletions

View File

@@ -73,6 +73,8 @@ public:
signals:
void selectedItemsChanged(const QList<QDeclarativeDebugObjectReference> &objects);
void reloadQmlViewerRequested();
void disableLivePreviewRequested();
public slots:
void setApplyChangesToQmlObserver(bool applyChanges);
@@ -81,11 +83,14 @@ public slots:
private slots:
void changeSelectedElements(QList<int> offsets, const QString &wordAtCursor);
void documentChanged(QmlJS::Document::Ptr doc);
void disableLivePreview();
void reloadQmlViewer();
private:
QList<int> objectReferencesForOffset(quint32 offset) const;
QVariant castToLiteral(const QString &expression, QmlJS::AST::UiScriptBinding *scriptBinding);
void showSyncWarning(unsigned line, unsigned column);
void showExperimentalWarning();
private:
QHash<QmlJS::AST::UiObjectMember*, QList<int> > m_debugIds;