QtTCP服务器客户端

  • M4_473388
    了解作者
  • 3.2MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-29 04:49
    上传日期
client_indoor = new client(); client_doorban = new client(); client_ad = new client(); service_indoor = new service(); service_doorban = new service(); service_ad = new service(); tcpserver = new TcpServer(this); tcpserver->set_st_client(client_indoor,client_doorban,client_ad); tcpserver->set_st_service(service_indoor,service_doorban,service_ad); connect(tcpserver,SIGNAL(getData()),this,SLOT(getdata())); connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(updata())); tcpserver->listen(QHostAddress::Any,6666); updata();
tcp.zip
  • tcp
  • service
  • dialog.h
    585B
  • service.pro
    437B
  • tcpthread.cpp
    2.2KB
  • service.pro.user
    36.1KB
  • tcpserver.h
    689B
  • Data_Type.h
    572B
  • main.cpp
    185B
  • tcpthread.h
    807B
  • dialog.ui
    25.3KB
  • tcpserver.cpp
    937B
  • dialog.cpp
    3.3KB
  • service-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____
  • release
  • main.o
    1.2KB
  • dialog.o
    52KB
  • service.exe
    111.5KB
  • moc_dialog.o
    8.5KB
  • tcpthread.o
    6.6KB
  • moc_tcpserver.o
    4.9KB
  • moc_tcpthread.cpp
    3.1KB
  • moc_tcpserver.cpp
    3.1KB
  • moc_dialog.cpp
    2.9KB
  • tcpserver.o
    2.2KB
  • moc_tcpthread.o
    4.7KB
  • debug
  • main.o
    168.8KB
  • service.intermediate.manifest
    638B
  • moc_tcpserver.obj
    47.3KB
  • service.ilk
    949.4KB
  • dialog.o
    267.3KB
  • main.obj
    51.4KB
  • service.exe
    1.4MB
  • moc_dialog.o
    180.5KB
  • tcpthread.o
    160.8KB
  • tcpserver.obj
    49.4KB
  • moc_tcpserver.o
    151.8KB
  • moc_tcpthread.cpp
    2.6KB
  • dialog.obj
    272.7KB
  • moc_tcpthread.obj
    46.7KB
  • moc_tcpserver.cpp
    2.6KB
  • moc_dialog.cpp
    2.4KB
  • moc_dialog.obj
    54.6KB
  • tcpthread.obj
    60.5KB
  • service.pdb
    1.3MB
  • tcpserver.o
    144.4KB
  • moc_tcpthread.o
    151.6KB
  • vc100.pdb
    844KB
  • Makefile
    6.8KB
  • Makefile.Debug
    8KB
  • Makefile.Release
    8.2KB
  • ui_dialog.h
    26.6KB
  • client
  • client.pro.user
    36KB
  • dialog.h
    428B
  • tcpclient.cpp
    1.6KB
  • Data_Type.h
    572B
  • main.cpp
    185B
  • tcpclient.h
    538B
  • dialog.ui
    9KB
  • client.pro
    396B
  • dialog.cpp
    1.3KB
  • client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____
  • release
  • debug
  • client.ilk
    890.2KB
  • main.o
    168.6KB
  • moc_tcpclient.o
    151.1KB
  • client.exe
    1.1MB
  • tcpclient.obj
    59.8KB
  • client.pdb
    1.2MB
  • dialog.o
    220.1KB
  • client.intermediate.manifest
    638B
  • main.obj
    50.7KB
  • moc_tcpclient.cpp
    2.8KB
  • moc_dialog.o
    180KB
  • moc_tcpclient.obj
    47.1KB
  • dialog.obj
    158.5KB
  • tcpclient.o
    168.2KB
  • moc_dialog.cpp
    2.4KB
  • moc_dialog.obj
    53.8KB
  • vc100.pdb
    828KB
  • Makefile
    6.7KB
  • Makefile.Debug
    7.1KB
  • Makefile.Release
    7.2KB
  • ui_dialog.h
    9.8KB
内容介绍
#include "dialog.h" #include "ui_dialog.h" Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); client_indoor = new client(); client_doorban = new client(); client_ad = new client(); service_indoor = new service(); service_doorban = new service(); service_ad = new service(); tcpserver = new TcpServer(this); tcpserver->set_st_client(client_indoor,client_doorban,client_ad); tcpserver->set_st_service(service_indoor,service_doorban,service_ad); connect(tcpserver,SIGNAL(getData()),this,SLOT(getdata())); connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(updata())); tcpserver->listen(QHostAddress::Any,6666); updata(); } void Dialog::updata(){ service_indoor->Server_IP = ui->lineEdit_8->text(); service_indoor->Card_ID = ui->lineEdit_9->text(); service_indoor->Password = ui->lineEdit_10->text(); service_indoor->Data = ui->lineEdit_11->text(); service_indoor->Weather = ui->lineEdit_12->text(); service_indoor->Path = ui->lineEdit_13->text(); service_indoor->Message = ui->lineEdit_14->text(); service_indoor->Command = ui->lineEdit_15->text(); service_doorban->Server_IP = ui->lineEdit_23->text(); service_doorban->Card_ID = ui->lineEdit_24->text(); service_doorban->Password = ui->lineEdit_25->text(); service_doorban->Data = ui->lineEdit_26->text(); service_doorban->Weather = ui->lineEdit_27->text(); service_doorban->Path = ui->lineEdit_28->text(); service_doorban->Message = ui->lineEdit_29->text(); service_doorban->Command = ui->lineEdit_30->text(); service_ad->Server_IP = ui->lineEdit_38->text(); service_ad->Card_ID = ui->lineEdit_39->text(); service_ad->Password = ui->lineEdit_40->text(); service_ad->Data = ui->lineEdit_41->text(); service_ad->Weather = ui->lineEdit_42->text(); service_ad->Path = ui->lineEdit_43->text(); service_ad->Message = ui->lineEdit_44->text(); service_ad->Command = ui->lineEdit_45->text(); } void Dialog::getdata(){ ui->lineEdit->setText(client_indoor->Device_Type); ui->lineEdit_2->setText(client_indoor->Building_ID); ui->lineEdit_3->setText(client_indoor->Story_Floor); ui->lineEdit_4->setText(client_indoor->Room_No); ui->lineEdit_5->setText(client_indoor->Client_IP); ui->lineEdit_6->setText(QString("%1").arg(client_indoor->State)); ui->lineEdit_7->setText(client_indoor->Command); ui->lineEdit_16->setText(client_doorban->Device_Type); ui->lineEdit_17->setText(client_doorban->Building_ID); ui->lineEdit_18->setText(client_doorban->Story_Floor); ui->lineEdit_19->setText(client_doorban->Room_No); ui->lineEdit_20->setText(client_doorban->Client_IP); ui->lineEdit_21->setText(QString("%1").arg(client_doorban->State)); ui->lineEdit_22->setText(client_doorban->Command); ui->lineEdit_31->setText(client_ad->Device_Type); ui->lineEdit_32->setText(client_ad->Building_ID); ui->lineEdit_33->setText(client_ad->Story_Floor); ui->lineEdit_34->setText(client_ad->Room_No); ui->lineEdit_35->setText(client_ad->Client_IP); ui->lineEdit_36->setText(QString("%1").arg(client_ad->State)); ui->lineEdit_37->setText(client_ad->Command); } void Dialog::clean() { } Dialog::~Dialog() { delete ui; }
评论