title: Connecting signals and slots in a QTextEdit subclass?
body: <p>I derived a class from QTextEdit and use it as a "logbook". I equipped it with a slot to receive log-messages.</p>
  
  <pre><code>class CLogbook : public QTextEdit
  {
     Q_OBJECT;
      public:
      void log(QString msg) {append(msg)};
  
      public slots:
      void recvLogSignal(const QString message)
      {    
           append("hallo");
           std::cout &lt;&lt; "signal received.\n";    
           log(message);
      }
  </code></pre>
  
  <p>};</p>
  
  <p>another class then emits a signal like this:</p>
  
  <pre><code>// in the header
  signals:
      void logMessage(const QString);
  
  // in the implementation
      emit logMessage("qt is cute");
      std::cout &lt;&lt; "if you can read this the logMessage was emitted\n";
  </code></pre>
  
  <p>and also i connect the signal to the slot</p>
  
  <pre><code>connect(tableeditor, SIGNAL(logMessage(const QString)), logbook, SLOT(recvLogSignal(const QString)));
  </code></pre>
  
  <p>However the message is never shown in the "logbook". What am i missing here?</p>
  
  <p>SOLVED: The connect method was called after emitting the signal :-(</p>