i have some clarification regarding Qt programming.
In Qt most of the time we instantiate widget by allocating the memory dynamically.
is there any advantages of doing like this from Qt prospective? and what about de-allocation of memory for the widget?. do we need to manually call delete for the allocated memory or Qt handles?
Example
QListView *newlist = new QListView(); //This is good? if so why?
QListView newlist; // why not this?
See my my reply about QObjects.
In short: One creates widgets on the heap, as they usually must survive the current method, and they cannot be assigned nor copied. QWidgets delete their children when they themselves are deleted (or more general, QObjects delete their children), so there is usually no memory management problem if you pass a parent to the widget.