[Interest] Moc Builder Concepts

Thiago Macieira thiago.macieira at intel.com
Mon Jul 20 08:56:07 CEST 2015

On Friday 17 July 2015 17:11:43 William Blevins wrote:
> Moc builder is called on bbb,cpp which generates bbb.moc (if I understand
> correctly) where bbb.cpp is define as:
> > #include "my_qobject.h"
> > 
> > void bbb(void) Q_OBJECT
> > 
> > #include "bbb.moc"

Q_OBJECT can only be applied to classes and structs. The code above will not 

> As written this code contains a dependency cycle where "bbb.moc depends on
> bbb.cpp (by explicit creation) and bbb.cpp depends on bbb.moc (by implicit
> inclusion).

moc silently ignores #includes it can't find.

> Is Moc designed to created dependency cycles or is this simply bad code?
> If this code is poorly structured, can someone give me an example for best
> practice?

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Interest mailing list