How about simply:
Qt Code:
  1. class MyThread : public QThread {
  2. public:
  3. MyThread(...){
  4. m_arg = -1;
  5. }
  6. void setArg(int a){ m_arg = a; }
  7. protected:
  8. void run(){
  9. doSomething(m_arg);
  10. }
  11. private:
  12. int m_arg;
  13. };
To copy to clipboard, switch view to plain text mode