aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r--src/quick/items/qquickwindow.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 588120a51a..014fb51572 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2675,6 +2675,17 @@ void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item)
}
+bool QQuickWindowPrivate::emitError(QQuickWindow::SceneGraphError error, const QString &msg)
+{
+ Q_Q(QQuickWindow);
+ static const QMetaMethod errorSignal = QMetaMethod::fromSignal(&QQuickWindow::sceneGraphError);
+ if (q->isSignalConnected(errorSignal)) {
+ emit q->sceneGraphError(error, msg);
+ return true;
+ }
+ return false;
+}
+
void QQuickWindow::maybeUpdate()
{
Q_D(QQuickWindow);
@@ -2750,6 +2761,21 @@ QOpenGLContext *QQuickWindow::openglContext() const
*/
/*!
+ \fn void QQuickWindow::sceneGraphError(SceneGraphError error, const QString &message)
+
+ This signal is emitted when an error occurred during scene graph initialization.
+
+ Applications should connect to this signal if they wish to handle errors,
+ like OpenGL context creation failures, in a custom way. When no slot is
+ connected to the signal, the behavior will be different: Quick will print
+ the message, or show a message box, and terminate the application.
+
+ This signal will be emitted from the gui thread.
+
+ \since 5.3
+ */
+
+/*!
\class QQuickCloseEvent
\internal
\since 5.1
@@ -2983,6 +3009,20 @@ QQmlIncubationController *QQuickWindow::incubationController() const
*/
/*!
+ \enum QQuickWindow::SceneGraphError
+
+ This enum describes the error in a sceneGraphError() signal.
+
+ \value ContextNotAvailable OpenGL context creation failed. This typically means that
+ no suitable OpenGL implementation was found, for example because no graphics drivers
+ are installed and so no OpenGL 2 support is present. On mobile and embedded boards
+ that use OpenGL ES such an error is likely to indicate issues in the windowing system
+ integration and possibly an incorrect configuration of Qt.
+
+ \since 5.3
+ */
+
+/*!
\fn void QQuickWindow::beforeSynchronizing()
This signal is emitted before the scene graph is synchronized with the QML state.