Has anyone had problems with QFutureWatcher signals not firing? Here's the code:
QFutureWatcher<void> watcher;
connect(&watcher, SIGNAL(progressRangeChanged(int, int)), this, SLOT(progressRangeChanged(int, int)));
connect(&watcher, SIGNAL(progressValueChanged(int)), this, SLOT(progressValueChanged(int)));
connect(&watcher, SIGNAL(finished()), this, SLOT(finished()));
QFuture<dent_vec_t> dent_scan_future = QtConcurrent::mappedReduced(all_joint_scan_params,dent_scan_with_line,&combine_dent_lists);
watcher.setFuture(dent_scan_future);
while (!watcher.isFinished())
{
//Some debug code
int prog1 = watcher.progressMinimum();
int prog2 = watcher.progressMaximum();
int progValue = watcher.progressValue();
}
m_dents = dent_scan_future.result();
QFutureWatcher<void> watcher;
connect(&watcher, SIGNAL(progressRangeChanged(int, int)), this, SLOT(progressRangeChanged(int, int)));
connect(&watcher, SIGNAL(progressValueChanged(int)), this, SLOT(progressValueChanged(int)));
connect(&watcher, SIGNAL(finished()), this, SLOT(finished()));
QFuture<dent_vec_t> dent_scan_future = QtConcurrent::mappedReduced(all_joint_scan_params,dent_scan_with_line,&combine_dent_lists);
watcher.setFuture(dent_scan_future);
while (!watcher.isFinished())
{
//Some debug code
int prog1 = watcher.progressMinimum();
int prog2 = watcher.progressMaximum();
int progValue = watcher.progressValue();
}
m_dents = dent_scan_future.result();
To copy to clipboard, switch view to plain text mode
I threw in the debug code to see if there's any progress to report, and there is. Here are my slots:
Header:
public slots:
void finished();
void progressRangeChanged(int, int);
void progressValueChanged(int);
public slots:
void finished();
void progressRangeChanged(int, int);
void progressValueChanged(int);
To copy to clipboard, switch view to plain text mode
CPP:
void dent_scanner::finished()
{
cout<<"FINISHED"<<endl;
}
void dent_scanner::progressRangeChanged(int a, int b)
{
cout<<"PROGRESS RANGE CHANGED: " <<a<<", "<<b<<endl;
}
void dent_scanner::progressValueChanged(int a)
{
cout<<"PROGRESS VALUE CHANGED: " <<a<<endl;
}
void dent_scanner::finished()
{
cout<<"FINISHED"<<endl;
}
void dent_scanner::progressRangeChanged(int a, int b)
{
cout<<"PROGRESS RANGE CHANGED: " <<a<<", "<<b<<endl;
}
void dent_scanner::progressValueChanged(int a)
{
cout<<"PROGRESS VALUE CHANGED: " <<a<<endl;
}
To copy to clipboard, switch view to plain text mode
This code won't execute no matter what I do. I have the Q_OBJECT macro in the header, and the moc file included at the bottom. The class inherits from QOBject. No errors print out when I connect up the signals and slots (already fixed that problem...)
I can usually find my way around signals and slots just fine. I probably just made a stupid mistake, but can't seem to figure out what it is. Any thoughts?
Bookmarks