Use popup() instead of exec() in examples
popup() is generally better but it has a certain advantage that it does not require a run loop to work, therefore platforms (like WASM) can use it without resorting to extra measures (like asyncify). Task-id: QTBUG-106389 Backport-to: 6.4 6.4.0 Change-Id: I87bde677f84048af82cc9aadd982284bdba41e69 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
5d4178ff47
commit
fc78059934
@ -97,7 +97,7 @@ void DiagramItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||||||
{
|
{
|
||||||
scene()->clearSelection();
|
scene()->clearSelection();
|
||||||
setSelected(true);
|
setSelected(true);
|
||||||
myContextMenu->exec(event->screenPos());
|
myContextMenu->popup(event->screenPos());
|
||||||
}
|
}
|
||||||
//! [5]
|
//! [5]
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ void ColorSwatch::tabInto(QAction *action)
|
|||||||
void ColorSwatch::contextMenuEvent(QContextMenuEvent *event)
|
void ColorSwatch::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
menu->exec(event->globalPos());
|
menu->popup(event->globalPos());
|
||||||
}
|
}
|
||||||
#endif // QT_NO_CONTEXTMENU
|
#endif // QT_NO_CONTEXTMENU
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user