0

在父类中,我在构造函数中有一个插槽设置:

  Class DummyParent 
{
     protected:
        QWebPage page;

     public slots:
          DummyParent() 
          {
              connect (&page , SIGNAL(...) , SLOT(replyFinir(bool));
          } 

          void replyFinir (bool ok)
          {
               // handle reply messages
          }
  };

现在我有另一个派生自 DummyParent 的类:

class DummyChild
{ 
    public slots:
        void replyFinir (bool ok)
        {

        }
}

现在我遇到了问题,因为在 DummyParent 的构造函数中设置了插槽连接,所以它连接到旧处理程序,而不是当前处理程序。

我怎样才能让 DummyChild::page 调用它自己的 replyFinir(bool) 函数?

4

1 回答 1

4

您是否忘记virtual了基类的replyfinir?

或者只是断开/重新连接派生类ctor中的信号

于 2011-12-27T03:57:27.743 回答