Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, May 2007
does QMenuData::clear () auto delete?


Message 1 in thread

hi,all
if i use QMenuData::clear () to clear a popupmenu which have some
action items and
sub popupmenus,will qt auto delete these children?

regards

--
 [ signature omitted ] 

Message 2 in thread

jiang jefix wrote:
> hi,all
> if i use QMenuData::clear () to clear a popupmenu which have some
> action items and
> sub popupmenus,will qt auto delete these children?
> 
> regards

[Qt 3.3.5]

 From the doc of QMenuData::insertItem ( const QString & text, 
QPopupMenu * popup, int id = -1, int index = -1 ):

"""
The popup must be deleted by the programmer or by its parent widget. 
It is not deleted when this menu item is removed or when the menu is 
deleted.
"""

The same goes for QAction objects.

Martin.

--
 [ signature omitted ]