fixed menu bugs introduced in f2bff5f150

Turns out setting a QMenu parent *not* in the constructor leads to very strange
behavior. All parents are now set in the constructor.
This commit is contained in:
itsmattkc
2020-04-19 16:19:08 +10:00
parent f063d4741d
commit 410f3d25dc
6 changed files with 16 additions and 29 deletions
+2 -4
View File
@@ -52,7 +52,7 @@ Menu::Menu(const QString &s, QWidget *parent) :
QAction* Menu::InsertAlphabetically(const QString &s)
{
QAction* action = new QAction(s);
QAction* action = new QAction(s, this);
InsertAlphabetically(action);
return action;
}
@@ -73,9 +73,7 @@ void Menu::InsertAlphabetically(QAction *entry)
void Menu::InsertAlphabetically(Menu *menu)
{
QAction* action = new QAction(menu->title());
action->setMenu(menu);
InsertAlphabetically(action);
InsertAlphabetically(menu->menuAction());
}
void Menu::ConformItem(QAction *a, const QString &id, const QString &key)