Hi there, first post to the forums. Hope someone can help me.

I have a list view which is populated by any of a number of background threads (mutex locked of course ;-). The problem I have is that the list view only redraws with the new rows when I resize it (it's in a docking window).

I guess I need to emit a signal to get it to redraw but I've tried every signal I can find and still no joy. Code sample follows. What am I doing wrong. I guess I need to get the main event loop to fire but how do I send an appropriate event from another thread?

Qt Code:
  1. class MessageList : public QListWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. MessageList(QWidget* pW) : QListWidget(pW) {}
  6.  
  7. void logMessage(const std::string& sMessage) {
  8. boost::mutex::scoped_lock scoped_lock(m_oMessageListMutex);
  9. QListWidgetItem *item = new QListWidgetItem(sMessage.c_str(), this);
  10. setCurrentItem (item);
  11. update();
  12. emit itemChanged(item);
  13. emit itemActivated (item);
  14. emit itemClicked (item);
  15. emit itemDoubleClicked (item);
  16. emit itemEntered (item);
  17. emit itemPressed (item);
  18. }
  19.  
  20. protected:
  21. boost::mutex m_oMessageListMutex;
  22. };
To copy to clipboard, switch view to plain text mode 

Many thanks
Dave