Cant emit signal array of structure QList<Structure>
-
Hi I want to send a signal mainwindow to mythread.
mainwindow.cpp
QList<PLC_CONTROLPARAMS_LIST > PLC_ProfileParameters[100][100]; connect(this,SIGNAL(SendProfileParams(QList<PLC_CONTROLPARAMS_LIST>)),mThread,SLOT(ReceiveProfileParams(QList<PLC_CONTROLPARAMS_LIST >))); //Some Code emit SendProfileParams(PLC_ProfileParameters);mainwindow.h
signals: void SendProfileParams(QList<PLC_CONTROLPARAMS_LIST> );mythread.h
void ReceiveProfileParams(QList<PLC_CONTROLPARAMS_LIST>);mythread.cpp
void MyThread::ReceiveProfileParams(QList<PLC_CONTROLPARAMS_LIST *> Profile) { //Some code } Q_DECLARE_METATYPE(PLC_CONTROLPARAMS_LIST)I cant read Profile variable its empty.
Can you help? -
@V0rtex said in Cant emit signal array of structure QList<Structure>:
Q_DECLARE_METATYPE(PLC_CONTROLPARAMS_LIST)
That's not the type you need to declare. You created a container of those.
BTW: please use using instead of typedef to alias the type.
using PLC_LIST = QList<PLC_CONTROLPARAMS_LIST >;