#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;
}
没有合适的资源?快使用搜索试试~ 我知道了~
QtTCP服务器客户端
共78个文件
o:19个
cpp:15个
obj:12个
4星 · 超过85%的资源 需积分: 50 91 下载量 90 浏览量
2013-05-01
13:31:09
上传
评论 3
收藏 3.17MB ZIP 举报
温馨提示
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 (78个子文件)
tcp
client
client.pro.user 36KB
tcpclient.h 538B
dialog.cpp 1KB
dialog.h 428B
tcpclient.cpp 2KB
main.cpp 185B
Data_Type.h 572B
dialog.ui 9KB
client.pro 396B
service-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____
Makefile.Debug 8KB
Makefile.Release 8KB
ui_dialog.h 27KB
debug
moc_dialog.cpp 2KB
service.pdb 1.29MB
moc_tcpthread.cpp 3KB
moc_dialog.obj 55KB
tcpserver.obj 49KB
tcpthread.o 161KB
moc_tcpserver.cpp 3KB
service.ilk 949KB
moc_dialog.o 180KB
service.intermediate.manifest 638B
service.exe 1.42MB
dialog.o 267KB
main.obj 51KB
moc_tcpserver.o 152KB
tcpthread.obj 61KB
tcpserver.o 144KB
dialog.obj 273KB
main.o 169KB
moc_tcpthread.o 152KB
moc_tcpthread.obj 47KB
moc_tcpserver.obj 47KB
Makefile 7KB
release
moc_dialog.cpp 3KB
moc_tcpthread.cpp 3KB
tcpthread.o 7KB
moc_tcpserver.cpp 3KB
moc_dialog.o 8KB
service.exe 112KB
dialog.o 52KB
moc_tcpserver.o 5KB
tcpserver.o 2KB
main.o 1KB
moc_tcpthread.o 5KB
vc100.pdb 844KB
client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____
Makefile.Debug 7KB
Makefile.Release 7KB
ui_dialog.h 10KB
debug
client.pdb 1.21MB
moc_dialog.cpp 2KB
moc_tcpclient.o 151KB
moc_dialog.obj 54KB
tcpclient.o 168KB
moc_dialog.o 180KB
client.intermediate.manifest 638B
dialog.o 220KB
main.obj 51KB
moc_tcpclient.obj 47KB
client.ilk 890KB
moc_tcpclient.cpp 3KB
client.exe 1.13MB
dialog.obj 158KB
main.o 169KB
tcpclient.obj 60KB
Makefile 7KB
release
vc100.pdb 828KB
service
tcpserver.cpp 937B
tcpthread.h 807B
dialog.cpp 3KB
dialog.h 585B
main.cpp 185B
service.pro 437B
Data_Type.h 572B
dialog.ui 25KB
tcpserver.h 689B
service.pro.user 36KB
tcpthread.cpp 2KB
共 78 条
- 1
SoEasy_
- 粉丝: 10
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页