summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-10-15 12:52:02 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-10-15 12:56:39 +0300
commit7861ae308bd9fd495f677400cc07c657a1439656 (patch)
tree994bab0cd5a31728ec653c2b3886ee15bed8ced0 /examples
parent0109b085710bfabc81faf43118ad5654cbd96081 (diff)
Fix crashes and bugs when using surface with ES2
+Fix compile warnings +Fix qmlsurface example Change-Id: I28bbf38e7aa51b1ec315374182a9daae8eded87c Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/itemmodel/main.cpp2
-rw-r--r--examples/qmlsurface/qml/qmlsurface/main.qml21
2 files changed, 16 insertions, 7 deletions
diff --git a/examples/itemmodel/main.cpp b/examples/itemmodel/main.cpp
index 6ab685ed..fac6b442 100644
--- a/examples/itemmodel/main.cpp
+++ b/examples/itemmodel/main.cpp
@@ -159,7 +159,7 @@ void GraphDataGenerator::setupModel()
weeks << "week 1" << "week 2" << "week 3" << "week 4" << "week 5";
// Set up data Mon Tue Wed Thu Fri Sat Sun
- float hours[5][7] = {{2.0, 1.0, 3.0, 0.2, 1.0, 5.0, 10.0}, // week 1
+ qreal hours[5][7] = {{2.0, 1.0, 3.0, 0.2, 1.0, 5.0, 10.0}, // week 1
{0.5, 1.0, 3.0, 1.0, 2.0, 2.0, 3.0}, // week 2
{1.0, 1.0, 2.0, 1.0, 4.0, 4.0, 4.0}, // week 3
{0.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.3}, // week 4
diff --git a/examples/qmlsurface/qml/qmlsurface/main.qml b/examples/qmlsurface/qml/qmlsurface/main.qml
index 160fa9b6..bc8d9499 100644
--- a/examples/qmlsurface/qml/qmlsurface/main.qml
+++ b/examples/qmlsurface/qml/qmlsurface/main.qml
@@ -70,6 +70,17 @@ Item {
axisY.subSegmentCount: 2
axisY.labelFormat: "%i"
gradient: surfaceGradient
+
+ // Since flat is not supported on all platforms, and changes back to smooth
+ // asynchronously on those platforms, handle button text on changed
+ // signal handler rather than when we set the value.
+ onSmoothSurfaceEnabledChanged: {
+ if (enabled === true) {
+ smoothSurfaceToggle.text = "Show Flat"
+ } else {
+ smoothSurfaceToggle.text = "Show Smooth"
+ }
+ }
}
}
@@ -81,7 +92,7 @@ Item {
text: "Show Surface Grid"
//! [1]
onClicked: {
- if (surfaceplot.surfaceGridEnabled == false) {
+ if (surfaceplot.surfaceGridEnabled === false) {
surfaceplot.surfaceGridEnabled = true;
text = "Hide Surface Grid"
} else {
@@ -99,12 +110,10 @@ Item {
text: "Show Flat"
//! [2]
onClicked: {
- if (surfaceplot.smoothSurfaceEnabled == true) {
+ if (surfaceplot.smoothSurfaceEnabled === true) {
surfaceplot.smoothSurfaceEnabled = false;
- text = "Show Smooth"
} else {
surfaceplot.smoothSurfaceEnabled = true;
- text = "Show Flat"
}
}
//! [2]
@@ -116,7 +125,7 @@ Item {
width: smoothSurfaceToggle.width
text: "Hide Background"
onClicked: {
- if (surfaceplot.backgroundVisible == true) {
+ if (surfaceplot.backgroundVisible === true) {
surfaceplot.backgroundVisible = false;
text = "Show Background"
} else {
@@ -132,7 +141,7 @@ Item {
width: backgroundToggle.width
text: "Hide Grid"
onClicked: {
- if (surfaceplot.gridVisible == true) {
+ if (surfaceplot.gridVisible === true) {
surfaceplot.gridVisible = false;
text = "Show Grid"
} else {