[PyKDE] Re: Crash when using QAction.setShortcut [SOLVED]

Miguel Lobo mlobol at gmail.com
Mon Mar 5 23:15:41 GMT 2007


No matter, I've just discovered that the proper way to solve this problem is
to create the QApplication before calling QAction.setShortcut e.g.:

from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt

import sys
application = QtGui.QApplication(sys.argv)

action = QtGui.QAction(None)
action.setShortcut(QtGui.QKeySequence(Qt.Key_Q))

Regards,
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070306/ae03dbc1/attachment.html


More information about the PyQt mailing list