examples/qtconcurrent/progressdialog/main.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    72  
    72  
    73     // Create a QFutureWatcher and conncect signals and slots.
    73     // Create a QFutureWatcher and conncect signals and slots.
    74     QFutureWatcher<void> futureWatcher;
    74     QFutureWatcher<void> futureWatcher;
    75     QObject::connect(&futureWatcher, SIGNAL(finished()), &dialog, SLOT(reset()));
    75     QObject::connect(&futureWatcher, SIGNAL(finished()), &dialog, SLOT(reset()));
    76     QObject::connect(&dialog, SIGNAL(canceled()), &futureWatcher, SLOT(cancel()));
    76     QObject::connect(&dialog, SIGNAL(canceled()), &futureWatcher, SLOT(cancel()));
    77     QObject::connect(&futureWatcher, SIGNAL(progressRangeChanged(int, int)), &dialog, SLOT(setRange(int, int)));
    77     QObject::connect(&futureWatcher, SIGNAL(progressRangeChanged(int,int)), &dialog, SLOT(setRange(int,int)));
    78     QObject::connect(&futureWatcher, SIGNAL(progressValueChanged(int)), &dialog, SLOT(setValue(int)));
    78     QObject::connect(&futureWatcher, SIGNAL(progressValueChanged(int)), &dialog, SLOT(setValue(int)));
    79 
    79 
    80     // Start the computation.
    80     // Start the computation.
    81     futureWatcher.setFuture(QtConcurrent::map(vector, spin));
    81     futureWatcher.setFuture(QtConcurrent::map(vector, spin));
    82 
    82