登录
首页 » C++ » 基于Qt的聊天室

基于Qt的聊天室

于 2022-02-11 发布 文件大小:550.82 kB
0 65
下载积分: 2 下载次数: 1

代码说明:

创建了QTcpSokcet类的实例后,可以用conncetToHost()与服务器进行连接:  QHostAddress *serverIP = new QHostAddress();  QString ip = serverIPLineEdit->text();  serverIP->setAddress(ip);  int port = 8010;  tcpSocket->connectToHost(*serverIP, port);  如果成功,将返回connected()信号,错误则返回error(QAbstrackSocket::SocketError socketError)信号 连接成功后可发送或接收数据:  发送:qunit64 write(const QByteArray &byteArray),发挥实际发送字节数,出错返回-1  接收:readyRead()信号被发送,在槽函数中编写处理数据代码,为避免错误解析数据,可用bytesAvailable()返回缓存中接收到的字节数。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • RGB-LED
    本设计已STC89C52RC单片机为基础,HS0038B为一体化红外接收头,恒流驱动采用的AMC7135芯片的红外控制全彩灯(1w的RGB-LED),程序中使用的遥控器用户码和编码和系统电路图已在文件里给出,每一部分已经分别进行注释方便大家理解,因PROTEUS不方便红外仿真所以不再提供仿真模型,由电路图可直接制作实物。(This design has been based on STC89C52RC MCU, HS0038B for integrated infrared receiving head, constant current driver using AMC7135 chip infrared control all the lights (1 w RGB LED), the program used in the user code and code and remote control system circuit diagram has been given in the file, each part has annotated facilitate everybody understand respectively, because of PROTEUS inconvenient infrared simulation, so no longer provide simulation model made physical circuit diagram directly. )
    2015-06-20 16:35:21下载
    积分:1
  • 1
    说明:  求最短路,迪杰斯特拉算法,以格子顶点为点,格子上数字为路径长度(dijkstra to the closest road.)
    2019-08-11 16:34:34下载
    积分:1
  • 12-IR-LED
    PIC红外测试程序,通过红外控制LED灯的亮灭。(PIC infrared testing procedures, through the infrared control LED light.)
    2014-12-29 08:59:23下载
    积分:1
  • RSA
    ras加密实现,图形界面.源码附有注释,方便理解。欢迎下载(ras encryption to achieve, graphical interface. annotated source code to facilitate understanding. Welcome to download)
    2009-07-01 16:53:50下载
    积分:1
  • STM32_USB
    基于STM32的USB实验,移植时需要修改相应部分(Need to modify the corresponding part of the STM32 USB-based experiments, the time of transplantation)
    2012-05-25 17:15:39下载
    积分:1
  • ChipBoardOperate
    剪贴板通信--虽然程序很简单,但是很好地解析了进程和线程的原理,是运用进程和线程的小例子(Clipboard communication- although a simple process, but the good analysis of the principles of process and thread, is to use a small example of the process and thread)
    2011-05-25 17:09:44下载
    积分:1
  • 电机角度控制
    含有PID控制,能实现正反转。当输入角度时,会发出PWM进而控制电机的转动。
    2022-05-29 12:25:34下载
    积分:1
  • 负载均衡器系统的开发
    爱上对方是个大发萨顶顶风高放火建发股份的速度撒发的各回各家股份公司大师傅说过的话就更好的方式发给的话就发撒上规范化改革
    2022-09-26 16:25:03下载
    积分:1
  • exe2swf
    程序是一个可执行文件,程序是把flash编译成的可执行文件转换成swf类型.(Program is an executable file, the program is to compile the executable file flash convert swf type.)
    2009-09-29 11:31:52下载
    积分:1
  • Campus-navigation-system
    校园导航系统包含佛山科技学院本部校区的校园景点平面图。通过系统的各功能不仅可以查询任意景点的编号,名称,简介等信息,还可以查询任意两景点间的最短路径及长度和所有路径及长度。另外,还可以通过一系列操作增加,更改或删除任意的景点的各信息。(Contains the campus attractions plan of the campus Foshan Institute of Technology campus navigation system. Through the function of the system not only can query any spots number, name, profile and other information, can also query the shortest path and arbitrary length between two spots and all paths and the length of. In addition, can also increase through a series of operations, the information change or delete any of the attractions.)
    2015-05-09 16:19:30下载
    积分:1
  • 696518资源总数
  • 105559会员总数
  • 1今日下载