Answer the question
In order to leave comments, you need to log in
Qt: who owns createStandardContextMenu() and how to destroy it?
Here is the code that crashes if you call the same acAddNote (which, in turn, calls the modal dialog).
QSharedPointer<QMenu> menu { tableDelegate.editor()->createStandardContextMenu() };
menu->addSeparator();
acAddNote->setText(STR_ADDNOTE);
menu->addAction(acAddNote);
menu->exec(tableDelegate.editor()->mapToGlobal(point));
Answer the question
In order to leave comments, you need to log in
The Qt sources say: the owner is the editor.
02405 #endif
02406 d->actions[QLineEditPrivate::ClearAct]->setEnabled(!d->readOnly && !d->text.isEmpty() && d->hasSelectedText());
02407 d->actions[QLineEditPrivate::SelectAllAct]->setEnabled(!d->text.isEmpty() && !d->allSelected());
02408
02409 QMenu *popup = new QMenu(this);
02410 popup->setObjectName(QLatin1String("qt_edit_menu"));
02411 popup->addAction(d->actions[QLineEditPrivate::UndoAct]);
02412 popup->addAction(d->actions[QLineEditPrivate::RedoAct]);
02413 popup->addSeparator();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question