I have a main window class built in Qt Designer and called Ui_MainWindow which has a publicly defined QProgressBar object called *downloadProgressBar. I also have a class called HttpGet, which is supposed to download a file from a url supplied by the user. There is a function called HttpGet :: updateReadProgress that is intended to update downloadProgressBar as the file is downloaded, which would require manipulation of the progress bar from within the function, but I unable to figure out how to go about this.
My assumption would be that I would include the relevant header file and then access the progress bar object via
Ui_MainWindow :: downloadProgressBar -> setValue()
but when I try to compile this code, I get the following error:
error: ‘downloadProgressBar’ is not a member of ‘Ui_MainWindow’
which tells me that I’ve misunderstood what it is I’m asking the compiler to do. Can someone please tell me how I should go about updating the progress bar from within HttpGet, or if that’s the wrong thing to do, can you please give me a better alternative?
Ui_MainWindowis a class. you need object of that class to deal with members.Also, you should read C++ GUI Programming with Qt 4 (2nd Edition) before writing more code. it’s awailable in pdf around the web…