⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialog.h

📁 Qt中的网络编程的收数据的客户端
💻 H
字号:
#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTcpSocket>
#include <QtSql>
#include <QSqlDatabase>
#include <QTextEdit>
#include <QTime>
#include <QFile>
#include <QDir>
#include <QTimer>
 
 class QDialogButtonBox;
 class QLabel;
 class QLineEdit;
 class QPushButton;
 class QTcpSocket;
 class QTextEdit;
 class QSqlDatabase;
 class QSqlQuery;
 class QTime;
 class QDate;
 
class Dialog : public QDialog
{
    Q_OBJECT

public:
     Dialog(QWidget *parent = 0);
     void getip();
     void log(QByteArray);
     void copy();   //备份
 

private:
     
     //图形界面
     QLabel *serverLabel;
     QLabel *ipInfoLabel;
     QLabel *sqlipLabel;
     QLabel *databaseLabel;
     QLabel *sqluserLabel;
     QLabel *sqlpassLabel;
     QLabel *startdateLabel;
     QLabel *starttimeLabel;
     
     QComboBox *ComboBox;
     QLineEdit *ipInfoLineEdit;
     QLineEdit *sqlipLineEdit;
     QLineEdit *databaseLineEdit;
     QLineEdit *sqluserLineEdit;
     QLineEdit *sqlpassLineEdit;
     QLineEdit *startdateLineEdit;
     QLineEdit *starttimeLineEdit;
     
     QPushButton *beginButton;
     QPushButton *quitButton;
     QDialogButtonBox *buttonBox;
     QTextEdit display;
     
     //存储服务器信息
     int port;
     QString host;
     
     QString filepath;
     QDir dir;
     
     QByteArray fortune[5];
     QTimer *timer1;
    // QTimer *timer2;
     QTcpSocket *tcpSocket;
     QSqlDatabase db;
     
     long numflag;
 
public slots:
     
     //从套接字读数据,并存于数据库中
     void sendFortune();
     
     //创建数据库连接,开始定时
     void begin();
      
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -