Skip to content

Fix opening context menu when item is locked

Martin Marmsoler requested to merge work/contextMenuLockeItem into master

Description

Fix opening context menu when item is locked

When trying to ignore an event, true must be returned, false means the event was handled and therefore QGraphicsscene does not propagate the event to other items. See graphicsscene.cpp

    for (QGraphicsItem *item : items) {
        contextMenuEvent->setPos(item->d_ptr->genericMapFromScene(contextMenuEvent->scenePos(),
                                                                  contextMenuEvent->widget()));
        contextMenuEvent->accept();
        if (!d->sendEvent(item, contextMenuEvent))
            break;
        if (contextMenuEvent->isAccepted())
            break;
    }

Conformity

When external dependencies are removed

  • Reporting to ...
Edited by Martin Marmsoler

Merge request reports

Loading