QApplication: replace QList::prepend()s with appends()
Use the new reverse_iterator support in QList to avoid building a QList with prepend()ing, using append() instead. Change-Id: I6b9d9b1a9941cf2e6cc39ad2d9097fdc629c24bc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
404b1fd8b3
commit
bb7bc4a05e
@ -2330,7 +2330,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
|
|||||||
if (enter && !sameWindow) {
|
if (enter && !sameWindow) {
|
||||||
auto *w = enter;
|
auto *w = enter;
|
||||||
do {
|
do {
|
||||||
enterList.prepend(w);
|
enterList.append(w);
|
||||||
} while (!w->isWindow() && (w = w->parentWidget()));
|
} while (!w->isWindow() && (w = w->parentWidget()));
|
||||||
}
|
}
|
||||||
if (sameWindow) {
|
if (sameWindow) {
|
||||||
@ -2361,7 +2361,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
|
|||||||
leaveList.append(w);
|
leaveList.append(w);
|
||||||
|
|
||||||
for (auto *w = enter; w != wenter; w = w->parentWidget())
|
for (auto *w = enter; w != wenter; w = w->parentWidget())
|
||||||
enterList.prepend(w);
|
enterList.append(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
QEvent leaveEvent(QEvent::Leave);
|
QEvent leaveEvent(QEvent::Leave);
|
||||||
@ -2383,9 +2383,9 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
|
|||||||
const QPoint globalPos = qIsInf(globalPosF.x())
|
const QPoint globalPos = qIsInf(globalPosF.x())
|
||||||
? QPoint(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)
|
? QPoint(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)
|
||||||
: globalPosF.toPoint();
|
: globalPosF.toPoint();
|
||||||
const QPoint windowPos = enterList.front()->window()->mapFromGlobal(globalPos);
|
const QPoint windowPos = enterList.back()->window()->mapFromGlobal(globalPos);
|
||||||
for (int i = 0; i < enterList.size(); ++i) {
|
for (auto it = enterList.crbegin(), end = enterList.crend(); it != end; ++it) {
|
||||||
auto *w = enterList.at(i);
|
auto *w = *it;
|
||||||
if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) {
|
if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) {
|
||||||
const QPointF localPos = w->mapFromGlobal(globalPos);
|
const QPointF localPos = w->mapFromGlobal(globalPos);
|
||||||
QEnterEvent enterEvent(localPos, windowPos, globalPosF);
|
QEnterEvent enterEvent(localPos, windowPos, globalPosF);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user