imageviewer example: Show the color space description when loading

Change-Id: If9939676f29b9bbb43d698fb12efc42757e5c659
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Friedemann Kleint 2021-03-05 08:06:52 +01:00
parent de658d8ca5
commit 0a392780c8

View File

@ -115,8 +115,11 @@ bool ImageViewer::loadFile(const QString &fileName)
setWindowFilePath(fileName);
const QString message = tr("Opened \"%1\", %2x%3, Depth: %4")
.arg(QDir::toNativeSeparators(fileName)).arg(image.width()).arg(image.height()).arg(image.depth());
const QString description = image.colorSpace().isValid()
? image.colorSpace().description() : tr("unknown");
const QString message = tr("Opened \"%1\", %2x%3, Depth: %4 (%5)")
.arg(QDir::toNativeSeparators(fileName)).arg(image.width()).arg(image.height())
.arg(image.depth()).arg(description);
statusBar()->showMessage(message);
return true;
}