4 ms·
Without moc their is no signal slots and the handy stuff you get from plopping Q_OBJECT in your derived classes. So it's not going anywhere.
by iKlsR 9y ago
Without moc their is no signal slots and the handy stuff you get from plopping Q_OBJECT in your derived classes. So it's not going anywhere.
- billfruit 9y agoCan't they figure out a way to do that in pure c++ yet? In other words why does C++ lack reflection, and only seems to have a half baked RTTI? Perhaps the QT guys and other c++ application programmers didn't lobby C++ standards committee strongly enough for that?
- dkersten 9y agoSure, but there's 1) a performance hit because things that can be done at compile-time currently, have to be done at runtime, and 2) syntactically verbose/cumbersome. They've decided that these things are not worth it to most people. Besides, it still is C++: you can totally compile everything without the moc (although its probably not very useful to do so), since the extra keywords are just #defines. I've personally never had any issues with the moc (but I did only ever use QtCreator/qmake, so...)
- jcelerier 9y agoThere is a possibility, but at the cost of uglier macros (since no reflection): https://woboq.com/blog/verdigris-qt-without-moc.html https://woboq.com/blog/verdigris-qt-without-moc.html
- user5994461 9y agoThere can't be reflection. C++ is compiled into machine code, it's a one way process.