Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Effects of Qt 4 QMenuBar::clear()
oddity last edited by
When I read the documentation for Qt 4.8's void QMenuBar::clear() method, and it says, "Removes all the actions from the menu bar." I interpret that to mean that if I call this on a QMenuBar instance I have created, it deletes--using delete--all the QMenu objects, and any QActions I may have added (using new, of course, in doing so) .
The best way to ensure that is to go through the code. It's Qt 5 but the code for that class didn't moved much.
Kent-Dorfman last edited by Kent-Dorfman
I would argue that remove and delete are two different things. I think it would depend upon how the actions were created. Do you still have pointer references to the actions after clear(), or were they created by something like the following pseudo-code?