Bug 408584

Summary: Menu entries with submenu entries do not display keyboard shortcut
Product: [Frameworks and Libraries] frameworks-kxmlgui Reporter: Tore Havn <veqz>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Kate showing its Input Modes menu entry, without a keyboard shortcut

Description Tore Havn 2019-06-11 20:21:07 UTC
Created attachment 120801 [details]
Kate showing its Input Modes menu entry, without a keyboard shortcut

I've noticed that the menu entries doesn't show their keyboard shortcuts if they have submenu entries.

Attached is a screenshot of a menu entry in Kate that I've been looking at.

The code for this entry is found in «kateview.cpp», lines 694-698:

    a = ac->addAction(QStringLiteral("switch_next_input_mode"));
    a->setText(i18n("Switch to Next Input Mode"));
    ac->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_V));
    a->setWhatsThis(i18n("Switch to the next input mode."));
    connect(a, SIGNAL(triggered(bool)), SLOT(cycleInputMode()));
Comment 1 Kai Uwe Broulik 2019-06-12 09:15:14 UTC
Does it have a shortcut assigned, even? Maybe it clashes with some other shortcut but I cannot reproduce with other actions such as Dolphin's submenus.
Comment 2 Kai Uwe Broulik 2019-06-12 11:16:40 UTC
You can assign shortcuts to menu items just fine, the "switch to next input mode" is a different action from the "input modes:" menu item and as such doesn't have a shortcut.