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

@ -181,7 +181,7 @@ private:
public:
Viewer(QWidget *parent = nullptr);
~Viewer();
const QPixmap pixmap();
QPixmap pixmap() const;
// Comic * getComic(){return comic;}
const BookmarksDialog *getBookmarksDialog() { return bd; }
// returns the current index starting in 1 [1,nPages]