Hello,
file1.h
{
Q_OBJECT
.... // some code
signals:
void _connection(int);
.... // rest of the code
class MyServer : public QTcpServer
{
Q_OBJECT
.... // some code
signals:
void _connection(int);
.... // rest of the code
To copy to clipboard, switch view to plain text mode
file1.cpp
void MyServer::incomingConnection(int handle)
{
MyClient *client = new MyClient(this);
client->setsocket(handle);
emit _connection(handle); // i emit it here
}
void MyServer::incomingConnection(int handle)
{
MyClient *client = new MyClient(this);
client->setsocket(handle);
emit _connection(handle); // i emit it here
}
To copy to clipboard, switch view to plain text mode
file2.h
#include "file1.h"
{
Q_OBJECT
... // code here
private:
MyServer *server;
... // rest of code
#include "file1.h"
class Blabla: public QObject
{
Q_OBJECT
... // code here
private:
MyServer *server;
... // rest of code
To copy to clipboard, switch view to plain text mode
file2.cpp
server = new MyServer;
connect(server,SIGNAL(_connection()), this, SLOT(connected())); // the slot is declared in the code
server = new MyServer;
connect(server,SIGNAL(_connection()), this, SLOT(connected())); // the slot is declared in the code
To copy to clipboard, switch view to plain text mode
The issue:
----------
The signal is not emitted within the incoming connction.
The question:
-------------
Why ?
Thanks,
Vladimir.
Bookmarks