MCPcopy Create free account
hub / github.com/KDE/konsole / removeMenuAccelerators

Method removeMenuAccelerators

src/MainWindow.cpp:202–208  ·  view source on GitHub ↗

remove accelerators for standard menu items (eg. &File, &View, &Edit) etc. which are defined in kdelibs/kdeui/xmlgui/ui_standards.rc, again, to avoid conflicting with Alt+[Letter] terminal shortcuts TODO - Modify XMLGUI so that it allows the text for standard actions defined in ui_standards.rc to be re-defined in the local application XMLGUI file (konsoleui.rc in this case) - the text for standar

Source from the content-addressed store, hash-verified

200// XMLGUI file (konsoleui.rc in this case) - the text for standard items
201// can then be redefined there to exclude the standard accelerators
202void MainWindow::removeMenuAccelerators()
203{
204 const QList<QAction *> actions = menuBar()->actions();
205 for (QAction *menuItem : actions) {
206 menuItem->setText(menuItem->text().replace(QLatin1Char('&'), QString()));
207 }
208}
209
210void MainWindow::restoreMenuAccelerators()
211{

Callers

nothing calls this directly

Calls 4

setTextMethod · 0.80
QStringClass · 0.50
actionsMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected