Can some please show me , how to create class instances on the stack , the ones I am interested in are the ones which need to have arguments passed on the constructor ,
I use QT as C++ dev environment ,

Code:
QString mystring;  // that is good  , as you can see the class instance do not require a argument to be // passed on to the constructor 
// how to do this in the header file

QPainter mypainter(this);
when ever their is a argument to be passed passed on the constructor I end up doing this;

QPainter *mypainter; // in the header

and then in CPP file

mypianter = new QPainter(this);

I was wondering if there was a way to this on the stack as oppose to the heap.
saves me the trouble of deteting the class instance later

as in
Code:
detete mypainter;