Remove unused sizeHint() from GridComicsView and ComicsViewTransition

QWidget::sizeHint() is const-qualified, so Clang warns that non-const
sizeHint() member functions merely hide the virtual function of the base
class.

664dac3401 and
9f53ae6efc introduced these member
functions in 2014 without const qualifiers. QWidget::sizeHint() was
const-qualified even in Qt 3. Since these member functions have never
had any effect, they should be removed rather than const-qualified to
preserve the long-standing behaviors of the two classes.

Add a TODO for a similar but less straightforward issue with
PropertiesDialog::sizeHint().
This commit is contained in:
Igor Kushnir
2021-02-11 17:28:39 +02:00
parent 8a54100804
commit fc57378a85
5 changed files with 3 additions and 12 deletions

View File

@ -122,6 +122,9 @@ public:
PropertiesDialog(QWidget *parent = nullptr);
QString databasePath;
QString basePath;
// TODO: this non-const member function hides rather than overrides
// QWidget::sizeHint(). But the function cannot be simply removed as it is used
// in our constructor. Will have to investigate and decide how to fix this.
QSize sizeHint();
void paintEvent(QPaintEvent *event) override;