Issue
What is the purpose of the '&' in the string in this line?
exitAction = QtGui.QAction(QtGui.QIcon('exit.png'), '&Exit', self)
Likewise here:
fileMenu = menubar.addMenu('&File')
Solution
The &
character has a special purpose if you use it in the text of a QAction
object: If the QAction object is used in a tool button, the character directly after the &
symbol can be used as a keyboard shortcut for that button (in combination with the alt-key).
See http://doc.qt.io/qt-5/qaction.html (resp. http://doc.qt.io/qt-5/qaction.html#QAction-2).
Answered By - pschill
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.