[PyKDE] doubleClicked signal in QIconView (solved)

Karsten Künne kuenne at rentec.com
Sat Nov 29 06:08:00 GMT 2003

Forget my previous posting, I found the solution. I just forgot a * (stupid 

self.connect(self,SIGNAL("doubleClicked(QIconViewItem *)"),self.myfun)

That happens if you program until late in the night! Sorry for the noise.

On Friday 28 November 2003 23:38, Karsten Künne wrote:
> Hi,
> I have the following problem and I can't figure out how to solve it. I try
> to create a QIconView and I want to receive the doubleClicked() signal and
> check which icon was clicked but I always get an error if I try to connect
> it. Following is the program snippet:
> class myview(QIconView):
>     def __init__(self,parent = None,name = None,fl = 0):
>         QIconView.__init__(self,parent,name,fl)
>         QIconViewItem(self,"Icon 1",QPixmap("ok.png"))
> self.connect(self,SIGNAL("doubleClicked(QIconViewItem)"),self.myfun)
>     def myfun(self,item):
>         print item
> ....
> If I try to run it I get the following:
> Traceback (most recent call last):
>   File "testing.py", line 18, in ?
>     w = myview()
>   File "testing.py", line 10, in __init__
>     self.connect(self,SIGNAL("doubleClicked(QIconViewItem)"),self.myfun)
> RuntimeError: Signal has wrong argument types for slot
> Now, how can I create a slot which has the right argument types for the
> signal? I'm relatively new to python so please forgive me if this is
> obvious. I can successfully connect signals which don't send any arguments
> but all signals which send a QIconViewItem don't work. This is on SuSE 9.0
> with PyQt 3.8.


'Nobody Expects the Spanish Inquisition'
    -Monty Python

More information about the PyQt mailing list