summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qlayoutitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qlayoutitem.cpp')
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 0aab0bb06d..af5750771d 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -291,14 +291,12 @@ void QSpacerItem::changeSize(int w, int h, QSizePolicy::Policy hPolicy,
/*!
Destructor.
*/
-QWidgetItem::~QWidgetItem() {}
+QWidgetItem::~QWidgetItem() = default;
/*!
Destroys the QLayoutItem.
*/
-QLayoutItem::~QLayoutItem()
-{
-}
+QLayoutItem::~QLayoutItem() = default;
/*!
Invalidates any cached information in this layout item.
@@ -362,7 +360,11 @@ QSpacerItem * QSpacerItem::spacerItem()
\sa layout(), spacerItem()
*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QWidget *QLayoutItem::widget()
+#else
+QWidget *QLayoutItem::widget() const
+#endif
{
return nullptr;
}
@@ -370,7 +372,11 @@ QWidget *QLayoutItem::widget()
/*!
Returns the widget managed by this item.
*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QWidget *QWidgetItem::widget()
+#else
+QWidget *QWidgetItem::widget() const
+#endif
{
return wid;
}
@@ -591,7 +597,7 @@ Qt::Orientations QSpacerItem::expandingDirections() const
Qt::Orientations QWidgetItem::expandingDirections() const
{
if (isEmpty())
- return Qt::Orientations(0);
+ return {};
Qt::Orientations e = wid->sizePolicy().expandingDirections();
/*
@@ -772,7 +778,7 @@ QWidgetItemV2::QWidgetItemV2(QWidget *widget)
q_cachedMaximumSize(Dirty, Dirty),
q_firstCachedHfw(0),
q_hfwCacheSize(0),
- d(0)
+ d(nullptr)
{
QWidgetPrivate *wd = wid->d_func();
if (!wd->widgetItem)
@@ -784,7 +790,7 @@ QWidgetItemV2::~QWidgetItemV2()
if (wid) {
auto *wd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(wid));
if (wd->widgetItem == this)
- wd->widgetItem = 0;
+ wd->widgetItem = nullptr;
}
}