Can't write in a dialog
Unsolved
General and Desktop
-
@jsulm its in class clientMainForm : public QDialog
As I have mentioned earlier , everything about QTcpSocket is done in clientMainForm class using signals and slots.
in clientMainForm.h,public: QTcpSocket *m_clientSocket;
clientMainForm.cpp
void clientMainForm::on_btnConnect_clicked() { m_clientSocket=new QTcpSocket(this); m_clientSocket->connectToHost(ui->IPText->toPlainText(),qint16(ui->PortTxt->toPlainText().toInt())); if(m_clientSocket->waitForConnected(1000)){ qDebug()<<"Client Connected"; } connect(m_clientSocket,SIGNAL(readyRead()),this,SLOT(ReceiveData())); connect(m_clientSocket,SIGNAL(disconnected()),this,SLOT(connectionLost())); }
-
Hi,
Are you trying to implement something like Qt's network chat example ?
-
@SGaist not exactly the same
What I'm trying here is , I have a QListView in which , by using QWidget createEditor();* multiple creators(the image iploaded in earlier post) are created . I want to send the text written in that editor to server. -
So you want to have several "chat windows" in your QListView that all send to the same server ?
-
And each of these chat window would handle its socket itself ?
-
Then it looks like the Fortune Client example might be a better base.