Thanks for your reply, but my question was rather regarding controller. Model and view are in the same thread, but controller works in a different thread, where it needs to get some data from the model. I decided to create an additional class that wraps QStandardItemModel and added methods like to keep it thread safe:

Qt Code:
  1. // data model
  2.  
  3. class MyDataModel: public QObject
  4. {
  5. public:
  6. QList<SomeDataItem> getItems() const;
  7.  
  8. protected:
  9. QStandardItemModel standardModel;
  10. }
  11.  
  12. QList<SomeDataItem> MyDataModel::getItems() const
  13. {
  14. QList<SomeDataItem> items;
  15. if (standardModel->thread() == QThread::currentThread())
  16. {
  17. // ... gather data in a usual way
  18. }
  19. else
  20. {
  21. // invoke it and wait until finished
  22. QMetaObject::invokeMethod(this, "getItems", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QList<SomeDataItem>, items));
  23. }
  24. return items;
  25. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. // controller
  2.  
  3. Controller::run() // different thread
  4. {
  5. //
  6. QList<SomeItem> items = model->getItems();
  7. // ... do processing...
  8. }
To copy to clipboard, switch view to plain text mode 

Only I am not sure it is the good way to do that. However, I didn't find any explanation regarding multithreaded model-view-controller.