[Interest] Representing to-many relationships in property system?

Aleix Pol aleixpol at kde.org
Thu Oct 11 01:49:06 CEST 2012

On Thu, Oct 11, 2012 at 12:07 AM, Chris Meyer <cmeyer1969+qt at gmail.com> wrote:
> The Qt property system easily represents properties (scalars) and
> to-one relationships (objects) using the Q_PROPERTY macro.
> However, what is the best way to represent to-many relationships?
> For instance, I can represent have an Employee and define a property
> for the employee's name (scalar string) and his company (object). But
> if I define a Company, how to I provide access to the company's
> employees (list of objects)?
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Q_PROPERTY(QList<Employee*> employees READ employees...)

no? maybe I didn't understand your question...


More information about the Interest mailing list