From 32dafbe8a2aaf2230b55dfd0840f70ff7909b5e1 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 21 Apr 2011 09:30:16 +0200 Subject: Add qt/container usage to Qt example --- qt/employee.hxx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'qt/employee.hxx') diff --git a/qt/employee.hxx b/qt/employee.hxx index f921a97..37ad0c9 100644 --- a/qt/employee.hxx +++ b/qt/employee.hxx @@ -5,12 +5,12 @@ #ifndef EMPLOYEE_HXX #define EMPLOYEE_HXX -#include - #include #include #include #include +#include +#include #include @@ -21,7 +21,8 @@ class employer; class employee; -typedef std::vector > employees; +typedef QSet emails; +typedef QList > employees; #pragma db object class employer @@ -107,6 +108,22 @@ public: return born_; } + // Emails. + // + typedef ::emails emails_type; + + const emails_type& + emails () const + { + return emails_; + } + + emails_type& + emails () + { + return emails_; + } + // Public key. // const QByteArray& @@ -139,9 +156,8 @@ private: QString first_; QString last_; - QDate born_; - + emails_type emails_; QByteArray public_key_; #pragma db not_null -- cgit v1.1