Error when using QSignalSpy
Unsolved
General and Desktop
-
Hi,
Are you writing a test ?
-
Can you give more details about your use case ?
-
@sgaist If you are asking about the use case of QSignalSpy, what I can add on is I used the QSignalSpy in this way instead of what I provided:
QSignalSpy spy(this, &myClass::testSignal); // didn't compile
And the full error messages were:
- Undefined reference to 'vtable for QTestEventLoop' (Error in qtesteventloop.h)
- In function 'QTestEventLoop::~QTestEventLoop();' (Error in myClass.o)
I was actually facing the problem that though a connection was established successfully (by observing the return boolean value of function
connect
), but the slot is not evoked. I am testing to see if the signal emitted properly, also there might be the case that either sender or receiver was destroyed -
Then you should rather check the lifetime of the objects that are connected.