On Saturday 17 December 2011 19:37:42 Joel B. Mohler wrote:
> Hello,
> 
> I have a little problem with PySide 1.0.8 which I think is odd.  I have
> a work-around, but I don't think it should be necessary from the
> documentation.
> 
> I had this code (which works in PyQt4 and I'm virtually certain that it
> worked in prior versions of PySide):
> 
>      del_key = QtGui.QShortcut(self)
>      del_key.setKey(QtCore.Qt.CTRL + QtCore.Qt.Key_Delete)

Could you file a bug? Just to don't get this issue forgotten in mailing list 
archives.
 
> However, in PySide 1.0.8 which just came in ubuntu I needed to change
> the setKey line to read:
> 
>      del_key.setKey(QtGui.QKeySequence(QtCore.Qt.CTRL +
> QtCore.Qt.Key_Delete))
> 
> This is because it gives the following error:
> 
> TypeError:
> 'PySide.QtGui.QShortcut.setKey' called with wrong argument types:
> 
> 
> PySide.QtGui.QShortcut.setKey(long)
> 
> Supported signatures:
> 
> 
> PySide.QtGui.QShortcut.setKey(PySide.QtGui.QKeySequence)
> 
> 
> 
> Now, I'd be fine with that in general, but it seems to contradict the
> documentation at http://developer.qt.nokia.com/doc/qt-4.8/qshortcut.html
> which gives
> 
>      setKey(Qt <http://developer.qt.nokia.com/doc/Qt.html>::CTRL + Qt
> <http://developer.qt.nokia.com/doc/Qt.html>::Key_P); // Ctrl+P, e.g. to
> print document
> 
> as an example usage.  It also gives a (needless?) portability problem
> from PyQt4.
> 
> Is using an explicit QKeySequence the universally revered way or writing
> this?  Is this fixed in 1.0.9?  Sorry I don't have a 1.0.9 quite as
> handy as this e-mail.
> 
> Thanks, Joel

-- 
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to