2013-11-23 00:51:50 +04:00
|
|
|
#ifndef HTMLBROWSER_H
|
|
|
|
#define HTMLBROWSER_H
|
|
|
|
|
|
|
|
#include <QTextBrowser>
|
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
class QNetworkAccessManager;
|
|
|
|
class QNetworkDiskCache;
|
|
|
|
class QNetworkReply;
|
|
|
|
|
2014-12-07 13:11:18 +03:00
|
|
|
class HtmlBrowser: public QTextBrowser
|
2013-11-23 00:51:50 +04:00
|
|
|
{
|
2014-12-07 13:11:18 +03:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-11-23 00:51:50 +04:00
|
|
|
public:
|
2014-12-07 13:11:18 +03:00
|
|
|
explicit HtmlBrowser(QWidget* parent = 0);
|
|
|
|
~HtmlBrowser();
|
|
|
|
|
|
|
|
virtual QVariant loadResource(int type, const QUrl &name);
|
2013-11-23 00:51:50 +04:00
|
|
|
|
|
|
|
protected:
|
2014-12-07 13:11:18 +03:00
|
|
|
QNetworkAccessManager *m_netManager;
|
|
|
|
QNetworkDiskCache *m_diskCache;
|
|
|
|
QHash<QUrl, bool> m_activeRequests;
|
|
|
|
|
2013-11-23 00:51:50 +04:00
|
|
|
protected slots:
|
2014-12-07 13:11:18 +03:00
|
|
|
void resourceLoaded(QNetworkReply *reply);
|
2013-11-23 00:51:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // HTMLBROWSER_H
|