Seite 1 von 1
Button: Wie deaktivieren der automatischen Shortcuts
Verfasst: 8. Juli 2008 16:18
von hilefoks
Moin,
ich hab in meiner Anwendung ein paar QToolButtons bei denen ich gerne verhindern moechte das Qt automatisch Shortcuts erstellt (die, die ich auch mit einem & im Button Text explizit erstellen kann). Weiss jemand wie das geht?
Verfasst: 8. Juli 2008 16:23
von Christian81
Daür muss man ihmo das '&' verdoppeln.
Verfasst: 8. Juli 2008 16:27
von hilefoks
Christian81 hat geschrieben:Daür muss man ihmo das '&' verdoppeln.
Danke fuer die schnelle Antwort... aber du hast mich (glaube ich) falsch verstanden.
Ich moechte nicht ein & im Button Text, sondern ich moechte das ueberhaupt kein Shortcut erstellt wird.
Also wenn ich einen Button Text ohne & setze, z.B. setText("Foo");, dann erstellt mir Qt automatisch einen Shortcut - genau diesen moechte ich aber nicht haben.
Verfasst: 8. Juli 2008 17:13
von upsala
Welche Qt-Version macht das? Welche Shortcut würde für 'Foo' erstellt werden? Was hast du gegen Shortcuts?
Verfasst: 8. Juli 2008 17:22
von Christian81
Ich wüsste nicht das dies eine Qt-Version von allein macht:
Code: Alles auswählen
If the text contains an ampersand character ('&'), a shortcut is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous shortcut will be overwritten, or cleared if no shortcut is defined by the text. See the QShortcut documentation for details (to display an actual ampersand, use '&&').
Verfasst: 8. Juli 2008 17:40
von hilefoks
Christian81 hat geschrieben:Ich wüsste nicht das dies eine Qt-Version von allein macht
Oh je... ich denke nun das nicht Qt selbst sondern KDE diese Shortcuts automatisch erstellt. Danke fuer die Antworten, jetzt weiss ich wo ich suchen muss.