mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
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. 664dac34010c946db4477065abd077a7f7145bcd and 9f53ae6efcfb63c90308f86d4d30230c8750e66c 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:
parent
8a54100804
commit
fc57378a85
@ -20,11 +20,6 @@ ComicsViewTransition::ComicsViewTransition(QWidget *parent)
|
||||
#endif
|
||||
}
|
||||
|
||||
QSize ComicsViewTransition::sizeHint()
|
||||
{
|
||||
return QSize(450, 350);
|
||||
}
|
||||
|
||||
void ComicsViewTransition::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
@ -8,7 +8,6 @@ class ComicsViewTransition : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ComicsViewTransition(QWidget *parent = nullptr);
|
||||
QSize sizeHint();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
|
@ -469,11 +469,6 @@ void GridComicsView::resetScroll()
|
||||
QMetaObject::invokeMethod(scrollView, "scrollToOrigin");
|
||||
}
|
||||
|
||||
QSize GridComicsView::sizeHint()
|
||||
{
|
||||
return QSize(1280, 768);
|
||||
}
|
||||
|
||||
QByteArray GridComicsView::getMimeDataFromSelection()
|
||||
{
|
||||
QByteArray data;
|
||||
|
@ -31,7 +31,6 @@ public:
|
||||
void toNormal() override;
|
||||
void updateConfig(QSettings *settings) override;
|
||||
void enableFilterMode(bool enabled) override;
|
||||
QSize sizeHint();
|
||||
QByteArray getMimeDataFromSelection();
|
||||
void updateCurrentComicView() override;
|
||||
void focusComicsNavigation(Qt::FocusReason reason) override;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user