diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-10-20 05:33:32 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-10-20 05:34:06 (GMT) |
commit | 5b3e751f4c19ec05c72f212ff0ce672d982c490d (patch) | |
tree | a20f76f3e1519f2162b692042afb117ed36abe3e /examples/declarative | |
parent | 925366b08087f82b6b3d74c167946dd07e73b5c1 (diff) | |
download | Qt-5b3e751f4c19ec05c72f212ff0ce672d982c490d.zip Qt-5b3e751f4c19ec05c72f212ff0ce672d982c490d.tar.gz Qt-5b3e751f4c19ec05c72f212ff0ce672d982c490d.tar.bz2 |
doc now in globalobject.qdoc, not README
QT-2335
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/sql/README | 7 | ||||
-rw-r--r-- | examples/declarative/sql/hello.qml | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/examples/declarative/sql/README b/examples/declarative/sql/README deleted file mode 100644 index a7baab2..0000000 --- a/examples/declarative/sql/README +++ /dev/null @@ -1,7 +0,0 @@ -Simple demonstration of HTML5-compatible SQL database interface. -Adds another "hello, world" every time you run it. -Database is stored in: - - %APPDATA%/Nokia/Qt/QML/Databases/ (Windows) - - ~/.local/share/Nokia/Qt/QML/Databases/ (Unix) - - ~/Library/Application Support/Nokia/Qt/QML/Databases/ (Mac OS X) -No quota management. diff --git a/examples/declarative/sql/hello.qml b/examples/declarative/sql/hello.qml index 20ea611..dc3ca35 100644 --- a/examples/declarative/sql/hello.qml +++ b/examples/declarative/sql/hello.qml @@ -3,12 +3,17 @@ import Qt 4.6 Text { Script { function findGreetings() { - var db = openDatabase("QmlExampleDB", "", "The Example QML SQL!", 1000000); + var db = openDatabase("QmlExampleDB", "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)', []); + + // Add (another) greeting row tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + + // Show all added greetings tx.executeSql('SELECT * FROM Greeting', [], function(tx, rs) { var r = "" |