You need to pass a pointer of your actual main window to the class download. Otherwise you deal with 0 pointers or with different main windows. (Basic C++ and has nothing to do with Qt!)

Alternatively (when download is created in MainWindow) you can use signal and slots.