From 42a45c8f42888ab6138c45e3b2cbfec50edf6d03 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 25 Mar 2011 17:48:23 +0200 Subject: Add Qt example boilerplate code --- qt/person.hxx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 qt/person.hxx (limited to 'qt/person.hxx') 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 +// copyright : not copyrighted - public domain + +#ifndef EMPLOYEE_HXX +#define EMPLOYEE_HXX + +#include +#include +#include +#include + +#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 -- cgit v1.1