I am using QNetworkAccessManager instance as a static member of my class. When I use my class in another thread and try to call QNetworkAccessManager::post method I receive the following text in the output: "QObject: Cannot create children for a parent that is in a different thread." However everything seems to work fine. Yes, QNetworkAccessManager belongs to a different thread than the one it is used in, but is it really an error to call the post method from another thread, because I don't see any problems except this message?

Qt Code:
  1. class MyClass: public QObject
  2. {
  3. //....
  4. static QNetworkAccessManger manager;
  5. //..
  6. }
  7.  
  8. // my class is then used in the thread
  9. void MyThread::run()
  10. {
  11. MyClass myclass;
  12. myclass.callPostMethod(); // here the warning is printed
  13. }
To copy to clipboard, switch view to plain text mode