Hello everyone. Help make out what the problem is.
He took an example of Image Scaling working:
QImage scale (const QString & imageFileName)
{
QImage image (imageFileName);
return image.scaled (QSize (imageSize, imageSize), Qt :: IgnoreAspectRatio, Qt :: SmoothTransformation);
}
void Images :: open ()
{
...
QStringList files = QFileDialog :: getOpenFileNames (this, tr ("Select Images"),
QStandardPaths :: writableLocation (QStandardPaths :: PicturesLocation),
"*. jpg *. png");
...
imageScaling-> setFuture (QtConcurrent :: mapped (files, scale));
...
}
But if you do so. falls with error
QImage scale (const QString & imageFileName)
{
QImage image (imageFileName);
return image.scaled (QSize (imageSize, imageSize), Qt :: IgnoreAspectRatio, Qt :: SmoothTransformation);
}
void Images :: open ()
{
...
QStringList files;
files.append (QString ("path to file"));
files.append (QString ("path to file2"));
files.append (QString ("etc"));
...
imageScaling-> setFuture (QtConcurrent :: mapped (files, scale));
...
}
if you add in QStringList path to a single file, it works too
↧