if ((index >= 0) && (index < itemList.size()))
return itemList.takeAt(index);
else
- return 0;
+ return nullptr;
}
Qt::Orientations FlowLayout::expandingDirections() const
if (w > size.width())
size.setWidth(w);
- int h = item->geometry().y() + item->geometry().width();
+ int h = item->geometry().y() + item->geometry().height();
if (h > size.height())
size.setHeight(h);
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ int left, top, right, bottom;
+ getContentsMargins(&left, &top, &right, &bottom);
+ size += QSize(left + right, top + bottom);
+#else
size += QSize(2 * margin(), 2 * margin());
+#endif
return size;
}
if (parent->isWidgetType()) {
QWidget *pw = qobject_cast<QWidget*>(parent);
- return pw->style()->pixelMetric(pm, 0, pw);
+ return pw->style()->pixelMetric(pm, nullptr, pw);
} else
return static_cast<QLayout*>(parent)->spacing();
}