MagnifyingGlass: get rid of C-style casts to Viewer*

qobject_cast<const Viewer *> improves const correctness.
QLabel::pixmap() is const-qualified => make Viewer::pixmap() const too.

Return non-const QPixmap from Viewer::pixmap() to let compiler move the
return value at the function's call sites.

Introduce a named constant maxRelativeDimension. Change its type from
float to double, which usually multiplies faster on x86-64.

Remove redundant parentheses to improve readability.
This commit is contained in:
Igor Kushnir
2021-03-10 14:59:36 +02:00
parent fdba938fe8
commit efe9a1b995
3 changed files with 8 additions and 9 deletions

View File

@ -748,7 +748,7 @@ void Viewer::mouseMoveEvent(QMouseEvent *event)
}
}
const QPixmap Viewer::pixmap()
QPixmap Viewer::pixmap() const
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return content->pixmap();