summaryrefslogtreecommitdiffstats
path: root/examples/declarative/sql/hello.qml
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-25 11:28:35 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-25 11:28:35 (GMT)
commit6729645b28f6acfeab9bb0bc488ca4143c480f5a (patch)
tree460b440bdaa684f42f0bd8d024829673747cb727 /examples/declarative/sql/hello.qml
parentea0b7da7f5c206c436999b35bc2b55fb8863ecfe (diff)
parent3eed4c454a58b38c895925b74e47a0b1b747df80 (diff)
downloadQt-6729645b28f6acfeab9bb0bc488ca4143c480f5a.zip
Qt-6729645b28f6acfeab9bb0bc488ca4143c480f5a.tar.gz
Qt-6729645b28f6acfeab9bb0bc488ca4143c480f5a.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Conflicts: tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
Diffstat (limited to 'examples/declarative/sql/hello.qml')
-rw-r--r--examples/declarative/sql/hello.qml35
1 files changed, 17 insertions, 18 deletions
diff --git a/examples/declarative/sql/hello.qml b/examples/declarative/sql/hello.qml
index 277dfeb..29e084c 100644
--- a/examples/declarative/sql/hello.qml
+++ b/examples/declarative/sql/hello.qml
@@ -1,30 +1,29 @@
import Qt 4.6
Text {
- Script {
- 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"
- }
- text = r
+ 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: "?"
Component.onCompleted: findGreetings()
}