1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/demo/LearnCookieTest/mainwindow.h
tianduanrui 444a97e6c9 move example to QQtExample.pro
QQtExample工程依赖于QQt工程
2018-04-23 18:29:20 +08:00

51 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "qqtcore.h"
#include "qqtwebaccessmanager.h"
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow ( QWidget* parent = 0 );
~MainWindow();
//工作过程分析
//首先登陆post带上用户名、密码、单位、验证码
//第二在回复中得到cookie而后就用这个cookie
//第三在每一次回复后都更新cookie并且使用新的cookie进行请求。
//初始页面
void sendInitPage();
//获取登录页面
void sendGetLoginPage();
//开始登录 (未实现填写验证码)
void sendLoginRequest();
//获取数据 (未实现)
void sendYaowuRequest();
private slots:
void replyFinished ( QQtWebAccessSession* session );
void on_pushButton_clicked();
protected:
QList<QNetworkCookie> getLoginCookies();
QList<QNetworkCookie> getSessionCookies();
private:
Ui::MainWindow* ui;
QQtWebAccessManager* m_webmanager;
QNetworkRequest req;
QQtWebAccessCookieJar cookiejar;
};
#endif // MAINWINDOW_H