tags:

views:

46

answers:

1

After closing my program after running it from Qt Creator, I can see how message that looks like this:

Widgets left: 0 Max widgets: 281

This is due to the added -widgetcount argument in the Run settings.

My question is, what does max widgets means? Does it represents how many widgets have been created? I'm getting worried in terms of memory usage after seeing the number keeps increasing whenever I reopen and close the same dialog multiple times. It is as if everytime I reopen (the same Dialog), the widgets are not closed properly and new widgets just keep stacking up in the memory.

+1  A: 

According to Qt docs,

-widgetcount, prints debug message at the end about number of widgets left undestroyed and maximum number of widgets existed at the same time

It is used to identify if there are any memory leaks in your application.

From your question,

Widgets left: 0 Max widgets: 281

The number of undestroyed (left) is 0 and Maximum number of widgets existed (Max widgets) is 281..

You don have to worry about Memory leaks as long as the left is zero..

Hope it helps..

liaK
"maximum number of widgets existed at the same time" does this means that if a widget that shows up 5 times will increase the "maximum widgets" to another 5? Meaning the total count is not unique, it will just increase every time a widget shows up?
aurorius
@aurorius, the count will not increase every time the widget shows up but every time you create (`new`) it.. once you have created an instance and if you `hide()` and `show()` the count will not change but will be changed during the creation alone..
liaK