forked from qt-creator/qt-creator
QML Observer: Refresh debug id's when new objects are created
Previously, the user had to navigate to the context of a qml item in order to edit its source code in Live Preview mode. This change tells the client to update when new objects are created on server-side, and makes the editing possible without having to manually trigger updates.
This commit is contained in:
@@ -72,6 +72,7 @@ public:
|
|||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void selectedColorChanged(const QColor &color);
|
void selectedColorChanged(const QColor &color);
|
||||||
void contextPathUpdated(const QStringList &contextPath);
|
void contextPathUpdated(const QStringList &contextPath);
|
||||||
|
void sceneItemCountChanged();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void currentObjectsChanged(const QList<QObject*> &objects);
|
void currentObjectsChanged(const QList<QObject*> &objects);
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ protected:
|
|||||||
void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent *event);
|
||||||
|
|
||||||
void setSelectedItemsForTools(QList<QGraphicsItem *> items);
|
void setSelectedItemsForTools(QList<QGraphicsItem *> items);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(QDeclarativeDesignView)
|
Q_DISABLE_COPY(QDeclarativeDesignView)
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_reloadView())
|
Q_PRIVATE_SLOT(d_func(), void _q_reloadView())
|
||||||
@@ -109,6 +110,8 @@ private:
|
|||||||
Q_PRIVATE_SLOT(d_func(), void _q_changeToColorPickerTool())
|
Q_PRIVATE_SLOT(d_func(), void _q_changeToColorPickerTool())
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_changeContextPathIndex(int index))
|
Q_PRIVATE_SLOT(d_func(), void _q_changeContextPathIndex(int index))
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_clearComponentCache());
|
Q_PRIVATE_SLOT(d_func(), void _q_clearComponentCache());
|
||||||
|
Q_PRIVATE_SLOT(d_func(), void _q_sceneChanged(const QList<QRectF> &areas));
|
||||||
|
Q_PRIVATE_SLOT(d_func(), void _q_checkSceneItemCount());
|
||||||
|
|
||||||
inline QDeclarativeDesignViewPrivate *d_func() { return data.data(); }
|
inline QDeclarativeDesignViewPrivate *d_func() { return data.data(); }
|
||||||
QScopedPointer<QDeclarativeDesignViewPrivate> data;
|
QScopedPointer<QDeclarativeDesignViewPrivate> data;
|
||||||
|
|||||||
@@ -170,6 +170,16 @@ void QDeclarativeDesignDebugServer::contextPathUpdated(const QStringList &contex
|
|||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QDeclarativeDesignDebugServer::sceneItemCountChanged()
|
||||||
|
{
|
||||||
|
QByteArray message;
|
||||||
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
ds << QByteArray("SCENE_ITEM_COUNT_CHANGED");
|
||||||
|
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
QString QDeclarativeDesignDebugServer::idStringForObject(QObject *obj) const
|
QString QDeclarativeDesignDebugServer::idStringForObject(QObject *obj) const
|
||||||
{
|
{
|
||||||
int id = idForObject(obj);
|
int id = idForObject(obj);
|
||||||
|
|||||||
@@ -52,6 +52,9 @@
|
|||||||
|
|
||||||
namespace QmlViewer {
|
namespace QmlViewer {
|
||||||
|
|
||||||
|
const int SceneChangeUpdateInterval = 5000;
|
||||||
|
const int MaxSceneChangedTimerRestartCount = (SceneChangeUpdateInterval / 100);
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(QDeclarativeDesignDebugServer, qmlDesignDebugServer)
|
Q_GLOBAL_STATIC(QDeclarativeDesignDebugServer, qmlDesignDebugServer)
|
||||||
|
|
||||||
QDeclarativeDesignViewPrivate::QDeclarativeDesignViewPrivate(QDeclarativeDesignView *q) :
|
QDeclarativeDesignViewPrivate::QDeclarativeDesignViewPrivate(QDeclarativeDesignView *q) :
|
||||||
@@ -59,9 +62,11 @@ QDeclarativeDesignViewPrivate::QDeclarativeDesignViewPrivate(QDeclarativeDesignV
|
|||||||
designModeBehavior(false),
|
designModeBehavior(false),
|
||||||
executionPaused(false),
|
executionPaused(false),
|
||||||
slowdownFactor(1.0f),
|
slowdownFactor(1.0f),
|
||||||
toolbar(0)
|
toolbar(0),
|
||||||
|
sceneChangedTimerRestartCount(0)
|
||||||
{
|
{
|
||||||
|
sceneChangedTimer.setInterval(SceneChangeUpdateInterval);
|
||||||
|
sceneChangedTimer.setSingleShot(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeclarativeDesignViewPrivate::~QDeclarativeDesignViewPrivate()
|
QDeclarativeDesignViewPrivate::~QDeclarativeDesignViewPrivate()
|
||||||
@@ -79,6 +84,7 @@ QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) :
|
|||||||
data->subcomponentEditorTool = new SubcomponentEditorTool(this);
|
data->subcomponentEditorTool = new SubcomponentEditorTool(this);
|
||||||
data->currentTool = data->selectionTool;
|
data->currentTool = data->selectionTool;
|
||||||
|
|
||||||
|
connect(scene(), SIGNAL(changed(QList<QRectF>)), SLOT(_q_sceneChanged(QList<QRectF>)));
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|
||||||
connect(qmlDesignDebugServer(), SIGNAL(designModeBehaviorChanged(bool)), SLOT(setDesignModeBehavior(bool)));
|
connect(qmlDesignDebugServer(), SIGNAL(designModeBehaviorChanged(bool)), SLOT(setDesignModeBehavior(bool)));
|
||||||
@@ -107,6 +113,8 @@ QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) :
|
|||||||
connect(data->subcomponentEditorTool, SIGNAL(contextPopped()), SIGNAL(inspectorContextPopped()));
|
connect(data->subcomponentEditorTool, SIGNAL(contextPopped()), SIGNAL(inspectorContextPopped()));
|
||||||
connect(data->subcomponentEditorTool, SIGNAL(contextPathChanged(QStringList)), qmlDesignDebugServer(), SLOT(contextPathUpdated(QStringList)));
|
connect(data->subcomponentEditorTool, SIGNAL(contextPathChanged(QStringList)), qmlDesignDebugServer(), SLOT(contextPathUpdated(QStringList)));
|
||||||
|
|
||||||
|
connect(&(data->sceneChangedTimer), SIGNAL(timeout()), SLOT(_q_checkSceneItemCount()));
|
||||||
|
|
||||||
data->createToolbar();
|
data->createToolbar();
|
||||||
|
|
||||||
data->_q_changeToSingleSelectTool();
|
data->_q_changeToSingleSelectTool();
|
||||||
@@ -523,6 +531,59 @@ void QDeclarativeDesignViewPrivate::_q_changeContextPathIndex(int index)
|
|||||||
subcomponentEditorTool->setContext(index);
|
subcomponentEditorTool->setContext(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QDeclarativeDesignViewPrivate::_q_sceneChanged(const QList<QRectF> & /*areas*/)
|
||||||
|
{
|
||||||
|
if (designModeBehavior)
|
||||||
|
return;
|
||||||
|
|
||||||
|
sceneChangedTimerRestartCount++;
|
||||||
|
if (sceneChangedTimerRestartCount == MaxSceneChangedTimerRestartCount) {
|
||||||
|
sceneChangedTimerRestartCount = 0;
|
||||||
|
_q_checkSceneItemCount();
|
||||||
|
}
|
||||||
|
sceneChangedTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QDeclarativeDesignViewPrivate::_q_checkSceneItemCount()
|
||||||
|
{
|
||||||
|
bool hasNewItems = hasNewGraphicsObjects(q->rootObject());
|
||||||
|
|
||||||
|
if (hasNewItems) {
|
||||||
|
qmlDesignDebugServer()->sceneItemCountChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool hasNewGraphicsObjectsRecur(QGraphicsObject *object,
|
||||||
|
QSet<QGraphicsObject *> &newItems,
|
||||||
|
const QSet<QGraphicsObject *> &previousItems)
|
||||||
|
{
|
||||||
|
bool hasNew = false;
|
||||||
|
|
||||||
|
newItems << object;
|
||||||
|
|
||||||
|
foreach(QGraphicsItem *item, object->childItems()) {
|
||||||
|
QGraphicsObject *gfxObject = item->toGraphicsObject();
|
||||||
|
if (gfxObject) {
|
||||||
|
newItems << gfxObject;
|
||||||
|
|
||||||
|
hasNew = hasNewGraphicsObjectsRecur(gfxObject, newItems, previousItems) || hasNew;
|
||||||
|
if (!previousItems.contains(gfxObject))
|
||||||
|
hasNew = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QDeclarativeDesignViewPrivate::hasNewGraphicsObjects(QGraphicsObject *object)
|
||||||
|
{
|
||||||
|
QSet<QGraphicsObject *> newItems;
|
||||||
|
bool ret = hasNewGraphicsObjectsRecur(object, newItems, sceneGraphicsObjects);
|
||||||
|
sceneGraphicsObjects = newItems;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void QDeclarativeDesignView::changeAnimationSpeed(qreal slowdownFactor)
|
void QDeclarativeDesignView::changeAnimationSpeed(qreal slowdownFactor)
|
||||||
{
|
{
|
||||||
data->slowdownFactor = slowdownFactor;
|
data->slowdownFactor = slowdownFactor;
|
||||||
@@ -613,6 +674,8 @@ void QDeclarativeDesignViewPrivate::_q_onStatusChanged(QDeclarativeView::Status
|
|||||||
{
|
{
|
||||||
if (status == QDeclarativeView::Ready) {
|
if (status == QDeclarativeView::Ready) {
|
||||||
if (q->rootObject()) {
|
if (q->rootObject()) {
|
||||||
|
sceneChangedTimerRestartCount = 0;
|
||||||
|
hasNewGraphicsObjects(q->rootObject());
|
||||||
if (subcomponentEditorTool->contextIndex() != -1)
|
if (subcomponentEditorTool->contextIndex() != -1)
|
||||||
subcomponentEditorTool->clear();
|
subcomponentEditorTool->clear();
|
||||||
subcomponentEditorTool->pushContext(q->rootObject());
|
subcomponentEditorTool->pushContext(q->rootObject());
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <QWeakPointer>
|
#include <QWeakPointer>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "qdeclarativedesignview.h"
|
#include "qdeclarativedesignview.h"
|
||||||
|
|
||||||
@@ -82,6 +83,9 @@ public:
|
|||||||
qreal slowdownFactor;
|
qreal slowdownFactor;
|
||||||
|
|
||||||
QmlToolbar *toolbar;
|
QmlToolbar *toolbar;
|
||||||
|
int sceneChangedTimerRestartCount;
|
||||||
|
QTimer sceneChangedTimer;
|
||||||
|
QSet<QGraphicsObject *> sceneGraphicsObjects;
|
||||||
|
|
||||||
void clearEditorItems();
|
void clearEditorItems();
|
||||||
void createToolbar();
|
void createToolbar();
|
||||||
@@ -93,6 +97,7 @@ public:
|
|||||||
QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
|
QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
|
||||||
QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
|
QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
|
||||||
|
|
||||||
|
bool hasNewGraphicsObjects(QGraphicsObject *object);
|
||||||
|
|
||||||
void setSelectedItemsForTools(QList<QGraphicsItem *> items);
|
void setSelectedItemsForTools(QList<QGraphicsItem *> items);
|
||||||
void setSelectedItems(QList<QGraphicsItem *> items);
|
void setSelectedItems(QList<QGraphicsItem *> items);
|
||||||
@@ -124,6 +129,9 @@ public:
|
|||||||
void _q_changeToColorPickerTool();
|
void _q_changeToColorPickerTool();
|
||||||
void _q_changeContextPathIndex(int index);
|
void _q_changeContextPathIndex(int index);
|
||||||
void _q_clearComponentCache();
|
void _q_clearComponentCache();
|
||||||
|
void _q_sceneChanged(const QList<QRectF> &areas);
|
||||||
|
void _q_changeDebugObjectCount(int objectCount);
|
||||||
|
void _q_checkSceneItemCount();
|
||||||
|
|
||||||
static QDeclarativeDesignViewPrivate *get(QDeclarativeDesignView *v) { return v->d_func(); }
|
static QDeclarativeDesignViewPrivate *get(QDeclarativeDesignView *v) { return v->d_func(); }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ bool ClientProxy::connectToViewer(const QString &host, quint16 port)
|
|||||||
SIGNAL(selectedColorChanged(QColor)), this, SIGNAL(selectedColorChanged(QColor)));
|
SIGNAL(selectedColorChanged(QColor)), this, SIGNAL(selectedColorChanged(QColor)));
|
||||||
disconnect(m_designClient,
|
disconnect(m_designClient,
|
||||||
SIGNAL(contextPathUpdated(QStringList)), this, SIGNAL(contextPathUpdated(QStringList)));
|
SIGNAL(contextPathUpdated(QStringList)), this, SIGNAL(contextPathUpdated(QStringList)));
|
||||||
|
disconnect(m_designClient,
|
||||||
|
SIGNAL(treeRefreshRequested()), this, SLOT(refreshObjectTree()));
|
||||||
|
|
||||||
emit aboutToDisconnect();
|
emit aboutToDisconnect();
|
||||||
|
|
||||||
@@ -229,8 +231,8 @@ void ClientProxy::connectionStateChanged()
|
|||||||
SIGNAL(designModeBehaviorChanged(bool)), SIGNAL(designModeBehaviorChanged(bool)));
|
SIGNAL(designModeBehaviorChanged(bool)), SIGNAL(designModeBehaviorChanged(bool)));
|
||||||
connect(m_designClient, SIGNAL(reloaded()), this, SIGNAL(serverReloaded()));
|
connect(m_designClient, SIGNAL(reloaded()), this, SIGNAL(serverReloaded()));
|
||||||
connect(m_designClient, SIGNAL(selectedColorChanged(QColor)), SIGNAL(selectedColorChanged(QColor)));
|
connect(m_designClient, SIGNAL(selectedColorChanged(QColor)), SIGNAL(selectedColorChanged(QColor)));
|
||||||
connect(m_designClient,
|
connect(m_designClient, SIGNAL(contextPathUpdated(QStringList)), SIGNAL(contextPathUpdated(QStringList)));
|
||||||
SIGNAL(contextPathUpdated(QStringList)), SIGNAL(contextPathUpdated(QStringList)));
|
connect(m_designClient, SIGNAL(treeRefreshRequested()), SLOT(refreshObjectTree()));
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) new DebuggerClient(m_conn);
|
(void) new DebuggerClient(m_conn);
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ public:
|
|||||||
QList<QDeclarativeDebugObjectReference> objectReferences(const QUrl &url = QUrl()) const;
|
QList<QDeclarativeDebugObjectReference> objectReferences(const QUrl &url = QUrl()) const;
|
||||||
QDeclarativeDebugObjectReference objectReferenceForId(int debugId) const;
|
QDeclarativeDebugObjectReference objectReferenceForId(int debugId) const;
|
||||||
QDeclarativeDebugObjectReference rootObjectReference() const;
|
QDeclarativeDebugObjectReference rootObjectReference() const;
|
||||||
void refreshObjectTree();
|
|
||||||
|
|
||||||
bool isConnected() const;
|
bool isConnected() const;
|
||||||
bool isUnconnected() const;
|
bool isUnconnected() const;
|
||||||
@@ -97,6 +96,7 @@ signals:
|
|||||||
void contextPathUpdated(const QStringList &contextPath);
|
void contextPathUpdated(const QStringList &contextPath);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void refreshObjectTree();
|
||||||
void queryEngineContext(int id);
|
void queryEngineContext(int id);
|
||||||
void reloadQmlViewer();
|
void reloadQmlViewer();
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ void QmlJSDesignDebugClient::messageReceived(const QByteArray &message)
|
|||||||
QStringList contextPath;
|
QStringList contextPath;
|
||||||
ds >> contextPath;
|
ds >> contextPath;
|
||||||
emit contextPathUpdated(contextPath);
|
emit contextPathUpdated(contextPath);
|
||||||
|
} else if (type == "SCENE_ITEM_COUNT_CHANGED") {
|
||||||
|
emit treeRefreshRequested();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ signals:
|
|||||||
void designModeBehaviorChanged(bool inDesignMode);
|
void designModeBehaviorChanged(bool inDesignMode);
|
||||||
void reloaded(); // the server has reloaded the document
|
void reloaded(); // the server has reloaded the document
|
||||||
void contextPathUpdated(const QStringList &path);
|
void contextPathUpdated(const QStringList &path);
|
||||||
|
void treeRefreshRequested(); // scene has some new items
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void messageReceived(const QByteArray &);
|
virtual void messageReceived(const QByteArray &);
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool Inspector::m_showExperimentalWarning = true;
|
bool Inspector::m_showExperimentalWarning = true;
|
||||||
|
Inspector *Inspector::m_instance = 0;
|
||||||
|
|
||||||
Inspector::Inspector(QObject *parent)
|
Inspector::Inspector(QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
@@ -126,10 +127,11 @@ Inspector::Inspector(QObject *parent)
|
|||||||
m_cppDebuggerState(0),
|
m_cppDebuggerState(0),
|
||||||
m_simultaneousCppAndQmlDebugMode(false),
|
m_simultaneousCppAndQmlDebugMode(false),
|
||||||
m_debugMode(StandaloneMode),
|
m_debugMode(StandaloneMode),
|
||||||
m_listeningToEditorManager(false)
|
m_listeningToEditorManager(false),
|
||||||
|
m_debugProject(0)
|
||||||
{
|
{
|
||||||
m_clientProxy = ClientProxy::instance();
|
m_clientProxy = ClientProxy::instance();
|
||||||
|
m_instance = this;
|
||||||
//#warning set up the context widget
|
//#warning set up the context widget
|
||||||
QWidget *contextWidget = 0;
|
QWidget *contextWidget = 0;
|
||||||
m_context = new InspectorContext(contextWidget);
|
m_context = new InspectorContext(contextWidget);
|
||||||
@@ -162,6 +164,7 @@ void Inspector::disconnectWidgets()
|
|||||||
|
|
||||||
void Inspector::disconnected()
|
void Inspector::disconnected()
|
||||||
{
|
{
|
||||||
|
m_debugProject = 0;
|
||||||
resetViews();
|
resetViews();
|
||||||
updateMenuActions();
|
updateMenuActions();
|
||||||
applyChangesToQmlObserverHelper(false);
|
applyChangesToQmlObserverHelper(false);
|
||||||
@@ -321,6 +324,11 @@ void Inspector::startQmlProjectDebugger()
|
|||||||
m_connectionTimer->start();
|
m_connectionTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Inspector::currentDebugProjectRemoved()
|
||||||
|
{
|
||||||
|
m_debugProject = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void Inspector::resetViews()
|
void Inspector::resetViews()
|
||||||
{
|
{
|
||||||
m_crumblePath->updateContextPath(QStringList());
|
m_crumblePath->updateContextPath(QStringList());
|
||||||
@@ -490,6 +498,8 @@ Debugger::DebuggerRunControl *Inspector::createDebuggerRunControl(ProjectExplore
|
|||||||
|
|
||||||
void Inspector::connected(QDeclarativeEngineDebug *client)
|
void Inspector::connected(QDeclarativeEngineDebug *client)
|
||||||
{
|
{
|
||||||
|
m_debugProject = ProjectExplorer::ProjectExplorerPlugin::instance()->startupProject();
|
||||||
|
connect(m_debugProject, SIGNAL(destroyed()), SLOT(currentDebugProjectRemoved()));
|
||||||
m_client = client;
|
m_client = client;
|
||||||
resetViews();
|
resetViews();
|
||||||
}
|
}
|
||||||
@@ -661,6 +671,16 @@ void Inspector::setShowExperimentalWarning(bool value)
|
|||||||
m_showExperimentalWarning = value;
|
m_showExperimentalWarning = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Inspector *Inspector::instance()
|
||||||
|
{
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::Project *Inspector::debugProject() const
|
||||||
|
{
|
||||||
|
return m_debugProject;
|
||||||
|
}
|
||||||
|
|
||||||
void Inspector::setApplyChangesToQmlObserver(bool applyChanges)
|
void Inspector::setApplyChangesToQmlObserver(bool applyChanges)
|
||||||
{
|
{
|
||||||
emit livePreviewActivated(applyChanges);
|
emit livePreviewActivated(applyChanges);
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ public:
|
|||||||
Inspector(QObject *parent = 0);
|
Inspector(QObject *parent = 0);
|
||||||
virtual ~Inspector();
|
virtual ~Inspector();
|
||||||
|
|
||||||
|
|
||||||
bool connectToViewer(); // using host, port from widgets
|
bool connectToViewer(); // using host, port from widgets
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
@@ -98,7 +97,10 @@ public:
|
|||||||
bool isLiteralValue);
|
bool isLiteralValue);
|
||||||
static bool showExperimentalWarning();
|
static bool showExperimentalWarning();
|
||||||
static void setShowExperimentalWarning(bool value);
|
static void setShowExperimentalWarning(bool value);
|
||||||
|
static Inspector *instance();
|
||||||
|
|
||||||
|
// returns the project being currently debugged, or 0 if not debugging anything
|
||||||
|
ProjectExplorer::Project *debugProject() const;
|
||||||
void createDockWidgets();
|
void createDockWidgets();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -134,6 +136,9 @@ private slots:
|
|||||||
|
|
||||||
void disableLivePreview();
|
void disableLivePreview();
|
||||||
void crumblePathElementClicked(int);
|
void crumblePathElementClicked(int);
|
||||||
|
|
||||||
|
void currentDebugProjectRemoved();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Debugger::DebuggerRunControl *createDebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
|
Debugger::DebuggerRunControl *createDebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
|
||||||
const QString &executableFile = QString(),
|
const QString &executableFile = QString(),
|
||||||
@@ -174,6 +179,9 @@ private:
|
|||||||
// Qml/JS integration
|
// Qml/JS integration
|
||||||
QHash<QString, QmlJSLiveTextPreview *> m_textPreviews;
|
QHash<QString, QmlJSLiveTextPreview *> m_textPreviews;
|
||||||
QmlJS::Snapshot m_loadedSnapshot; //the snapshot loaded by the viewer
|
QmlJS::Snapshot m_loadedSnapshot; //the snapshot loaded by the viewer
|
||||||
|
ProjectExplorer::Project *m_debugProject;
|
||||||
|
|
||||||
|
static Inspector *m_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
#include <qmljs/qmljsdelta.h>
|
#include <qmljs/qmljsdelta.h>
|
||||||
#include <qmljs/parser/qmljsast_p.h>
|
#include <qmljs/parser/qmljsast_p.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
@@ -532,6 +534,12 @@ void QmlJSLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc)
|
|||||||
if (!core->hasContext(dbgcontext))
|
if (!core->hasContext(dbgcontext))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (ProjectExplorer::Project *debugProject = Inspector::instance()->debugProject()) {
|
||||||
|
QStringList files = debugProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
|
||||||
|
if (!files.contains(doc->fileName()))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool experimentalWarningShown = false;
|
bool experimentalWarningShown = false;
|
||||||
|
|
||||||
if (m_applyChangesToQmlObserver) {
|
if (m_applyChangesToQmlObserver) {
|
||||||
|
|||||||
Reference in New Issue
Block a user