go through this example
http://qt-project.org/doc/qt-4.8/dia...figdialog.html