I am attempting to send a structure via signals/slots between two threads, my signals/slots are connected properly and I have been able to send QStrings containing parts of my data but now I need to send the whole thing and Structures seem most sensible. However when I try the signal is not sent/recieved. The problem seems to be only with sending/receiving the structure, the processing before and after I have tried many ways.
I cannot use pointers such here or here as my data is generated too fast and memory gets over written or freed (I have tried with pointers and assume references will be similarly effected).
I have already added the Q_DECLARE_METATYPE to my structure. My structure is only a small test for now (to be enlarged later) and is in its own header file.
#ifndef RETURNSTRUCT_H
#define RETURNSTRUCT_H
struct Datastruct
{
int markeridone;
};
Q_DECLARE_METATYPE(Datastruct);
#endif //RETURNSTRUCT_H
Why might my program be unable to send/receive structures? any help is much appreciated.
I am using windows 7, MinGW 32bit, Qt 5.7.0, Qt Creator 4.0.3