title: Why can not I call virtual function from base class slot Qt
body: <p>Can someone explain to me why is the overridden method is not being called in base class slot,  instead I have a base version of method:</p>
  
  <pre><code>class ThreadsDispatcher : public QObject
  {
     Q_OBJECT
     public:
        explicit ThreadsDispatcher(QObject *parent = 0);
        virtual ~ThreadsDispatcher();
        virtual void OnThreadFinished(IThreadable *pWorker);
  
     public slots:
        void slotThreadFinished(IThreadable *pWorker);
  };
  
  void ThreadsDispatcher::slotThreadFinished(IThreadable *pWorker)
  {
     OnThreadFinished(pWorker);
  }
  
  void ThreadsDispatcher::OnThreadFinished(IThreadable *pWorker)
  {
     qDebug &lt;&lt; "Base method, class" &lt;&lt; this-&gt;metaObject()-&gt;className();
  }
  </code></pre>
  
  <p>A subclass:</p>
  
  <pre><code>class CommandsQueueDispatcher : public ThreadsDispatcher
  {
      Q_OBJECT
      public:
         explicit CommandsQueueDispatcher(CommandFactory* baseFactory, QObject *parent = 0);
         ~CommandsQueueDispatcher();
         void OnThreadFinished(IThreadable *pWorker);
  };
  
   void CommandsQueueDispatcher::OnThreadFinished(IThreadable *pWorker)
   {
      qDebug &lt;&lt; "Subclass method, class" &lt;&lt; this-&gt;metaObject()-&gt;className();
   }
  </code></pre>
  
  <p>After call OnThreadFinished in slot I get:</p>
  
  <pre><code>Base method, class ThreadsDispatcher
  </code></pre>
  
  <p>If I call method OnThreadFinished from another method, I get normal:</p>
  
  <pre><code>Subclass method, class CommandsQueueDispatcher
  </code></pre>
  
  <p>I have tried to connect in base class and subclass, but there no changes:</p>
  
  <pre><code>connect(pThreadWorker, SIGNAL(sigFinished(IThreadable*)), this, SLOT(slotThreadFinished(IThreadable*)));
  </code></pre>
  
  <p>But if I connect from another class, i.e. neither subclass, nor base class:</p>
  
  <pre><code>    connect(pThreadWorker, SIGNAL(sigFinished(IThreadable*)), pWorker, SLOT(slotThreadFinished(IThreadable*)));
  </code></pre>
  
  <p>where I need to replace <code>this</code> with the variable <code>ptr</code>, I get a normal result.</p>
  
  <p>Function where I connect:</p>
  
  <pre><code>bool ThreadsDispatcher::AddThread(IThreadable* pThreadWorker)
  {
     connect(pThreadWorker, SIGNAL(sigFinished(IThreadable*)), this, SLOT(slotThreadFinished(IThreadable*)));
  }
  </code></pre>
  
  <p>I don't instantiate ThreadsDispatcher directly. I create the CommandsQueueDispatcher's object non-static.</p>