Output complaining about signals and slots that DO exist
-
I am getting errors in my output that make no sense. Such as:
QObject::connect: No such signal AppCore::LoginServer::incomingSignal(NetEventInfo* requestEvent) in ServerEngine.cpp:104Here is the line (104) from ServerEngine:
@
connect(mLoginServer, SIGNAL(incomingSignal(NetEventInfo* requestEvent)), this, SLOT(loginRequest(NetEventInfo* requestEvent)));
@Here is the header for the class it is referring too (LoginServer)
@
class LoginServer : public QTcpServer
{
Q_OBJECTpublic:
explicit LoginServer(IServerEngine* engine, QObject* parent = 0);
bool start();signals:
void incomingSignal(NetEventInfo* requestEvent);protected:
void incomingConnection(qintptr socketDescriptor);private slots:
void processLogin(const QByteArray& data);
//void threadFinished(int threadID);private:
IServerEngine* mEngine;
};
@Why does it report the signal doesn't exist when it clearly does?
-
Hi,
Did you register your NewEventInfo class/variable as a Meta Object? -
Hi,
Your connect() statement should only contain the type name, not the variable name.
@
connect(mLoginServer, SIGNAL(incomingSignal(NetEventInfo*)), this, SLOT(loginRequest(NetEventInfo*)));
@ -
Thanks. I did two things that helped solve this problem. First I removed the variables from the code as suggested by JKSH. For a later slot I also changed a qintptr to an int because it said that qintptr was not a MetaObject. If I had needed to continue using a qintptr for whatever reasons, how would I make it a MetaObject?