[Interest] QTimer and QThread

Alexander Syvak alexander.svk at gmail.com
Wed Jul 31 11:01:38 CEST 2013


Here's the snippet below from implementation of the run method. The class
inherits a class inheriting QThread.
...
       screenshot_qtmr = new QTimer;//(this);

    screenshot_qtmr->moveToThread(this);

    qDebug() << connect(screenshot_qtmr, SIGNAL(timeout()), this,
SLOT(on_screenshot_timeout()));

    qDebug() << connect(this, SIGNAL(kill_tmr()), screenshot_qtmr,
SLOT(stop()));

    screenshot_qtmr->start(freq*1000);

    anal_qmr = new QTimer;//(this);

    anal_qmr->moveToThread(this);

    qDebug() << connect(anal_qmr, SIGNAL(timeout()),
SLOT(on_analize_timeout()));

    qDebug() << connect(this, SIGNAL(kill_tmr()), anal_qmr, SLOT(stop()));

    anal_qmr->start(state_analizer_tmr_interval);

    if ( !state_analizer_tmr_id ) return;
    exec();    while ( !stop );
}

Here's an ouput
run() "./13_7_31_10_49_2_974"

"./13_7_31_10_49_2_974 exists"

"./13_7_31_10_49_2_974 has 'write' permission for other"

"./13_7_31_10_49_2_974/S0 directory was created"

true

true

true

true

run() "./13_7_31_10_49_2_974"

"./13_7_31_10_49_2_974 exists"

"./13_7_31_10_49_2_974 has 'write' permission for other"

"./13_7_31_10_49_2_974/S1 directory was created"

true

true

true

true


It never enters those method specified on timeout(). Why?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130731/070b2171/attachment.html>


More information about the Interest mailing list