[*] Improved stability under the unified gc memory model; caught null under ensure no parents under heavy repaint load

Change-Id: I7c8dfad2d982da7ea08a2f12d9baa2b5735eda8e
This commit is contained in:
Reece Wilson 2023-12-31 14:32:45 +00:00
parent e0d35bff27
commit 28ab947a11

View File

@ -2038,7 +2038,10 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt
while (w) {
if (w->isWindow())
break;
QWidgetPrivate *pd = w->parentWidget()->d_func();
QWidget *pParent = w->parentWidget();
if (!pParent)
break;
QWidgetPrivate *pd = pParent->d_func();
const int myIndex = pd->children.indexOf(const_cast<QWidget *>(w));
const QRect widgetGeometry = w->d_func()->effectiveRectFor(w->data->crect);
for (int i = myIndex + 1; i < pd->children.size(); ++i) {
@ -4201,7 +4204,8 @@ QPointF QWidget::mapTo(const QWidget *parent, const QPointF &pos) const
QPointF p = pos;
if (parent) {
const QWidget * w = this;
while (w != parent) {
while (w != parent &&
w) {
Q_ASSERT_X(w, "QWidget::mapTo(const QWidget *parent, const QPointF &pos)",
"parent must be in parent hierarchy");
p = w->mapToParent(p);
@ -4233,7 +4237,8 @@ QPointF QWidget::mapFrom(const QWidget *parent, const QPointF &pos) const
QPointF p(pos);
if (parent) {
const QWidget * w = this;
while (w != parent) {
while (w != parent &&
w) {
Q_ASSERT_X(w, "QWidget::mapFrom(const QWidget *parent, const QPoint &pos)",
"parent must be in parent hierarchy");