Question

Do I need to free Qt toolbars and actions?

I created them this way

QToolBar *tb = new QToolBar(this);
tb->setWindowTitle(tr("Edit Actions"));
addToolBar(tb);

QAction *a;
a = actionUndo = new QAction(...ecc..);

are these deallocated automatically or do I need to free them up?

Was it helpful?

Solution

In short, yes they are deallocated automatically as part of the Qt framework as it appears you are properly passing in the parent (i.e. this in your case). Also, in the case of the QToolBar, calling addToolBar will cause it to be 're-parented' if it didn't already have a correct parent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top