[Interest] [OS X/KF5] menus become menu items and cause repetitive warnings

René J.V. Bertin rjvbertin at gmail.com
Fri Dec 11 23:55:31 CET 2015


Hi,

After building kate I'm seeing repeating messages like the ones below on the calling terminal, using either Kate or KWrite. (I've patched my Qt build to give more informative warnings).

void QCocoaMenu::insertNative(QCocoaMenuItem *, QCocoaMenuItem *) Menu item "Clipboard &History" is already in menu "Edit" , remove it from the other menu first before inserting into "Untitled"
void QCocoaMenu::insertNative(QCocoaMenuItem *, QCocoaMenuItem *) Menu item "&Bookmarks" is already in menu "" , remove it from the other menu first before inserting into "Untitled"
virtual void QCocoaMenu::removeMenuItem(QPlatformMenuItem *) Item "Clipboard &History" to remove does not belong to this menu "Untitled"
virtual void QCocoaMenu::removeMenuItem(QPlatformMenuItem *) Item "&Bookmarks" to remove does not belong to this menu "Untitled"
void QCocoaMenu::insertNative(QCocoaMenuItem *, QCocoaMenuItem *) Menu item "Clipboard &History" is already in menu "Edit" , remove it from the other menu first before inserting into "Untitled"
void QCocoaMenu::insertNative(QCocoaMenuItem *, QCocoaMenuItem *) Menu item "&Bookmarks" is already in menu "" , remove it from the other menu first before inserting into "Untitled"
void QCocoaMenu::insertNative(QCocoaMenuItem *, QCocoaMenuItem *) Menu item "Clipboard &History" is already in menu "Edit" after item "" , remove it from the other menu first before inserting into "Edit"
virtual void QCocoaMenu::removeMenuItem(QPlatformMenuItem *) Item "Clipboard &History" to remove does not belong to this menu "Untitled"
virtual void QCocoaMenu::removeMenuItem(QPlatformMenuItem *) Item "&Bookmarks" to remove does not belong to this menu "Untitled"

>From what I've been able to gather, this means that the 2 menus in question get added to another menu (the Edit menu for "Clipboard History") rather than becoming a (toplevel) menu of their own.
Evidently it is too late to figure out why this happens at the time the warning is printed.

Both menus are created from classes in KF5 kwidgetsaddons, but instantiated and added to the interface in the Kate source code.

Pointers to understand what's happening here would be greatly appreciated. The fact that "Clipboard History" ends up in the Edit menu suggests that QAction::TextHeuristicRole is involved somehow, but forcing apparently relevant QActions to QAction::NoRole didn't help.

Thanks in advance,
René



More information about the Interest mailing list