fix memory leaks in qt gui, every instantiation of a qt object should be
wrapped in with-objects