Fix warnings in QtConcurrent image scaling example
Change-Id: Ib82b2abf608536ef4df6d7cfa5fb106f29f9253f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
5d6705c567
commit
46d4c2022d
@ -72,7 +72,7 @@ Images::Images(QWidget *parent)
|
|||||||
|
|
||||||
pauseButton = new QPushButton(tr("Pause/Resume"));
|
pauseButton = new QPushButton(tr("Pause/Resume"));
|
||||||
pauseButton->setEnabled(false);
|
pauseButton->setEnabled(false);
|
||||||
connect(pauseButton, &QPushButton::clicked, imageScaling, &QFutureWatcher<QImage>::togglePaused);
|
connect(pauseButton, &QPushButton::clicked, imageScaling, &QFutureWatcher<QImage>::toggleSuspended);
|
||||||
|
|
||||||
QHBoxLayout *buttonLayout = new QHBoxLayout();
|
QHBoxLayout *buttonLayout = new QHBoxLayout();
|
||||||
buttonLayout->addWidget(openButton);
|
buttonLayout->addWidget(openButton);
|
||||||
@ -127,7 +127,7 @@ void Images::open()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::function<QImage(const QString&)> scale = [imageSize](const QString &imageFileName) {
|
std::function<QImage(const QString&)> scale = [&](const QString &imageFileName) {
|
||||||
QImage image(imageFileName);
|
QImage image(imageFileName);
|
||||||
return image.scaled(QSize(imageSize, imageSize), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
return image.scaled(QSize(imageSize, imageSize), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user