Hello!

I am new to Qt, my question may seem simple, but I searched all over the Internet and didn't find the right answer.

I have a QThread class:

Qt Code:
  1. #include "thread.h"
  2.  
  3. Thread::Thread(QObject *parent)
  4. : QThread(parent)
  5. {
  6. }
  7.  
  8. void Thread::run(string url)
  9. {
  10. ui->webView->setUrl(QUrl(url.c_str()));
  11.  
  12. connect(ui->webView, SIGNAL(loadFinished(bool)), SLOT(onLoadFinished(bool)));
  13. connect(ui->webView, SIGNAL(loadProgress(int)), SLOT(onLoadProgress(int)));
  14. //connect(pd, SIGNAL(canceled()), this, SLOT(cancel()));
  15.  
  16. exec();
  17. }
To copy to clipboard, switch view to plain text mode 

Of course, this code doesn't work because I can't access ui from my main class.

So the question is: How can I access the widgets in my main class from this class?