aboutsummaryrefslogtreecommitdiff
path: root/qt/person.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-03-25 17:48:23 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-04-22 17:54:50 +0200
commit42a45c8f42888ab6138c45e3b2cbfec50edf6d03 (patch)
tree9ae39bb2552ae26d96837033f6ac205dc236a11c /qt/person.hxx
parent8e29be9f2229a6c618f95b725502f7082f02d50a (diff)
Add Qt example boilerplate code
Diffstat (limited to 'qt/person.hxx')
-rw-r--r--qt/person.hxx41
1 files changed, 41 insertions, 0 deletions
diff --git a/qt/person.hxx b/qt/person.hxx
new file mode 100644
index 0000000..28460c4
--- /dev/null
+++ b/qt/person.hxx
@@ -0,0 +1,41 @@
+// file : qt/person.hxx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : not copyrighted - public domain
+
+#ifndef EMPLOYEE_HXX
+#define EMPLOYEE_HXX
+
+#include <QString>
+#include <QDate>
+#include <QTime>
+#include <QDateTime>
+
+#pragma db object
+struct time_punchcard
+{
+ #pragma db id auto
+ unsigned long id;
+
+ QDateTime date_time;
+};
+
+#pragma db object
+struct person
+{
+ bool
+ operator== (const person& x) const
+ {
+ return name == x.name &&
+ date_of_birth == x.date_of_birth &&
+ time_of_birth == x.time_of_birth;
+ }
+
+ #pragma db id
+ QString name;
+
+ #pragma db type("DATE NOT NULL")
+ QDate date_of_birth;
+ QTime time_of_birth;
+};
+
+#endif // EMPLOYEE_HXX