Move QWindowPrivate::globalPosition() definition out of header
Change-Id: Icaf68600a20d1845a5667a49306686948a20b42e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>bb10
parent
2a151bbe49
commit
69d0eafa08
|
|
@ -2444,6 +2444,20 @@ QPoint QWindow::mapFromGlobal(const QPoint &pos) const
|
|||
return pos - d->globalPosition();
|
||||
}
|
||||
|
||||
QPoint QWindowPrivate::globalPosition() const
|
||||
{
|
||||
Q_Q(const QWindow);
|
||||
QPoint offset = q->position();
|
||||
for (const QWindow *p = q->parent(); p; p = p->parent()) {
|
||||
if (p->type() != Qt::ForeignWindow) {
|
||||
offset += p->position();
|
||||
} else { // Use mapToGlobal() for foreign windows
|
||||
offset += p->mapToGlobal(QPoint(0, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
Q_GUI_EXPORT QWindowPrivate *qt_window_private(QWindow *window)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -123,19 +123,7 @@ public:
|
|||
|
||||
void deliverUpdateRequest();
|
||||
|
||||
QPoint globalPosition() const {
|
||||
Q_Q(const QWindow);
|
||||
QPoint offset = q->position();
|
||||
for (const QWindow *p = q->parent(); p; p = p->parent()) {
|
||||
if (p->type() != Qt::ForeignWindow) {
|
||||
offset += p->position();
|
||||
} else { // QTBUG-43252, mapToGlobal() for foreign children.
|
||||
offset += p->mapToGlobal(QPoint(0, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
QPoint globalPosition() const;
|
||||
|
||||
QWindow *topLevelWindow() const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue