diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 10:40:52 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 10:40:52 (GMT) |
commit | bb2e4df9bee3148e819c98410aa36e22dad95d7a (patch) | |
tree | a6e6e8c070a72378d4b2e5f39ad3cc9c368b61ab /doc/src/snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp | |
download | Qt-bb2e4df9bee3148e819c98410aa36e22dad95d7a.zip Qt-bb2e4df9bee3148e819c98410aa36e22dad95d7a.tar.gz Qt-bb2e4df9bee3148e819c98410aa36e22dad95d7a.tar.bz2 |
Initial import of kinetic-animations branch from the old kinetic
repository to the new repository
Diffstat (limited to 'doc/src/snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp')
-rw-r--r-- | doc/src/snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp b/doc/src/snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp new file mode 100644 index 0000000..55146de --- /dev/null +++ b/doc/src/snippets/code/src_qt3support_sql_q3sqlpropertymap.cpp @@ -0,0 +1,35 @@ +//! [0] +Q3SqlPropertyMap *myMap = new Q3SqlPropertyMap(); +Q3SqlForm *myForm = new Q3SqlForm(this); +MyEditor myEditor(this); + +// Set the Q3SqlForm's record buffer to the update buffer of +// a pre-existing Q3SqlCursor called 'cur'. +myForm->setRecord(cur->primeUpdate()); + +// Install the customized map +myMap->insert("MyEditor", "content"); +myForm->installPropertyMap(myMap); // myForm now owns myMap +... +// Insert a field into the form that uses a myEditor to edit the +// field 'somefield' +myForm->insert(&myEditor, "somefield"); + +// Update myEditor with the value from the mapped database field +myForm->readFields(); +... +// Let the user edit the form +... +// Update the database fields with the values in the form +myForm->writeFields(); +... +//! [0] + + +//! [1] +Q3SqlPropertyMap *myMap = new Q3SqlPropertyMap; + +myMap->insert("MyEditor", "content"); +Q3SqlPropertyMap::installDefaultMap(myMap); +... +//! [1] |