eleanor
3rd July 2008, 21:05
Hi, I'm having problem passing arguments in SLOT:
private slot:
void connectToHost(QString, quint32);
and I'm calling it like this:
connect(connectButton, SIGNAL(clicked()), this, SLOT(connectToHost(host, port)));
while the connectToHost is:
void MainWindow::connectToHost(QString host, quint32 port) {
/* create and connect to the socket */
socket = new QTcpSocket(this);
socket->connectToHost(host, port, QIODevice::ReadOnly);
}
Problem is:
Object::connect: No such slot MainWindow::connectToHost(host,port)
private slot:
void connectToHost(QString, quint32);
and I'm calling it like this:
connect(connectButton, SIGNAL(clicked()), this, SLOT(connectToHost(host, port)));
while the connectToHost is:
void MainWindow::connectToHost(QString host, quint32 port) {
/* create and connect to the socket */
socket = new QTcpSocket(this);
socket->connectToHost(host, port, QIODevice::ReadOnly);
}
Problem is:
Object::connect: No such slot MainWindow::connectToHost(host,port)