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

基于Qt的聊天室

于 2022-02-11 发布 文件大小:550.82 kB
0 105
下载积分: 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 个回复

  • time2
    该程序为C8051F单片机的程序,其主要功能为: 单片机每一秒发送一次如下内容: 学号 = “各自的学号” 日期 = “年-月-日” 通信参数:19200bps,8N1   无硬件握手  看门狗定时器打开 (The program for the C8051F MCU procedures, its main function as follows: )
    2008-05-25 19:24:38下载
    积分:1
  • 基于STM32的电子秤
    电子称重的实现首先是通过压力传感器采集到被测物体的重量并将其转换成电压信号。输出电压信号通常很小,需要通过前级信号处理电路进行准确的线性放大。放大后的模拟电压信号经AD转换进入主控单片机中,再将结果显示在人机界面。(The realization of electronic weighing is firstly to collect the weight of the measured object through a pressure sensor and convert it into a voltage signal. The output voltage signal is usually very small, which requires accurate linear amplification through the front signal processing circuit. The amplified analog voltage signal is converted into the main MCU by AD, and the results are displayed in the man-machine interface.)
    2019-05-23 15:46:32下载
    积分:1
  • TherdTry
    实现雷达的信息接收的插件脚本,剩下的就是凑字数了,第一次上传东西,不知道有没有人看!(Achieve radar information receiving plug-in script, the rest is the word count, the first time to upload things, do not know if there is anyone to see!)
    2020-06-21 22:00:01下载
    积分:1
  • Add-In开发
    一个基于Arcgis engine开发的Arcgis desktop add-in插件代码案例,实现简单的功能,可以供学习使用(An Arcgis desktop add-in plug-in code case based on Arcgis engine, which realizes simple functions and can be used for learning.)
    2020-06-20 18:40:02下载
    积分:1
  • C#模拟QQ登陆,并获取qq好友列表
    获取qq好友列表
    2013-01-08下载
    积分:1
  • matlabandccs
    matlab和ccs调用的例子,里面一些例子还是很值得看看的!(Matlab and ccs calling example, some examples of which are still very worthwhile to see!)
    2006-12-02 19:33:34下载
    积分:1
  • Online-calendar-notepad
    在线日历记事本,使用.net自带控件,实现基本的按日历记事功能。(Online calendar notepad use. Net own control, to achieve the basic functions by calendar notes.)
    2013-07-29 11:29:15下载
    积分:1
  • MMattlabmodeeA
    全数字调制解调器MATLAB仿真真源代码,超级实用,下载即可使用。 (All-digital modem MATLAB simulation is really the source code, super-practical, can be used to download.)
    2012-07-26 11:45:01下载
    积分:1
  • WatchDog
    关于MSP430F149的看门狗定时器系统开发例程。(About MSP430F149 watchdog timer system development routines.)
    2016-11-23 19:04:52下载
    积分:1
  • 基于单片机得PID控制器
    本文叙述了现在几种成熟的PID控制算法,对PID控制器的设计进行了研究,包括对控制器的硬件选型和软件设计,对合适的硬件给予详细的介绍,对程序的运行给出详细的程序流程图。 功能PID控制器的核心选用了ATMEL公司的AT89C51单片机,通过合适的外接硬件来完成模拟数据量的采集处理,数据的模数数模转换,液晶显示,按键输入等。(This paper describes several mature PID control algorithms, and studies the design of PID controller, including the hardware selection and software design of the controller, the detailed introduction of the appropriate hardware, and the detailed program flow chart for the operation of the program. The core of the functional PID controller is ATMEL MCU AT89C51, which completes the collection and processing of analog data, data analog to digital conversion, LCD display and keypad input through the appropriate external hardware.)
    2018-01-12 12:30:00下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载