• 大小: 5.06MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-17
  • 语言: 其他
  • 标签: Qt5.8  多客户端  

资源简介

Qt5.8 实现多客户端

资源截图

代码片段和文件信息

#include “dialog.h“
#include “ui_dialog.h“

Dialog::Dialog(QWidget *parent) :
    QDialog(parent)
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    c = new client();
    s = new service();

    connect(ui->pushButtonSIGNAL(clicked())thisSLOT(senddata()));

    tcpclient = new TcpClient(this);
    tcpclient->set_st_client(c);
    tcpclient->set_st_service(s);
    connect(tcpclientSIGNAL(getData())thisSLOT(showdata()));

    tcpclient->connectToServer();
}

void Dialog::senddata(){
    c->Device_Type = ui->lineEdit->text();
    c->Building_ID = ui->lineEdit_2->text();
    c->Story_Floor = ui->lineEdit_3->text();
    c->Room_No = ui->lineEdit_4->text();
    c->Client_IP = ui->lineEdit_5->text();
    c->State = ui->lineEdit_6->text().toInt();
    c->Command = ui->lineEdit_7->text();

    tcpclient->mes_to_service();
}

void Dialog::showdata(){
    ui->lineEdit_8->setText(s->Server_IP);
    ui->lineEdit_9->setText(s->Card_ID);
    ui->lineEdit_10->setText(s->Password);
    ui->lineEdit_11->setText(s->Data);
    ui->lineEdit_12->setText(s->Weather);
    ui->lineEdit_13->setText(s->Path);
    ui->lineEdit_14->setText(s->Message);
    ui->lineEdit_15->setText(s->Command);
}

Dialog::~Dialog()
{
    delete ui;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        396  2013-04-17 15:40  tcp-Qt5.8\client\client.pro

     文件      36875  2013-04-17 22:13  tcp-Qt5.8\client\client.pro.user

     文件        572  2013-04-17 15:32  tcp-Qt5.8\client\Data_Type.h

     文件       1282  2013-04-17 16:32  tcp-Qt5.8\client\dialog.cpp

     文件        428  2013-04-17 15:40  tcp-Qt5.8\client\dialog.h

     文件       9199  2013-04-17 16:33  tcp-Qt5.8\client\dialog.ui

     文件        185  2013-04-17 15:20  tcp-Qt5.8\client\main.cpp

     文件       1659  2013-04-17 16:35  tcp-Qt5.8\client\tcpclient.cpp

     文件        538  2013-04-17 15:32  tcp-Qt5.8\client\tcpclient.h

     文件    1188908  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\client.exe

     文件     911536  2013-04-17 16:35  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\client.ilk

     文件        638  2013-04-17 16:35  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\client.intermediate.manifest

     文件    1272832  2013-04-17 16:35  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\client.pdb

     文件     225431  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\dialog.o

     文件     162275  2013-04-17 16:34  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\dialog.obj

     文件     172675  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\main.o

     文件      51887  2013-04-17 15:40  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\main.obj

     文件       2426  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\moc_dialog.cpp

     文件     184363  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\moc_dialog.o

     文件      55114  2013-04-17 15:40  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\moc_dialog.obj

     文件       2848  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\moc_tcpclient.cpp

     文件     154763  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\moc_tcpclient.o

     文件      48225  2013-04-17 15:40  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\moc_tcpclient.obj

     文件     172231  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\tcpclient.o

     文件      61247  2013-04-17 16:35  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\debug\tcpclient.obj

     文件       6877  2013-04-17 21:05  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\Makefile

     文件       7308  2013-04-17 21:05  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\Makefile.Debug

     文件       7410  2013-04-17 21:05  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\Makefile.Release

     文件      10014  2013-04-17 21:06  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\ui_dialog.h

     文件     847872  2013-04-17 16:35  tcp-Qt5.8\client-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK____\vc100.pdb

............此处省略147个文件信息

评论

共有 条评论