[*] Harden Qt6.7 (2023/11)
Change-Id: Ibf3e7161e31418e4fbcddfdd3f7d5c99ba5a82b3
This commit is contained in:
parent
04403770e6
commit
65e977f062
@ -1133,10 +1133,10 @@ bool QCoreApplication::notifyInternal2(QObject *receiver, QEvent *event)
|
||||
if (!selfRequired)
|
||||
return doNotify(receiver, event);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
|
||||
//#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
|
||||
if (threadData->thread.loadRelaxed() != QCoreApplicationPrivate::mainThread())
|
||||
return false;
|
||||
#endif
|
||||
//#endif
|
||||
return self->notify(receiver, event);
|
||||
}
|
||||
|
||||
|
@ -545,6 +545,8 @@ void QLayout::widgetEvent(QEvent *e)
|
||||
}
|
||||
break;
|
||||
case QEvent::LayoutRequest:
|
||||
if (!parent())
|
||||
break;
|
||||
if (static_cast<QWidget *>(parent())->isVisible())
|
||||
activate();
|
||||
break;
|
||||
@ -579,10 +581,12 @@ int QLayout::totalMinimumHeightForWidth(int w) const
|
||||
int side=0, top=0;
|
||||
if (d->topLevel) {
|
||||
QWidget *parent = parentWidget();
|
||||
parent->ensurePolished();
|
||||
QWidgetPrivate *wd = parent->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
if (d->topLevel) {
|
||||
parent->ensurePolished();
|
||||
QWidgetPrivate *wd = parent->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
}
|
||||
}
|
||||
int h = minimumHeightForWidth(w - side) + top;
|
||||
#if QT_CONFIG(menubar)
|
||||
@ -601,10 +605,12 @@ int QLayout::totalHeightForWidth(int w) const
|
||||
int side=0, top=0;
|
||||
if (d->topLevel) {
|
||||
QWidget *parent = parentWidget();
|
||||
parent->ensurePolished();
|
||||
QWidgetPrivate *wd = parent->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
if (parent) {
|
||||
parent->ensurePolished();
|
||||
QWidgetPrivate *wd = parent->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
}
|
||||
}
|
||||
int h = heightForWidth(w - side) + top;
|
||||
#if QT_CONFIG(menubar)
|
||||
@ -623,10 +629,12 @@ QSize QLayout::totalMinimumSize() const
|
||||
int side=0, top=0;
|
||||
if (d->topLevel) {
|
||||
QWidget *pw = parentWidget();
|
||||
pw->ensurePolished();
|
||||
QWidgetPrivate *wd = pw->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
if (pw) {
|
||||
pw->ensurePolished();
|
||||
QWidgetPrivate *wd = pw->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
}
|
||||
}
|
||||
|
||||
QSize s = minimumSize();
|
||||
@ -646,10 +654,12 @@ QSize QLayout::totalSizeHint() const
|
||||
int side=0, top=0;
|
||||
if (d->topLevel) {
|
||||
QWidget *pw = parentWidget();
|
||||
pw->ensurePolished();
|
||||
QWidgetPrivate *wd = pw->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
if (pw) {
|
||||
pw->ensurePolished();
|
||||
QWidgetPrivate *wd = pw->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
}
|
||||
}
|
||||
|
||||
QSize s = sizeHint();
|
||||
@ -671,10 +681,12 @@ QSize QLayout::totalMaximumSize() const
|
||||
int side=0, top=0;
|
||||
if (d->topLevel) {
|
||||
QWidget *pw = parentWidget();
|
||||
pw->ensurePolished();
|
||||
QWidgetPrivate *wd = pw->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
if (pw) {
|
||||
pw->ensurePolished();
|
||||
QWidgetPrivate *wd = pw->d_func();
|
||||
side += wd->leftmargin + wd->rightmargin;
|
||||
top += wd->topmargin + wd->bottommargin;
|
||||
}
|
||||
}
|
||||
|
||||
QSize s = maximumSize();
|
||||
@ -972,7 +984,7 @@ void QLayout::update()
|
||||
QLayout *layout = this;
|
||||
while (layout && layout->d_func()->activated) {
|
||||
layout->d_func()->activated = false;
|
||||
if (layout->d_func()->topLevel) {
|
||||
if (layout->d_func()->topLevel && layout->parent()) {
|
||||
Q_ASSERT(layout->parent()->isWidgetType());
|
||||
QWidget *mw = static_cast<QWidget*>(layout->parent());
|
||||
if (mw) { /*we always validate layout later, implying it can be null. why the fuck were the Qt devs copying the [~volatile~] parent multiple times and using it without a check?
|
||||
|
Loading…
Reference in New Issue
Block a user