|
Qt creator2.5 跑别人的聊天程序 别的都正常 就在发送消息的时候 突然弹出该窗口 有知道的朋友 帮我看下 谢谢 初学者 真心不知道这个 百度了下 好像是说编译器的问题比如说 本来是“虫虫” 在线 后面又登陆了一个“小屁孩” 现在我是“小屁孩”的身份向虫虫发送一条信息--->“哈喽 我来了 晚上搞基 在哪里等呢” 如下图所示,然后“虫虫”要回复给"小屁孩" --->"老地方"点发送 就弹出下图所示的错误 window.open('http://www.qtcn.org/bbs/attachment/Mon_1305/26_143458_08f8b7d049c70af.jpg?184');" style="max-width:700px;max-height:700px;" onload="if(is_ie6&&this.offsetWidth>700)this.width=700;" >然后发送按钮的代码 我贴出来 如下所示: void chatform::on_sendButton_clicked() { QString sendText = ui->textEdit->toPlainText(); if(!sendText.isEmpty()) {
QString windowTitle = this->windowTitle().replace("].",""); QString toId = QString(windowTitle.split("[").at(1)); QString msgType = "MSG_CLIENT_CHAT"; QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_6); out << (quint16)0 << msgType << usrname << toId << sendText; out.device()->seek(0);
out << (quint16)(block.size() - sizeof(quint16));
udpSocket->writeDatagram(block.data(), block.size(), QHostAddress(serverIp), (quint16)serverPort.toUInt()+1); ui->listWidget->addItem("I say :\n" + sendText + "\n"); } ui->textEdit->clear(); } 情况 就是这样 简单的说就是A 向B 发送了一条内容 正常 B 回复A 发送内容时 出现异常 这个是什么问题
|