aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-07-11 17:32:16 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-17 07:26:15 +0200
commitfeb996e3ab44e68082c97102556ea396f5df3f44 (patch)
tree7613a8a4eaf5a8e0fb2801e9d0d9d1869524c348 /examples
parent68bbdacd2d5a6fa02f085a996411fb2b71875174 (diff)
QQuickCanvas renames
QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/openglunderqml/main.qml2
-rw-r--r--examples/quick/openglunderqml/squircle.cpp8
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);