How to disable automatic mnemonics in a Qt application in KDE?

In any Qt application in KDE, when I add a QPushButton constructor to the constructor and check its text:

 void MainWindow::on_pushButton_clicked() { qDebug()<<ui->pushButton->text(); } 

The output signal is preceded by & :

& Pushbutton

This behavior does not exist on Windows. It seems that Qt applications on KDE automatically add shortcuts to all buttons, which is undesirable for me. It should be noted that ampersands are not created by the designer, and you cannot see them in the .ui file. In fact, when a button is added to the widget, & is placed somewhere in the text.

Is it possible to disable automatic Qt application mnemonics in any case?

+8
c ++ qt kde shortcut
source share
2 answers

The KDEPlatformTheme plugin is responsible for this.

The workaround is to add

 [Development] AutoCheckAccelerators=false 

to ~/.config/kdeglobals , which prevents the automatic addition of KDE accelerators.

Associated error: https://bugs.kde.org/show_bug.cgi?id=337491

+13
source share

I am using Gnome 3 and am experiencing the same issue with Qt Designer 5 with automatically added ampersands that are also present in .ui files.

0
source share

All Articles