Max widgets information in Qt
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.
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..
精彩评论