summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-08-18 05:12:31 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-08-18 05:16:37 (GMT)
commit401ff4b290fcff0ef599af5986bc0b7816380575 (patch)
tree29b8734e4af6aa7c1a102965ec491ff860104ba8 /examples
parentb16c16134bac4dc7260fb74ca708a896886cddec (diff)
downloadQt-401ff4b290fcff0ef599af5986bc0b7816380575.zip
Qt-401ff4b290fcff0ef599af5986bc0b7816380575.tar.gz
Qt-401ff4b290fcff0ef599af5986bc0b7816380575.tar.bz2
Add visible background element to declarative examples that didn't have any
Invisible areas cause redraw artifacts with OpenVg paint engine. Task-number: Reviewed-by: Martin Jones
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/modelviews/package/view.qml3
-rw-r--r--examples/declarative/sqllocalstorage/hello.qml48
-rw-r--r--examples/declarative/threading/threadedlistmodel/timedisplay.qml40
3 files changed, 51 insertions, 40 deletions
diff --git a/examples/declarative/modelviews/package/view.qml b/examples/declarative/modelviews/package/view.qml
index 152881a..26230ef 100644
--- a/examples/declarative/modelviews/package/view.qml
+++ b/examples/declarative/modelviews/package/view.qml
@@ -40,7 +40,8 @@
import Qt 4.7
-Item {
+Rectangle {
+ color: "white"
width: 400
height: 200
diff --git a/examples/declarative/sqllocalstorage/hello.qml b/examples/declarative/sqllocalstorage/hello.qml
index 421a74c..19b7378 100644
--- a/examples/declarative/sqllocalstorage/hello.qml
+++ b/examples/declarative/sqllocalstorage/hello.qml
@@ -40,32 +40,38 @@
//![0]
import Qt 4.7
-Text {
- text: "?"
+Rectangle {
+ color: "white"
+ width: 200
+ height: 100
+
+ Text {
+ text: "?"
+ anchors.horizontalCenter: parent.horizontalCenter
+ function findGreetings() {
+ var db = openDatabaseSync("QDeclarativeExampleDB", "1.0", "The Example QML SQL!", 1000000);
- function findGreetings() {
- var db = openDatabaseSync("QDeclarativeExampleDB", "1.0", "The Example QML SQL!", 1000000);
+ db.transaction(
+ function(tx) {
+ // Create the database if it doesn't already exist
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
- db.transaction(
- function(tx) {
- // Create the database if it doesn't already exist
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+ // Add (another) greeting row
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- // Add (another) greeting row
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ // Show all added greetings
+ var rs = tx.executeSql('SELECT * FROM Greeting');
- // Show all added greetings
- var rs = tx.executeSql('SELECT * FROM Greeting');
-
- var r = ""
- for(var i = 0; i < rs.rows.length; i++) {
- r += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + "\n"
+ var r = ""
+ for(var i = 0; i < rs.rows.length; i++) {
+ r += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + "\n"
+ }
+ text = r
}
- text = r
- }
- )
- }
+ )
+ }
- Component.onCompleted: findGreetings()
+ Component.onCompleted: findGreetings()
+ }
}
//![0]
diff --git a/examples/declarative/threading/threadedlistmodel/timedisplay.qml b/examples/declarative/threading/threadedlistmodel/timedisplay.qml
index 997f7a0..9fc3eb3 100644
--- a/examples/declarative/threading/threadedlistmodel/timedisplay.qml
+++ b/examples/declarative/threading/threadedlistmodel/timedisplay.qml
@@ -41,31 +41,35 @@
// ![0]
import Qt 4.7
-ListView {
+Rectangle {
+ color: "white"
width: 200
height: 300
- model: listModel
- delegate: Component {
- Text { text: time }
- }
+ ListView {
- ListModel { id: listModel }
+ model: listModel
+ delegate: Component {
+ Text { text: time }
+ }
- WorkerScript {
- id: worker
- source: "dataloader.js"
- }
+ ListModel { id: listModel }
+
+ WorkerScript {
+ id: worker
+ source: "dataloader.js"
+ }
- Timer {
- id: timer
- interval: 2000; repeat: true
- running: true
- triggeredOnStart: true
+ Timer {
+ id: timer
+ interval: 2000; repeat: true
+ running: true
+ triggeredOnStart: true
- onTriggered: {
- var msg = {'action': 'appendCurrentTime', 'model': listModel};
- worker.sendMessage(msg);
+ onTriggered: {
+ var msg = {'action': 'appendCurrentTime', 'model': listModel};
+ worker.sendMessage(msg);
+ }
}
}
}