[PyKDE] Problem with QMenuData

Phil Thompson phil at river-bank.demon.co.uk
Tue May 21 18:06:00 BST 2002


Thierry Jouve wrote:
> 
> Hello,
> 
> I want to create a popup menu... So I use the class QPopupMenu, but I
> can't insert a simple
> String in it... I made this :
> 
> class CtxtMenu(QPopupMenu) :
> 
>    def __init__(self, parent, name = None):
>       QPopupMenu.__init__(self, parent, name)
>       self.insertItem(QString("Edit"), id = 1, index = -1)
> 
> and I have the following error :
> 
> [...]
>   File "./ObjectsList.py", line 109, in __init__
>     self.insertItem(QString("Edit"), id = 1, index = -1)
> TypeError: Argument 1 of QMenuData.insertItem() has an invalid type
> 
> Help... please

Can you send a (small) complete script that demonstrates the problem.

What version of PyQt?

What version of Qt?

Which platform?

Phil




More information about the PyQt mailing list