|
|
|
|
|
by jcelerier
2395 days ago
|
|
> Signals and slots compile into plain C++ functions. The input language (the unnamed Qt superset of C++) has a notion of signals and slots, the output language (C++) does not have any such notion. If that was the case, gcc and clang would not be able to build Qt files. Yet the following compiles without issues : echo "#include <QObject>\nstruct foo : QObject { signals: void bar(); public slots: void blah() { } };" | g++ -std=c++11 -fPIC -I /usr/include/qt/QtCore -c -x c++ -
which is all that is needed to ensure that some code is indeed 100% valid C++ code - that it is idiomatic is a wholly different question.hell, you can even generate the signals code without moc if you are ok with more macros (https://github.com/woboq/verdigris) |
|