This is more thankyou to Nick Dandukakis than the answer. It was so helpful. I am such a noob that I would never have thought about destroying an object after the method has completed.
I declared (or instantiated ... or both?) My class in the header file for my main window (window.h), and then added the following functions to the slot in window.cpp:
void Window::on_actionAbout_triggered() { Window::about.show(); Window::about.raise(); Window::about.activateWindow(); }
I assume that this works because about the object previously created and therefore is not limited to the scope of the method or slot, which ends pretty quickly.
source share