Привет, ребята, мне действительно нужна ваша помощь. Все, что я хочу сделать, - это масштабировать изображение и запускать его, используя QtConcurrent.
void MainWindow::displayImages( QPixmap &image)
{
image = image.scaled(100,100,Qt::KeepAspectRatio,Qt::FastTransformation);
}
void MainWindow::showImages()
{
QList <QPixmap> images ;
foreach(imageName,imageList)
{
imageNames.push_back(imageName.toStdString());
image.load(imageName,"4",Qt::AutoColor);
images.push_back(image);
}
QtConcurrent::map(images,&MainWindow::displayImages);
}
этот код не компилируется, он продолжает выдавать ошибку
1>c:\qt\4.7.1\src\corelib\concurrent\qtconcurrentmapkernel.h(73): error C2064: term does not evaluate to a function taking 1 arguments
1> c:\qt\4.7.1\src\corelib\concurrent\qtconcurrentmapkernel.h(72) : while compiling class template member function 'bool QtConcurrent::MapKernel<Iterator,MapFunctor>::runIteration(Iterator,int,void *)'
1> with
1> [
1> Iterator=QList<QPixmap>::iterator,
1> MapFunctor=void (__thiscall MainWindow::* )(QPixmap &)
1> ]
1> c:\qt\4.7.1\src\corelib\concurrent\qtconcurrentmapkernel.h(201) : see reference to class template instantiation 'QtConcurrent::MapKernel<Iterator,MapFunctor>' being compiled
1> with
1> [
1> Iterator=QList<QPixmap>::iterator,
1> MapFunctor=void (__thiscall MainWindow::* )(QPixmap &)
1> ]
1> c:\qt\4.7.1\src\corelib\concurrent\qtconcurrentmap.h(113) : see reference to function template instantiation 'QtConcurrent::ThreadEngineStarter<void> QtConcurrent::startMap<QList<T>::iterator,MapFunctor>(Iterator,Iterator,Functor)' being compiled
1> with
1> [
1> T=QPixmap,
1> MapFunctor=void (__thiscall MainWindow::* )(QPixmap &),
1> Iterator=QList<QPixmap>::iterator,
1> Functor=void (__thiscall MainWindow::* )(QPixmap &)
1> ]
1> c:\main\work\extend3d\git\square-marker-tools\bundleadjustment\mainwindow.cpp(307) : see reference to function template instantiation 'QFuture<void> QtConcurrent::map<QList<T>,void(__thiscall MainWindow::* )(QPixmap &)>(Sequence &,MapFunctor)' being compiled
1> with
1> [
1> T=QPixmap,
1> Sequence=QList<QPixmap>,
1> MapFunctor=void (__thiscall MainWindow::* )(QPixmap &)
1> ]