Naming sheme from moc output

David Faure faure at
Fri Oct 21 11:12:20 CEST 2005

On Thursday 20 October 2005 21:14, Christian Ehrlicher wrote:
> Hello once again,
> I've a question about the moc naming sheme. Why is it different to qmake?
> Qt/qmake:
> moc file.h -> moc_file.cpp
> moc file.cpp -> file.moc

But I think qmake also supports moc file.h -> file.moc when included by .cpp nowadays?

> Kde/bksys/automake
> moc file.h -> file.moc
> moc file.cpp -> file_moc.cpp

Actually it's more like
  moc file.h -> file.moc if included from .cpp, otherwise file_moc.cpp
  qobjects in file.cpp -> not supported

  (I'm not sure; probably what you said)

I work on Qt-only projects, and I very much dislike that grep hits moc_file.cpp files too
(I know, doesn't happen with srcdir!=builddir or a moc dir, but with qmake the support for 
a moc dir broke in Qt4 (in our case)). ".moc" is really fine. And it's also what every
KDE developer is used to, now, you also have to take that into account :-)

David Faure, faure at, sponsored by Trolltech to work on KDE,
Konqueror (, and KOffice (

More information about the Kde-buildsystem mailing list