r24623 by craig - #16020 and related: Turn off Qt's Text Heuristics on menus for items

scribus-commit scribus-commit at lists.scribus.net
Tue Apr 13 21:23:19 UTC 2021


Author: craig
Date: Tue Apr 13 21:23:19 2021
New Revision: 24623

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24623
Log:
#16020 and related: Turn off Qt's Text Heuristics on menus for items
where we do not explicitly set it

Modified:
    trunk/Scribus/scribus/menumanager.cpp

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24623&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp	(original)
+++ trunk/Scribus/scribus/menumanager.cpp	Tue Apr 13 21:23:19 2021
@@ -162,6 +162,9 @@
 			QMenu *subMenu = menuBarMenus[menuName]->addMenu(menuStringTexts[menuString]);
 			if (!subMenu)
 				continue;
+			//#16020 and related Qt bugs for QMenu/QAction Text Heuristics messing up detection. Turn off the role detection except where we explicitly set it in ActionManager
+			if (subMenu->menuAction()->menuRole() == QAction::TextHeuristicRole)
+				subMenu->menuAction()->setMenuRole(QAction::NoRole);
 			menuBarMenus.insert(menuString, subMenu);
 			if (rememberedMenus.contains(menuString))
 				rememberedMenus.insert(menuString, subMenu);
@@ -199,6 +202,9 @@
 			QMenu *subMenu = menuToAddTo->addMenu(menuStringTexts[menuString]);
 			if (!subMenu)
 				continue;
+			//#16020 and related Qt bugs for QMenu/QAction Text Heuristics messing up detection. Turn off the role detection except where we explicitly set it in ActionManager
+			if (subMenu->menuAction()->menuRole() == QAction::TextHeuristicRole)
+				subMenu->menuAction()->setMenuRole(QAction::NoRole);
 			menuBarMenus.insert(menuString, subMenu);
 			if (rememberedMenus.contains(menuString))
 				rememberedMenus.insert(menuString, subMenu);




More information about the scribus-commit mailing list