mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
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:
@ -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();
|
||||
|
Reference in New Issue
Block a user