Unsolved 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]
-
You're making the connection after you emit the signal. By default the connection is done with
Qt::AutoConnection
, which expands toQt::DirectConnection
in single threaded environment. Additionally, you should move to Qt 5 and its connection syntax.