You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, September 20th 2005, 9:27pm

Strange compilation of "connect"

Hi,

I have a strange compilation errors with the "connect" function.
I don't understand, because the code is the same than FortuneClient.cpp

Here is my code:

QTcpSocket *clientConnection = m_s->nextPendingConnection();

compilation :

error C2664: 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : impossible de convertir le paramètre 1 de 'QTcpSocket *' en 'const QObject *'

I have to put:
connect((QObject*)clientConnection, SIGNAL(disconnected()), m_s, SLOT(deleteLater()));

Why ?

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

2

Tuesday, September 20th 2005, 9:39pm

RE: Strange compilation of "connect"

You are missing #include <QTcpSocket> and the compiler doesn't know QTcpSocket inherits QObject.