[vtkusers] Qt and VTK, QVTKRenderWindowInteractor and key events

Mathieu Malaterre mathieu.malaterre at kitware.com
Fri Jan 28 12:05:41 EST 2005


Prabhu Ramachandran wrote:
>>>>>>"PB" == Patrick Brockmann <Patrick.Brockmann at cea.fr> writes:
> 
> 
>     PB> Hi all, I have already posted this mail but received no
>     PB> answer.  As I can see some traffic about Qt and VTK, I resent
>     PB> this related question.
> 
>     PB> -------------------------------------------------------------------------
>     PB> I have noticed that with the QVTKRenderWindowInteractor class
>     PB> from the VTK at the interim release 4-4, a keypress is always
>     PB> detected in UPPERCASE not in lowercase.
> 
> Sorry, I still have your original mail in my INBOX but haven't gotten
> around to doing much about it.  I'll try and take a look this week or
> the next.  Trouble is I don't use qt so need to get some of this
> installed.  

Hi Prabhu,

	I just try to reproduce and Patrick patch did work.

$ cvs ci -m"BUG: Fix upper/lower case problem. Thanks to Patrick 
Brockmann for patch" 
/cvsroot/ParaView/ParaView/VTK/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py,v 
  <--  QVTKRenderWindowInteractor.py
new revision: 1.5; previous revision: 1.4


	The only thing I am confused about is that I had the same problem as Jon:

http://vtk.org/pipermail/vtkusers/2004-December/077726.html

$ python QVTKRenderWindowInteractor.py 

Traceback (most recent call last):
   File "QVTKRenderWindowInteractor.py", line 343, in ?
     QVTKRenderWidgetConeExample()
   File "QVTKRenderWindowInteractor.py", line 315, in 
QVTKRenderWidgetConeExample
     widget = QVTKRenderWindowInteractor()
   File "QVTKRenderWindowInteractor.py", line 136, in __init__
     apply(qt.QWidget.__init__, (self,parent,name) + args, kw)
TypeError: keyword arguments are not supported


The only solution I could find was from:

http://goldenspud.com/webrog/archives/2004/07/20/pyqt-platform-inconsistencies/

If you try to run that on PyQt atop Qt/Windows though, you’ll get a 
“TypeError: keyword arguments are not supported” exception raised. 
Instead, leave out **kwargs when calling the superclass:
If you leave **kwargs in the signature of your class’s __init__ as shown 
here, just be sure to send keyword-less arguments for those values you 
intend to reach the superclass when you call your class.


Any comments ?
Mathieu



More information about the vtkusers mailing list