1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/demo/QtSdkManager/qqtqtiowebpageparser.h
2018-05-02 09:17:33 +08:00

70 lines
1.5 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 QQTQTIOWEBPROTOCOL_H
#define QQTQTIOWEBPROTOCOL_H
#include <QObject>
#include <qqtwebaccessmanager.h>
#include <qqtdictionary.h>
#include <QTimer>
#include <QTime>
class QQtQtIOWebUrlSession: public QQtWebAccessSession
{
Q_OBJECT
public:
explicit QQtQtIOWebUrlSession ( QObject* parent = 0 ) :
QQtWebAccessSession ( parent ) {
url1 = "";
url2 = "";
}
virtual ~QQtQtIOWebUrlSession() {}
QString url1;
QString url2;
};
class QQtQtIOWebPageParser : public QQtWebAccessManager
{
Q_OBJECT
public:
explicit QQtQtIOWebPageParser ( QObject* parent = nullptr );
void startNewParse ( QString url1 = "", QString url2 = "" );
typedef struct tagSdkNode
{
QString name;
QString time;
QString size;
QString detail;
} TSdkNode;
typedef struct tagSdkGroup
{
QString url1;
QString url2;
QList<TSdkNode> list;
} TSdkGroup;
QString getBaseUrl() { return m_baseUrl; }
QList<TSdkGroup>& getSdkGroup() { return sdkGroup; }
signals:
void fetchFinish();
//timeout
void fetchTimeout();
public slots:
private slots:
void replyFinished ( QQtWebAccessSession* session );
void detecteTimeout();
private:
QString m_baseUrl;
/*过去有用这种自定义的有用xml的有用json的留作纪念*/
QList<TSdkGroup> sdkGroup;
/*现在用QQtDict*/
QQtDictionary m_sdkGroup;
/*格式:["5.7"]["5.7.3"][0-3]*/
QTimer* m_timer;
QTime m_time;
};
#endif // QQTQTIOWEBPROTOCOL_H