mirror of
https://github.com/crystalidea/qt-build-tools.git
synced 2024-11-26 04:31:39 +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)
|
||||
return;
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
menu->popup(screenPos);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user