summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qdockwidget_p.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-09-21 15:25:11 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-11-27 08:46:29 +0200
commitce7447d88ce5f410ae01b0f5697a86b3ba7c47f2 (patch)
tree9b813fa59da6fd21e7b928839b2e93f9b263e592 /src/widgets/widgets/qdockwidget_p.h
parent2260d680c935eae0e989beb2040a01040f66a5fa (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/widgets/qdockwidget_p.h')
-rw-r--r--src/widgets/widgets/qdockwidget_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h
index bc6ac86c45..e663ec4c2d 100644
--- a/src/widgets/widgets/qdockwidget_p.h
+++ b/src/widgets/widgets/qdockwidget_p.h
@@ -201,7 +201,11 @@ inline QLayoutItem *QDockWidgetItem::dockWidgetChildItem() const
inline QDockWidgetLayout *QDockWidgetItem::dockWidgetLayout() const
{
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QWidget *w = const_cast<QDockWidgetItem*>(this)->widget();
+#else
+ QWidget *w = widget();
+#endif
if (w != nullptr)
return qobject_cast<QDockWidgetLayout*>(w->layout());
return nullptr;