aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/welcome
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-03-05 11:52:24 +0100
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-03-06 08:14:23 +0100
commitbf75e5c08565106a24c804196f92aa8c6999bb74 (patch)
tree8665570e29746bf3e8ae2c3dc1aaaa658a80b0a1 /src/plugins/welcome
parent8d6e3d22a9bac6022e8158f935c4be3e875b5b82 (diff)
Add GL error handling to welcome page.
Handle the sceneGraphError() so that the application does not crash. ==[ Subject: One line only short meaningful description for logs ]===| Change-Id: I04e7e92d78795969f5686709522edfc6004cd932 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/plugins/welcome')
-rw-r--r--src/plugins/welcome/welcomeplugin.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index 37297cde4e6..88a7d569d14 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -50,6 +50,7 @@
#include <QDesktopServices>
#include <QPainter>
#include <QVBoxLayout>
+#include <QMessageBox>
#include <QCoreApplication>
#include <QDir>
@@ -116,6 +117,9 @@ signals:
private slots:
void welcomePluginAdded(QObject*);
+#if QT_VERSION >= 0x050300
+ void sceneGraphError(QQuickWindow::SceneGraphError, const QString &message);
+#endif
private:
void facilitateQml(QQmlEngine *engine);
@@ -144,6 +148,10 @@ WelcomeMode::WelcomeMode() :
setContext(Core::Context(Core::Constants::C_WELCOME_MODE));
m_welcomePage = new QQuickView;
+#if QT_VERSION >= 0x050300
+ connect(m_welcomePage, SIGNAL(sceneGraphError(QQuickWindow::SceneGraphError,QString)),
+ this, SLOT(sceneGraphError(QQuickWindow::SceneGraphError,QString)));
+#endif // Qt 5.3
m_welcomePage->setObjectName(QLatin1String("WelcomePage"));
m_welcomePage->setResizeMode(QQuickView::SizeRootObjectToView);
@@ -187,6 +195,19 @@ WelcomeMode::~WelcomeMode()
delete m_networkAccessManagerFactory;
}
+#if QT_VERSION >= 0x050300
+void WelcomeMode::sceneGraphError(QQuickWindow::SceneGraphError, const QString &message)
+{
+ QMessageBox *messageBox =
+ new QMessageBox(QMessageBox::Warning,
+ tr("Welcome Mode Load Error"), message,
+ QMessageBox::Close, m_modeWidget);
+ messageBox->setModal(false);
+ messageBox->setAttribute(Qt::WA_DeleteOnClose);
+ messageBox->show();
+}
+#endif // Qt 5.3
+
bool sortFunction(Utils::IWelcomePage * a, Utils::IWelcomePage *b)
{
return a->priority() < b->priority();