diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-21 15:25:11 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-11-27 08:46:29 +0200 |
commit | ce7447d88ce5f410ae01b0f5697a86b3ba7c47f2 (patch) | |
tree | 9b813fa59da6fd21e7b928839b2e93f9b263e592 /src/widgets/kernel/qlayoutitem.h | |
parent | 2260d680c935eae0e989beb2040a01040f66a5fa (diff) |
QLayoutItem: make QLayoutItem::widget() const in Qt6
QLayoutItem::widget() should be const since it does not modify the
class. Since this can not be done within Qt5 in a binary compatible way,
change it for Qt6.
Fixes: QTBUG-41997
Change-Id: I9211eb1c36a5bc4f06ab417a9df790ebedb7fcda
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/kernel/qlayoutitem.h')
-rw-r--r-- | src/widgets/kernel/qlayoutitem.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/kernel/qlayoutitem.h b/src/widgets/kernel/qlayoutitem.h index 059ff2d470..8553e20adc 100644 --- a/src/widgets/kernel/qlayoutitem.h +++ b/src/widgets/kernel/qlayoutitem.h @@ -74,7 +74,11 @@ public: virtual int minimumHeightForWidth(int) const; virtual void invalidate(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) virtual QWidget *widget(); +#else + virtual QWidget *widget() const; +#endif virtual QLayout *layout(); virtual QSpacerItem *spacerItem(); @@ -133,7 +137,11 @@ public: bool isEmpty() const override; void setGeometry(const QRect&) override; QRect geometry() const override; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QWidget *widget() override; +#else + QWidget *widget() const override; +#endif bool hasHeightForWidth() const override; int heightForWidth(int) const override; |