Is it possible to create template signals?
Solved
General and Desktop
-
Is it possible to create a general template signal in a
QObject
subclass like this:signals: template<typename T> void templateSignal(const T& t);
I tried and I get the error:
The "QtRunWork" task returned false but did not log an error
-
@CJha the answer is generally no
qmake, the magic behind signals and slots, can't run on the expanded templates, those are compiler intern stuff and qmake runs/parses your source files directly. IIRC
So no, no templates with signals and slots.
BUT
there is verdigris, which should work with templates, but its a slightly different philosophy and a good bit more verbose.
1/3