mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -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:
@ -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]
|
||||
|
Reference in New Issue
Block a user