Merge "imageviewer example: Show the color space description when loading"

This commit is contained in:
Friedemann Kleint 2021-03-05 08:06:52 +01:00 committed by Qt CI Bot
commit 7402f4171d

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;
}