QmlDesigner.nodeInstances: show warning if qml pupped crashes

If the qml puppetcrahes 3 times in a row we show a warning.

Reviewed-by: Marco Bubke
This commit is contained in:
Thomas Hartmann
2011-04-13 17:52:17 +02:00
parent 29a544bb68
commit 12a810bb68
4 changed files with 14 additions and 1 deletions

View File

@@ -138,6 +138,9 @@ public:
QImage statePreviewImage(const ModelNode &stateNode) const;
signals:
void qmlPuppetCrashed();
private: // functions
NodeInstance rootNodeInstance() const;

View File

@@ -180,7 +180,7 @@ void NodeInstanceView::handleChrash()
if (elaspsedTimeSinceLastCrash > 2000) {
restartProcess();
} else {
emitCustomNotification("QmlPuppet crashed");
emit qmlPuppetCrashed();
}
}

View File

@@ -648,6 +648,7 @@ void DesignModeWidget::setup()
}
m_nodeInstanceView = new NodeInstanceView(this);
connect(m_nodeInstanceView.data(), SIGNAL(qmlPuppetCrashed()), this, SLOT(qmlPuppetCrashed()));
// Sidebar takes ownership
m_navigator = new NavigatorView;
m_allPropertiesBox = new AllPropertiesBox;
@@ -773,6 +774,14 @@ void DesignModeWidget::deleteSidebarWidgets()
m_rightSideBar = 0;
}
void DesignModeWidget::qmlPuppetCrashed()
{
QList<RewriterView::Error> errorList;
RewriterView::Error error(tr("Qt Quick emulation layer crashed"));
errorList << error;
disable(errorList);
}
void DesignModeWidget::resizeEvent(QResizeEvent *event)
{
if (m_warningWidget)

View File

@@ -154,6 +154,7 @@ private slots:
void updateAvailableSidebarItemsRight();
void deleteSidebarWidgets();
void qmlPuppetCrashed();
protected:
void resizeEvent(QResizeEvent *event);