How to receive SIGNAL from ItemWidget ?



  • I want download of form finished emit signal, the item will move from downloading list to downloaded list in slot.
    But the form was create in slot of dialog accept, slot in slot has no response.
    https://github.com/sonichy/HTYDown

    {
        connect(dialognew,SIGNAL(accepted()),this,SLOT(addnew()));
    }
    
    MainWindow::addnew(){
        Form *form = new Form;
        QListWidgetItem *LWI = new QListWidgetItem(ui->listWidgetDownloading);
        ui->listWidgetDownloading->setItemWidget(LWI,form);
        LWI->setSizeHint(QSize(1200,30));
        ui->listWidgetDownloading->addItem(LWI);
        connect(form,SIGNAL(downloadFinish()),this,SLOT(moveToDownloaded()));
    }
    
    Form::download(QString surl){
        emit downloadFinish();
    }
    

    [Added code tags ~kshegunov]


  • Qt Champions 2016

    You're making the connection after you emit the signal. By default the connection is done with Qt::AutoConnection, which expands to Qt::DirectConnection in single threaded environment. Additionally, you should move to Qt 5 and its connection syntax.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.