diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quick/openglunderqml/main.qml | 2 | ||||
-rw-r--r-- | examples/quick/openglunderqml/squircle.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/quick/openglunderqml/main.qml b/examples/quick/openglunderqml/main.qml index 174bb262ca..66bc08bf03 100644 --- a/examples/quick/openglunderqml/main.qml +++ b/examples/quick/openglunderqml/main.qml @@ -71,7 +71,7 @@ Item { id: label color: "black" wrapMode: Text.WordWrap - text: "The background here is a squircle rendered with raw OpenGL using the 'beforeRender()' signal in QQuickCanvas. This text label and its border is rendered using QML" + text: "The background here is a squircle rendered with raw OpenGL using the 'beforeRender()' signal in QQuickWindow. This text label and its border is rendered using QML" anchors.right: parent.right anchors.left: parent.left anchors.bottom: parent.bottom diff --git a/examples/quick/openglunderqml/squircle.cpp b/examples/quick/openglunderqml/squircle.cpp index c25e28c12f..b1340687f9 100644 --- a/examples/quick/openglunderqml/squircle.cpp +++ b/examples/quick/openglunderqml/squircle.cpp @@ -41,7 +41,7 @@ #include "squircle.h" -#include <QtQuick/qquickcanvas.h> +#include <QtQuick/qquickwindow.h> #include <QOpenGLShaderProgram> Squircle::Squircle() @@ -52,9 +52,9 @@ Squircle::Squircle() void Squircle::itemChange(ItemChange change, const ItemChangeData &) { - // The ItemSceneChange event is sent when we are first attached to a canvas. + // The ItemSceneChange event is sent when we are first attached to a window. if (change == ItemSceneChange) { - QQuickCanvas *c = canvas(); + QQuickWindow *c = window(); // Connect our the beforeRendering signal to our paint function. // Since this call is executed on the rendering thread it must be @@ -104,7 +104,7 @@ void Squircle::paint() m_program->setAttributeArray(0, GL_FLOAT, values, 2); m_program->setUniformValue("t", (float) m_t); - glViewport(0, 0, canvas()->width(), canvas()->height()); + glViewport(0, 0, window()->width(), window()->height()); glDisable(GL_DEPTH_TEST); |