QTfrontend/ui/widget/databrowser.h
author sheepluva
Sun, 30 Oct 2011 17:31:53 +0100
changeset 6242 27297c421bbc
parent 6060 fdfc01419815
child 6616 f77bb02b669f
permissions -rw-r--r--
frontend flakes: don't spawn flakes at locations that will cause them to never be within the visible frame
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