Async code does nothing
I am running Qt Created based on Qt 5.15.2. I borrowed the async code from the example and of course catered it to my situation but nothing happens with no error messages. The following code produces no output regardless of how long I wait:
SimpleMail::ServerReply *reply = server->sendMail(mimeMessage);
QObject::connect(reply, &SimpleMail::ServerReply::finished, [reply] {
qDebug() << "Email finished" << reply->error() << reply->responseText();
reply->deleteLater();// Don't forget to delete it
});
The blocking code with the same settings works fine.
Thanks!
do you have an event loop running?
Hmmm AFAIK yes. But I do have a peculiar setup for this program. See below for main.cpp code (stripped for brevity):
int main(int argc, char *argv[])
{
//this class is derived from QApplication and is part of Qt Solutions for only running one copy of the program at a time
QtSingleApplication repSAPass("reppass", argc, argv);
//this is my main gui thread object that has all my code in it (including the async email code), it is derived from QWidget (perhaps I should change it to QObject or something?)
Replicator replicator;
//this is obviously where the program starts
return repSAPass.exec();
}
Thanks for the help. Hopefully this is something easy.
so far it looks fine, probably related to your other bug report
Fix was merged