
Originally Posted by
hkaraoguz84
Hi,
This part is problemmatic I guess. The signal and corresponding slot should have the same arguments. The connection should be like
connect(write,
SIGNAL(textChanged
(QString)),
this,
SLOT(sendMessage
(QString)));
connect(write, SIGNAL(textChanged(QString)), this, SLOT(sendMessage(QString)));
To copy to clipboard, switch view to plain text mode
Your slot should be declared as
void sendMessage(const QString& dummy)
I hope this solves your problem.
my problem is that im not receiving anything from the socket & i need to be able to receive & send, this function:
void MainWindow::appendToWindow()
{
char buffer[1024];
while(socket->canReadLine()) {
socket->readLine(buffer, sizeof(buffer));
read->append(buffer);
}
}
void MainWindow::appendToWindow()
{
char buffer[1024];
while(socket->canReadLine()) {
socket->readLine(buffer, sizeof(buffer));
read->append(buffer);
}
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
hkaraoguz84
The reason you cannot type to "TextEdit* read" is
if you change the argument to "false", you will be able to write in the "read".
i don't want to write here, this text edit is for receiving data from the socket ;/
--
edit:
i made something like this:
if(socket->waitForConnected(-1) == true)
read->append("Connected.");
else
read->append(socket->errorString());
if(socket->waitForConnected(-1) == true)
read->append("Connected.");
else
read->append(socket->errorString());
To copy to clipboard, switch view to plain text mode
it gave me this:
Socket operation timed out
Socket operation timed out
To copy to clipboard, switch view to plain text mode
Bookmarks