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; QImage statePreviewImage(const ModelNode &stateNode) const;
signals:
void qmlPuppetCrashed();
private: // functions private: // functions
NodeInstance rootNodeInstance() const; NodeInstance rootNodeInstance() const;

View File

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

View File

@@ -648,6 +648,7 @@ void DesignModeWidget::setup()
} }
m_nodeInstanceView = new NodeInstanceView(this); m_nodeInstanceView = new NodeInstanceView(this);
connect(m_nodeInstanceView.data(), SIGNAL(qmlPuppetCrashed()), this, SLOT(qmlPuppetCrashed()));
// Sidebar takes ownership // Sidebar takes ownership
m_navigator = new NavigatorView; m_navigator = new NavigatorView;
m_allPropertiesBox = new AllPropertiesBox; m_allPropertiesBox = new AllPropertiesBox;
@@ -773,6 +774,14 @@ void DesignModeWidget::deleteSidebarWidgets()
m_rightSideBar = 0; 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) void DesignModeWidget::resizeEvent(QResizeEvent *event)
{ {
if (m_warningWidget) if (m_warningWidget)

View File

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