1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

[Windows] Fixed inserting QUnicodeControlCharacterMenu to contextmenu.

This commit is contained in:
S. Razi Alavizadeh 2014-03-20 01:14:36 +03:30
parent e36697eedf
commit 0b4be9055e

View File

@ -181,20 +181,14 @@ QMenu* LineEdit::createContextMenu(QAction* pasteAndGoAction)
// Hack to get QUnicodeControlCharacterMenu
QMenu* tmp = createStandardContextMenu();
tmp->setParent(popup);
tmp->hide();
QAction* lastAction = !tmp->actions().isEmpty() ? tmp->actions().last() : 0;
if (lastAction && lastAction->menu() && lastAction->menu()->inherits("QUnicodeControlCharacterMenu")) {
tmp->removeAction(lastAction);
lastAction->setParent(0);
QMenu* m = lastAction->menu();
m->setParent(popup);
popup->addMenu(m);
delete lastAction;
popup->addAction(lastAction);
}
delete tmp;
return popup;
}