QTfrontend/databrowser.h
author unc0rr
Sun, 04 Sep 2011 13:46:08 +0400
changeset 5755 a079b4dea081
child 5780 528dd4a14861
permissions -rw-r--r--
Implement DataBrowser which downloads resources (images, css) on its own. There's a hack with resources base url and a bug with images not appearing when downloading done (scroll helps though).

#ifndef DATABROWSER_H
#define DATABROWSER_H

#include <QTextBrowser>
#include <QSet>

class QNetworkAccessManager;

class DataBrowser : public QTextBrowser
{
    Q_OBJECT
public:
    explicit DataBrowser(QWidget *parent = 0);

signals:

public slots:

private:
    QNetworkAccessManager *manager;
    QHash<QUrl, QByteArray> resources;
    QSet<QUrl> requestedResources;

    QVariant loadResource(int type, const QUrl & name);

private slots:
    void resourceDownloaded();
};

#endif // DATABROWSER_H