title: How can I emit a signal from another class?
body: <p>I have a problem with my Qt application. I'm trying to emit a signal from within another class (it is a nested class of the one in which the signal is placed).</p>
  
  <p>I already connected the signal with a slot, which should be fine. But when I try to emit this signal from within this nested class I get the compiler error:</p>
  
  <blockquote>
    <p>cannot call member function without object</p>
  </blockquote>
  
  <p>What is wrong? I looked for that in Qt documentation but couldn't find reasonable solution or even explanation. </p>
  
  <p>The simplified class definition looks as follows.</p>
  
  <pre><code>class LogWriter : public QDialog
  {   
     Q_OBJECT
  
  public:
     class Log : public QObject
     {
        Q_OBJECT
  
     public:
        bool print;
  
        Log(bool _print, QString _color, QObject *obj = NULL)
           : QObject(obj)
        {
           print = _print;
           color = _color;
        }
     };
  
     LogWriter(QWidget * parent = 0);
     ~LogWriter();
  
  public slots:
     void setMinVal();
     void setMediumVal();
     void setHighVal();
     void cleanWindow();
     void appendText(QString &amp;text);
  
  signals:
     void signalLogAppend(QString);
  };
  </code></pre>
  
  <p>I connect the signal of an instance <code>LOW</code> of the LogWriter in the client code to some slot using the following function call:</p>
  
  <pre><code>connect(&amp;LOW, SIGNAL(signalLogAppend(QString)),
          this, SLOT(appendText(QString&amp;)),
          Qt::DirectConnection);
  </code></pre>