[pyqt] How to copy the content of a QPopupMenu ?

2006-04-05 Thread kobayashi
Dear all, For a particuliar case, I need to copy all the items of an existing menu (including the separators and sub-menus) in a new empty one ... Does someone knows how to do that ? I've tried : item = menu_orig.findItem(item_id) menu_new.insertItem(item, item_id) but it fails with : TypeError:

Re: [pyqt] How to copy the content of a QPopupMenu ?

2006-04-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Dear all, For a particuliar case, I need to copy all the items of an existing menu (including the separators and sub-menus) in a new empty one ... Does someone knows how to do that ? I've tried : item = menu_orig.findItem(item_id) menu_new.insertItem(item,

Re: How to copy the content of a QPopupMenu ?

2006-04-05 Thread kobayashi
Dear Diez, Thanks ... I've already read the doc :) In my case, I would like to copy an item from a popup menu to another popup menu ... Of course, I can create a new item with same name, same pixmap and so on but I don't know how to execute the same code when my new item is activated ... And I

Re: How to copy the content of a QPopupMenu ?

2006-04-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Dear Diez, Thanks ... I've already read the doc :) In my case, I would like to copy an item from a popup menu to another popup menu ... Of course, I can create a new item with same name, same pixmap and so on but I don't know how to execute the same code when

Re: How to copy the content of a QPopupMenu ?

2006-04-05 Thread David Boddie
[EMAIL PROTECTED] wrote: In my case, I would like to copy an item from a popup menu to another popup menu ... Of course, I can create a new item with same name, same pixmap and so on but I don't know how to execute the same code when my new item is activated ... And I don't know how to

Re: How to copy the content of a QPopupMenu ?

2006-04-05 Thread David Boddie
Well, the Google web interface didn't quite work as expected there. Here's a version of the previous message containing just my advice. You might want to use QAction to define individual items that can be activated. That way you can just reuse the same actions in both menus or move them from one