cannot use QVector as a parameter to signal
Solved
General and Desktop
-
Hello, I am trying to send a QVector that consists of QStrings, by using signal-slot mechanism.
I created the Signal as follows in header file:void sendInitDataToMath(QVector <QString> selectedNames);
And this is the receiver slot declaration:
void receiveInitData(QVector <QString> selectedNames);
When I try to connect these signal and slot as
void protocolForm::on_button_openMath_clicked() { mathFormInstance = new mathForm(); mathFormInstance->show(); connect(this,&protocolForm::sendInitDataToMath,mathFormInstance,&mathForm::receiveInitData); }
I receive "undefined reference to 'protocolForm::sendInitDataToMath(QVector<QString>)' " error. Is this because we cannot use vector parameters as parameters to signal-slot? How can I solve that?
-
@GunkutA said in cannot use QVector as a parameter to signal:
Is this because we cannot use vector parameters as parameters to signal-slot? How can I solve that?
nope, it's because you forgot to #include<QVector>