examples/qtconcurrent/progressdialog/main.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    67 
    67 
    68     // Create a progress dialog.
    68     // Create a progress dialog.
    69     QProgressDialog dialog;
    69     QProgressDialog dialog;
    70     dialog.setLabelText(QString("Progressing using %1 thread(s)...").arg(QThread::idealThreadCount()));
    70     dialog.setLabelText(QString("Progressing using %1 thread(s)...").arg(QThread::idealThreadCount()));
    71  
    71  
    72     // Create a QFutureWatcher and conncect signals and slots.
    72     // Create a QFutureWatcher and connect signals and slots.
    73     QFutureWatcher<void> futureWatcher;
    73     QFutureWatcher<void> futureWatcher;
    74     QObject::connect(&futureWatcher, SIGNAL(finished()), &dialog, SLOT(reset()));
    74     QObject::connect(&futureWatcher, SIGNAL(finished()), &dialog, SLOT(reset()));
    75     QObject::connect(&dialog, SIGNAL(canceled()), &futureWatcher, SLOT(cancel()));
    75     QObject::connect(&dialog, SIGNAL(canceled()), &futureWatcher, SLOT(cancel()));
    76     QObject::connect(&futureWatcher, SIGNAL(progressRangeChanged(int,int)), &dialog, SLOT(setRange(int,int)));
    76     QObject::connect(&futureWatcher, SIGNAL(progressRangeChanged(int,int)), &dialog, SLOT(setRange(int,int)));
    77     QObject::connect(&futureWatcher, SIGNAL(progressValueChanged(int)), &dialog, SLOT(setValue(int)));
    77     QObject::connect(&futureWatcher, SIGNAL(progressValueChanged(int)), &dialog, SLOT(setValue(int)));