gpt4 book ai didi

c++ - 是否可以在 Qt 中使用带下划线的字母作为键盘快捷键?

转载 作者:行者123 更新时间:2023-11-30 01:20:04 32 4
gpt4 key购买 nike

我想创建一个按钮,可以根据按钮文本的字母使用键盘快捷键触发;该字母应加下划线,以使快捷方式更加明显。

最佳答案

查看QShortcut类:

On certain widgets, using '&' in front of a character will automatically create a mnemonic (a shortcut) for that character, e.g. "E&xit" will create the shortcut Alt+X (use '&&' to display an actual ampersand). The widget might consume and perform an action on a given shortcut. On X11 the ampersand will not be shown and the character will be underlined. On Windows, shortcuts are normally not displayed until the user presses the Alt key, but this is a setting the user can change. On Mac, shortcuts are disabled by default. Call qt_set_sequence_auto_mnemonic() to enable them. However, because mnemonic shortcuts do not fit in with Aqua's guidelines, Qt will not show the shortcut character underlined.

关于c++ - 是否可以在 Qt 中使用带下划线的字母作为键盘快捷键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19845774/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com