Draw system works following the RAII principle

Paint function is calls the draw function which uses the right drawing
function according to the user input menu.
The right function allocates the right analyzer object, calculates and
draws the data. After the draw function the analysis object is out of
scope and deleted instantly. No need to keep the object in the parent
window anymore.