aboutsummaryrefslogtreecommitdiff
path: root/qt/driver.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-04-19 09:26:51 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-04-22 18:45:40 +0200
commit25c332e53064af13c9f119df6bcc2c3847d93695 (patch)
tree8bed2caa49b4f0c3c3f02f777983b8ac2c19f49b /qt/driver.cxx
parent7ee76c54fca21bed2b94ebf1e71f723670f135fe (diff)
Add qt/smart-ptr usage to Qt example
Diffstat (limited to 'qt/driver.cxx')
-rw-r--r--qt/driver.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/qt/driver.cxx b/qt/driver.cxx
index f41e4d6..395f0b5 100644
--- a/qt/driver.cxx
+++ b/qt/driver.cxx
@@ -34,16 +34,16 @@ main (int argc, char* argv[])
// Simple Tech Ltd.
//
{
- shared_ptr<employer> er (new employer ("Simple Tech Ltd"));
+ QSharedPointer<employer> er (new employer ("Simple Tech Ltd"));
- shared_ptr<employee> john (
+ QSharedPointer<employee> john (
new employee ("John",
"Doe",
QDate (1974, 5, 23),
QByteArray ("\0xF1\0x00\0x34\0x45\0x00\0xDE", 6),
er));
- shared_ptr<employee> jane (
+ QSharedPointer<employee> jane (
new employee ("Jane",
"Doe",
QDate (1983, 1, 18),
@@ -68,16 +68,16 @@ main (int argc, char* argv[])
// Complex Systems Inc.
//
{
- shared_ptr<employer> er (new employer ("Complex Systems Inc"));
+ QSharedPointer<employer> er (new employer ("Complex Systems Inc"));
- shared_ptr<employee> john (
+ QSharedPointer<employee> john (
new employee ("John",
"Smith",
QDate (1954, 8, 1),
QByteArray ("\0x23\0xFD\0x8F\0x00", 4),
er));
- shared_ptr<employee> jane (
+ QSharedPointer<employee> jane (
new employee ("Jane",
"Smith",
QDate (1976, 12, 31),
@@ -107,18 +107,18 @@ main (int argc, char* argv[])
session s;
transaction t (db->begin ());
- shared_ptr<employer> stl (db->load<employer> ("Simple Tech Ltd"));
+ QSharedPointer<employer> stl (db->load<employer> ("Simple Tech Ltd"));
employees& es (stl->employees ());
for (employees::iterator i (es.begin ()); i != es.end (); ++i)
{
- lazy_weak_ptr<employee>& lwp (*i);
+ QLazyWeakPointer<employee>& lwp (*i);
// Load and lock the employee and his employer.
//
- shared_ptr<employee> p (lwp.load ());
- shared_ptr<employer> pe (p->employer ().load ());
+ QSharedPointer<employee> p (lwp.load ());
+ QSharedPointer<employer> pe (p->employer ().load ());
cout << p->first () << " " << p->last () << endl
<< " born: " << p->born ().toString () << endl