aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/positioners/positioners-attachedproperties.qml28
-rw-r--r--examples/quick/scenegraph/rendernode/openglrenderer.cpp6
-rw-r--r--examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml6
3 files changed, 24 insertions, 16 deletions
diff --git a/examples/quick/positioners/positioners-attachedproperties.qml b/examples/quick/positioners/positioners-attachedproperties.qml
index af89543289..38c71068f2 100644
--- a/examples/quick/positioners/positioners-attachedproperties.qml
+++ b/examples/quick/positioners/positioners-attachedproperties.qml
@@ -90,14 +90,14 @@ Rectangle {
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
text: "Index: " + parent.Positioner.index
- + (parent.Positioner.isFirstItem ? " (First)" : "")
- + (parent.Positioner.isLastItem ? " (Last)" : "")
+ + (parent.Positioner.isFirstItem ? " (First)" : "")
+ + (parent.Positioner.isLastItem ? " (Last)" : "")
}
// When mouse is clicked, display the values of the positioner
MouseArea {
- anchors.fill: parent
- onClicked: column.showInfo(green.Positioner)
+ anchors.fill: parent
+ onClicked: column.showInfo(green.Positioner)
}
}
//! [0]
@@ -113,14 +113,14 @@ Rectangle {
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
text: "Index: " + parent.Positioner.index
- + (parent.Positioner.isFirstItem ? " (First)" : "")
- + (parent.Positioner.isLastItem ? " (Last)" : "")
+ + (parent.Positioner.isFirstItem ? " (First)" : "")
+ + (parent.Positioner.isLastItem ? " (Last)" : "")
}
// When mouse is clicked, display the values of the positioner
MouseArea {
- anchors.fill: parent
- onClicked: column.showInfo(blue.Positioner)
+ anchors.fill: parent
+ onClicked: column.showInfo(blue.Positioner)
}
}
@@ -135,14 +135,14 @@ Rectangle {
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
text: "Index: " + parent.Positioner.index
- + (parent.Positioner.isFirstItem ? " (First)" : "")
- + (parent.Positioner.isLastItem ? " (Last)" : "")
+ + (parent.Positioner.isFirstItem ? " (First)" : "")
+ + (parent.Positioner.isLastItem ? " (Last)" : "")
}
// When mouse is clicked, display the values of the positioner
MouseArea {
- anchors.fill: parent
- onClicked: column.showInfo(purple.Positioner)
+ anchors.fill: parent
+ onClicked: column.showInfo(purple.Positioner)
}
}
@@ -159,8 +159,8 @@ Rectangle {
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
text: "Index: " + parent.Positioner.index
- + (parent.Positioner.isFirstItem ? " (First)" : "")
- + (parent.Positioner.isLastItem ? " (Last)" : "")
+ + (parent.Positioner.isFirstItem ? " (First)" : "")
+ + (parent.Positioner.isLastItem ? " (Last)" : "")
}
}
diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.cpp b/examples/quick/scenegraph/rendernode/openglrenderer.cpp
index a4e619bea9..80806d51d1 100644
--- a/examples/quick/scenegraph/rendernode/openglrenderer.cpp
+++ b/examples/quick/scenegraph/rendernode/openglrenderer.cpp
@@ -158,6 +158,10 @@ void OpenGLRenderNode::render(const RenderState *state)
f->glEnable(GL_BLEND);
f->glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ // Regardless of flags() returning DepthAwareRendering or not,
+ // we have to test against what's in the depth buffer already.
+ f->glEnable(GL_DEPTH_TEST);
+
// Clip support.
if (state->scissorEnabled()) {
f->glEnable(GL_SCISSOR_TEST);
@@ -177,7 +181,7 @@ void OpenGLRenderNode::render(const RenderState *state)
//! [4]
QSGRenderNode::StateFlags OpenGLRenderNode::changedStates() const
{
- return BlendState | ScissorState | StencilState;
+ return BlendState | ScissorState | StencilState | DepthState;
}
QSGRenderNode::RenderingFlags OpenGLRenderNode::flags() const
diff --git a/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml
index 60167aa813..3db55a51a3 100644
--- a/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml
+++ b/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml
@@ -63,7 +63,11 @@ Rectangle {
Rectangle {
id: content
- anchors { left: parent.left; right: parent.right }
+ anchors {
+ left: parent ? parent.left : undefined
+ right: parent ? parent.right : undefined
+ }
+
height: column.implicitHeight + 4
border.width: 1