
qt
虚幻交界
这个作者很懒,什么都没留下…
展开
-
Qt计时器
Qt 时钟主要使用QTimer和QTime类 QTimer类 初始化QTimer对象 QTimer *timer = new QTimer; 开始计时 // void start(std::chrono::milliseconds msec) timer->start(1000); // 每隔 1000 毫秒发射一个timeout信号 关联timeout信号 connect(timer, &QTimer::timeout, this, &timerDemo::timeout_slo原创 2022-05-31 11:53:21 · 774 阅读 · 1 评论 -
Qt udp编程
初始化udpSocket QUdpSocket * udpSocket = new QUdpSocket(this); 绑定本地端口 quint64 port = ui->localPort->text().toUInt(); udpSocket->bind(port); 关联readyRead信号 connect(udpSocket, &QUdpSocket::readyRead, this, &UdpDemo::readyRead_slot); 实现readyRe原创 2022-05-31 09:42:45 · 698 阅读 · 0 评论 -
Qt 网络编程制作一个客户端与服务器
tcp服务器 使用 QtcpServer 与 QtcpSocket 类 使用QtcpServer、QtcpSocket类之前在项目的.pro文件中 添加 Qt += network 步骤 初始化一个QTcpServer 对象,注意初始化时传入一个this指针 QTcpServer *tcpServer = new QTcpServer(this); 关联newConnection信号,开启监听后,当一个新的连接接入,会发射newConnection信号,并使用关联的newConnection_slo原创 2022-05-25 16:35:53 · 1395 阅读 · 0 评论