My current understanding is that variables that are created in the constructor of the QThread-derived class will nevertheless be created in the context of the thread that created the instance of such class. For example, in the case below variable "a" is created in the context of main thread, but variable "b" is created in the context of the thread "threadOne". Is my understanding correct?

Qt Code:
  1. class threadOne : public QThread
  2. {
  3. QString* a;
  4. QString* b;
  5. public:
  6. threadOne() {
  7. a = new QString();
  8. }
  9. private:
  10. void run() {
  11. b = new QString();
  12. }
  13. }
  14.  
  15. void main() {
  16. threadOne thread;
  17. }
To copy to clipboard, switch view to plain text mode