0
votes

I don't use moc in the project. With new signal/slot syntax it works pretty good. But became necessary to emit signal in the derived Qt class.

It is possible without using moc?

2
you can create your own signal/slot-like architecture without moc (obviously something simpler, you don't have a moc pass..) and use it however you want. I did it some time ago and it worked pretty wellMarco A.
What are your reasons not to use moc?Frank Osterfeld
@David Kernin, Thanks for the link, there is very informative article.kaa

2 Answers

2
votes

No, this is not possible.

moc actually implements the signal function. If you look into the generated signal function by looking at the generated moc_myclass.cpp, you'll see that the signal function is nothing more than a call to QMetaObject::activate, and that function requires a pointer to the QMetaObject of the signal sender. Since without running moc, no metaobject is generated, you can't even call QMetaObject::activate manually.

2
votes

There is actually a very nice blogentry about the moc currently:

http://woboq.com/blog/reflection-in-cpp-and-qt-moc.html