Important: Please read the Qt Code of Conduct -

QThread struct reponse example ?

  • Hi ,

    I have worker Thread and defined a strcut:

    struct response{
            QImage _qimage;
            QString _t1;
            qint16 _int1;
        response cevap;
        void _frameChangedStruct (const response &cevap);

    and in main:

    connect(worker, SIGNAL(_frameChangedStruct(response)), this , SLOT(displayFrame(response)));
    void MainWindow::displayFrame(QImage qimg){

    It is not updating the widget. What is the correct way to pass a struct to the main thread ?


    [Fixed code tags ~kshegunov]

  • Moderators

    response is quite different from QImage, so you should start by matching your function prototypes. To that end you should use the Qt5 connect syntax, which is going to throw you a compile-time error for that code, as it justifiably should. I don't understand the rationale between that global variable - response cevap; though, you should explain what prompted you to use it like this.

Log in to reply