QObject::connect -- Event -- QFtp stateChange(int)
<p>So I'm a C# developer and I am learning C++ (as hobby).</p>

<p>I use Qt for that, and for practice i want create a FTP client, but I have a problem.</p>

<p>I create an event when the ftp connection state changed, so I want use the event <code>stateChanged(int)</code></p>

<p>But i have a problem :</p>

<pre><code>Error: no matching function for call to 'QObject::connect(QFtp*&amp;, const char*, Ftp* const, const char*)'
</code></pre>

<p>My code :</p>

<pre><code>    #include "ftp.h"

QString _host;
QString _User;
QString _Pass;

Ftp::Ftp(QObject *parent,QString host,QString user,QString pass)
{
    ftp =new QFtp(parent);
    QObject::connect(ftp,SIGNAL(stateChanged(int)),this,SLOT(FtpStateChang(int)));
    _host = host;
    _User = user;
    _Pass = pass;
}

void Ftp::Connect()
{
    ftp-&gt;connectToHost(_host,21);
    ftp-&gt;login(_User,_Pass);
}

void Ftp::FtpStateChang(int state)
{
    //EVENT
}

QString Ftp::CheckConnection()
{
    Connect();
    switch(ftp-&gt;state())
    {
        case QFtp::LoggedIn:
            return "LoggedIn";
        case QFtp::Unconnected:
            return "Unconnected";
        case QFtp::Connecting:
            return "Connecting";
        case QFtp::Closing:
            return "Closing";
    }
}
</code></pre>

<p>Please tell me why. Thank you for your help.</p>
