QTfrontend/databrowser.h
author nemo
Fri, 16 Sep 2011 15:26:02 -0400
changeset 5939 d4680c51b220
parent 5780 528dd4a14861
permissions -rw-r--r--
merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5755
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     1
#ifndef DATABROWSER_H
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     2
#define DATABROWSER_H
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     3
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     4
#include <QTextBrowser>
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     5
#include <QSet>
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     6
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     7
class QNetworkAccessManager;
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     8
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
     9
class DataBrowser : public QTextBrowser
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    10
{
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    11
    Q_OBJECT
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    12
public:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    13
    explicit DataBrowser(QWidget *parent = 0);
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    14
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    15
signals:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    16
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    17
public slots:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    18
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    19
private:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    20
    QNetworkAccessManager *manager;
5780
528dd4a14861 Support Qt version which have no qHash(QUrl)
unc0rr
parents: 5755
diff changeset
    21
    
528dd4a14861 Support Qt version which have no qHash(QUrl)
unc0rr
parents: 5755
diff changeset
    22
    // hash and set of QString instead of QUrl to support Qt versions 
528dd4a14861 Support Qt version which have no qHash(QUrl)
unc0rr
parents: 5755
diff changeset
    23
    // older than 4.7 (those have no support for qHash(const QUrl &))
528dd4a14861 Support Qt version which have no qHash(QUrl)
unc0rr
parents: 5755
diff changeset
    24
    QHash<QString, QByteArray> resources;
528dd4a14861 Support Qt version which have no qHash(QUrl)
unc0rr
parents: 5755
diff changeset
    25
    QSet<QString> requestedResources;
5755
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    26
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    27
    QVariant loadResource(int type, const QUrl & name);
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    28
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    29
private slots:
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    30
    void resourceDownloaded();
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    31
};
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    32
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff changeset
    33
#endif // DATABROWSER_H