mirror of
https://github.com/crystalidea/qt-build-tools.git
synced 2024-11-22 19:00:04 +08:00
5.15.2: fix for QTBUG-88309 (QGraphicsItem crash if click right button of mouse)
This commit is contained in:
parent
5c7c107075
commit
ded22c154d
@ -1942,10 +1942,14 @@ void QWidgetTextControlPrivate::contextMenuEvent(const QPoint &screenPos, const
|
|||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
if (auto *window = static_cast<QWidget *>(parent)->window()->windowHandle()) {
|
|
||||||
QMenuPrivate::get(menu)->topData()->initialScreenIndex =
|
if (auto *widget = qobject_cast<QWidget *>(parent)) {
|
||||||
|
if (auto *window = widget->window()->windowHandle()) {
|
||||||
|
QMenuPrivate::get(menu)->topData()->initialScreenIndex =
|
||||||
QGuiApplication::screens().indexOf(window->screen());
|
QGuiApplication::screens().indexOf(window->screen());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->popup(screenPos);
|
menu->popup(screenPos);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user