在Qt中,如果设置按钮(QPushButton)的Text为 "&Data Operation"(在按钮名称前加一个<font color=red> '&' </font> 字符),即在设置Text:setText( "&Data Operation" ),或创建时 QPushButton *pushButton = new QPushButton ( QObject::tr( "&Data Operation" ) ); Qt的编译器会将字符 <font color=red> '&' </font> 后的 'D' 在显示时下方多一下划线,表明 'D' 为该按钮的快捷键,通过 "Alt+d" 快捷操作来实现对 pushButton 的点击。   

  有的时候,我们需要在按钮上或别的控件上以包括字符<font color=red> '&' </font>为显示名如 "Cache & Burnt",这样字符串中的 <font color=red> '&' </font>需要对其进行转义,普通转义字符<font color=red> '/'</font>并没有效果,而是要输入两次<font color=red> '&' </font>字符。