Accesing Base Class Signal using derived Class Object Qt
<p>Hi I am new to the Qt and C++. I have one requirement where I have to access signal of Base class using derived class object. Whether is it possible and if yes then how? I tried to implement it using one simple application, but it is not working.</p>

<p>//Base Class</p>

<p>//Which is emitting signal temp() in it's constructor</p>

<pre><code>class IPCBase : public QWidget
{
    Q_OBJECT

public:
    explicit IPCBase(QWidget *parent = 0);
    ~IPCBase();

signals:
    void temp();

private:
    Ui::IPCBase *ui;
};
</code></pre>

<p>//cpp</p>

<pre><code>IPCBase::IPCBase(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::IPCBase)
{
    ui-&gt;setupUi(this);
    qDebug()&lt;&lt;"coming to base cpp";
    emit temp();
}
</code></pre>

<p>I have created one derived class named IPCReceiver and using the object of IPCReceiver(derived class) I am trying to use the connect statement in another class(Form) and call the SLOT.It is not giving compilation error but the SLOT is not getting called.</p>

<pre><code>Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui-&gt;setupUi(this);

    IPCReceiver *receiver = new IPCReceiver;

    connect(receiver, SIGNAL(temp()), this, SLOT(debug()));
}
</code></pre>

<p>Thanks in advance.</p>