Qt World Summit: Register Today!


  • QThread* thread = new QThread;
    Worker* worker = new Worker();
    connect(thread, SIGNAL (started()), worker, SLOT (process()));
    connect(worker, SIGNAL (finished()), thread, SLOT (quit()));
    connect(worker, SIGNAL (finished()), worker, SLOT (deleteLater()));
    connect(thread, SIGNAL (finished()), thread, SLOT (deleteLater()));

    if I delete the connect whit deleteLater slot, can i call the start of the thread multiple times without recreating the objects, if YES it is possible even if the worker is a QTimer or a QSocket ?

  • Yes and yes

Log in to reply