sam-w
sam-w

Reputation: 7687

What's the difference between <CLASS>.moc and moc_<CLASS>.cpp

Most of my classes generate a moc_<CLASS>.cpp file. Why do some classes generate a <CLASS>.moc file instead of/as well as?

Upvotes: 1

Views: 97

Answers (1)

sam-w
sam-w

Reputation: 7687

<CLASS>.moc is generated wherever there is a need to MOC the source file as well as/instead of the header (i.e. if the Q_OBJECT macro is used in the source).

See this answer for how this can be achieved.

Upvotes: 2

Related Questions