I'm not sure why you are making things so complex, try this:
Qt Code:
  1. class LogEvent : public QEvent {
  2. public:
  3. LogEvent(const QString &str) : QEvent(QEvent::MaxUser-1), m_str(str){}
  4. const QString &string() const { return m_str; }
  5. private:
  6. QString m_str;
  7. };
  8.  
  9. class Log : public QThread {
  10. public:
  11. Log(){}
  12. void run(){ exec(); }
  13. static void log(const QString &str){ QCoreApplication::postEvent(new LogEvent(str)); }
  14. protected:
  15. void customEvent(QEvent *e){
  16. if(e->type()==QEvent::MaxUser-1){
  17. logData(static_cast<LogEvent*>(e)->string());
  18. }
  19. }
  20. };
To copy to clipboard, switch view to plain text mode 

No need for any mutexes or artificial event queues.